Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed my linux-system on a USB-stick. That works well, I can use it on different computers. I used ext4 as filesystem and ask myself it this is the best choice. Which file-system is best for USB-sticks? A good filesystem should not destroy the flash-drive too fast. Additional activities to secure data-integrity might be good (I do an daily backup). Another criterion might be higher performance.

share|improve this question

5 Answers 5

FAT tends to be what they put on flash drives because it is the only filesystem that operates on all of the major operating systems.

NTFS tends be for people who

  1. Use Windows, and
  2. Prefer performance over safety

(FAT writes in a way that minimizes write grouping at the sacrifice of performance.)

Though it seems you are using Linux off of it. That case, ext4 is pretty much all you're gonna get out of it. It's journaling so data integrity is kept and is fairly fast and stable.

Word of advice with Linux USBs however: unless you use something like Slax or Puppy Linux, your drive isn't going to last much longer than 2, maybe 3 years.

share|improve this answer
    
Why will the stick last not longer? –  Mnementh Dec 18 '10 at 11:00
1  
The amount of writes you do on the flash drive when using linux is almost quintupled. An average drive will last 10 years on normal use. Slax and Puppy are designed for flash drives and minimize writes whenever possible. –  digitxp Dec 18 '10 at 14:36
1  
As far as I understand, on Linux, btrfs improves both performance and longevity on flash media, even the cheap non-reallocating kind found on USB sticks. Btrfs is still experimental, though some recent distributions are offering it as an option. –  Gilles Dec 18 '10 at 22:32
    
@Gilles I think the experimentality of it is probably the problem. –  digitxp Dec 18 '10 at 23:41
    
You may want to try aufs which allows you to mount the USB for reading and using the RAM for writing on certain filesystems like /var. That allows you to drasticly limit writes. –  Kwaio Oct 27 '13 at 13:47

Use EXT2 on flash drives to reduce write cycles. Every time you write to a EXT 4 drive, the journal must be updated which causes more writing. I use EXT 2 and password protect it using GParted or "Disk Utility".

I have never noticed a speed advantage with EXT 3 or 4 anyway.

share|improve this answer

The latest Linux kernels support F2FS a SSD optimized file system but it still experimental. If the system on the stick is not too critical you could try it out.

Otherwise with ext4:

  • disable the relatime flag (records access time)
  • enable TRIM (discard flag)

In general

  • use the NOOP scheduler instead of CFQ

See How to maximise SSD performance with Linux for the details.

Sample fstab

/dev/sda   /   ext4   noatime,nodiratime,discard,errors=remount-ro 0 1
share|improve this answer

Justa Guy is correct that the journaling feature of EXT4 will increase write frequency. The best Filesystem to use in your application is EXT4, but with journaling disabled and with Matteo's suggestions as well.

An even better portability solution, depending on the size of your volume, may be to move the volume to RAM at boot then write to disk at log off. In which case I would recommend Ext4, with journaling(default) and discard. The code for this is standard on a couple pen drive specific distros so you can just find the packages and re "make". This will result in precisely one write per session with no session data remaining on the host system and a fault tolerant file system so you can recover your image when a NAND cell goes bad.

share|improve this answer

According to Testing Out Linux File-Systems On A USB Flash Drive, the performance of EXT4 is better than others.

share|improve this answer
    
Small warning: that article is 4 years old (Nov 2009) so things might have changed in the mean time –  Sander Steffann Oct 27 '13 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.