"Best" USB flash drive FILE SYSTEM

Hey

I realized (the hard way) that the pen-drive I just got was formatted in FAT32.

I was just gonna format it in exFAT, but then started wondering (yeah I know:man_facepalming:) and researching which file system would be “optimal” for it… and (obviously!) couldn’t get a definitive answer…

If we assume that it will only be used on Linux systems (so “universal” formats like exFAT wouldn’t be mandatory), is there a file system that really stands out (considering, perhaps in that order, reliability, speed, disk wear…)?

In the case of f.s. like ext4, what about permissions? Do they have to be managed every time a user/system changes?
F2FS is supposed to be specially tailored for flash drives, what about it?

If you have any experience to share it would be much appreciated! :slight_smile:

If I’m using a flash drive as storage, I always use ext4. Same for my external ssd. I’ve never had any issues.

3 Likes

I can only share my experience (I do not claim it is a good way).

If I expect the disk will be used to store data from both linux and windows then ntfs is a good choice - sacrificing the speed. Fat32 is not great since I had a few data corrutions with it.

If I take linux only then ext4 or newly brtfs (with redundant medatata). It just works.
The problem happens when I connect the disk to another computer which had different user UID and group GID. Then the data has read/write permission of another user and I have to use elevated priviles to access it. It can be “fixed” by adding read/write permission to everyone but that just feels wrong.

For reliability you will definitely want a filesystem with journaling. Journaling makes writes slightly slower (data write + journal write) but in my opinion that is a marginal tradeof to a possible data corruption. Besides an external drive will be bottlenecked by a USB speed.
I cannot say anthing about the disk wear since I never had a usb flash drive killed by that. Unless you keep the disk almost full all the time and do a lot of writes the risk is very small. And usualy it is not related to the filesystem but the disk firmware driver.

1 Like

Because of journaling, I guess you’d rather go with ntfs than exFAT no mater what? (as long as only windows and linux are involved)
No bad experience with ntfs under linux?

indeed…

Hello linuxislife

For a long time I used FAT32 for USB sticks so that I could also work on other systems such as Windows or MacOS.
However, one problem was always the file limit of a maximum of 4GB. You don’t have this with exFat. Unfortunately, I don’t think the performance of exFat is that good.

For my backups, which I only use on Linux, I use Ext4. I cannot confirm the disadvantage that it is a journaling file system and therefore the lifespan of the USB stick is shortened. The few days that it is more likely to break can be ignored. The performance of Ext4 is good.

If you only use Linux and Windows systems, I can recommend NTFS. It is also a journaling file system, but the same applies to Ext4. You don’t need to worry about rights management here and the performance is very good.

I haven’t tested F2FS myself yet. However, there are said to be a few problems with the fact that not every USB stick works with F2FS, and the USB stick should no longer be readable if the reading system has an older kernel than the creating system. But that is information that I cannot verify. Furthermore, there is only support for F2FS in Linux. In Windows or MacOS you need external tools to use it.
One disadvantage is that your USB stick under Ext4 is only mounted ReadOnly by the rights management and you have to adjust the rights. (Particularly critical with multiple computers)

Greatings Thomas

I agree ext4 is a good choice. If one wants a wider compatibility such as with Windows exFAT would be my choice otherwise i would leave it fat32. I would never use ntfs.

3 Likes

that’s exactly how this started :sweat_smile:

so you didn’t encounter any issue using it under linux?

That’s my understanding so far

or as @vlkon pointed

“fixed” by adding read/write permission to everyone but that just feels wrong

any particular reason? (I mean beside the obvious one: Micro$$oft…)

Because it sucks! :rofl:

2 Likes

I think you should keep in mind file permissions as well. Remember Fat/exfat/NTFS do not preserve Unix file attributes.

2 Likes

so you didn’t encounter any issue using it under linux?

Personally, I only had a problem with NTFS once: I accidentally deleted the trash folder, so the stick could no longer be mounted under Linux. I then repaired the stick under Windows (repair was not possible in Gparted because it was no longer recognized). Afterwards it was usable again under both systems.

1 Like

I have now used a USB stick with F2FS for several years. No problems yet, very good performance.

1 Like

I do love my ext4 still :wink:
it’s stable fast and is easy on file rescue actions.
I mean, I do not regularly need to share file with windows as of … nah, I do not use that thing.
But fat32 is still a useful file system in case you need to share files over USB sticks.
Getting bad in case you have files with over 4GB.

Exfat: The abbreviation Exfat stands for ‘Extended File Allocation Table’. The comparatively newer format was designed exclusively for flash memory such as USB sticks and SSD hard drives. The size of a file is not limited by Exfat, but it works most efficiently when it is used on rather smaller data storage.

Exfat seems to be the one made for that purpose?

4 Likes

Only advantage over fat32 is that you can corrupt files larger than 4GB.
It is also not guaranteed to work on some “consumer electronics” (without OS or just a barebone build) devices contrary to fat32.

On the other hand you can install ext drivers on windows so it can read ext4 (I never tried it but since WSL on windows exists it should be possible).

There is unfortunately not a perfect solution. Before an universal filesystem for USB storage was developed it become more common to use a cloud storage.

There is one thing that can help with EXT4 permission but it would require changes to udisks2 or some other utility that will mount the drive uder a specific user/group. I have done it a long time ago but it was too much hassle to set it up on every system. I just “sudo chown -R” now when I need it. I do not store system files on the external drive so in this case I do not care about the file ownership.
If the ownership has to be preserved I usualy create a tar archive before I put the files on an external drive.

1 Like

Since the use case is limited to usb devices with Linux, use a Linux filesystem, hence ext4. Anything Microsoft created should be tossed out with the bath water on reliability alone. As somone else mentioned, tar up the files before storing on a usb drive and you preserve the Linux permissions and ownership, so that’s not an issue when the files are retrieved on another system.

On another note, usb flash storage is inherently less reliable than external ssd’s and nvme’s, so the use of usb flash drives should only really be used for quick and temporary storage duties.

1 Like

I total agree with this. This is all I use usb flash drives for.

1 Like