What kind of FileSystem do you recommend for USB Flash Drive?
This is a problem I'm having when using Ubuntu: I have two computers that have Ubuntu installed on them (comp1 and comp2). I create a document with Ubuntu on comp1 and then copy the file onto a FAT formatted USB flash drive. Via the flash drive I paste the document onto comp2. The problem is that the file-permissions are never preserved during the transfer. I'm assuming because the FAT is not supporting the permissions.
Is there a solution to this? Should I continue to use FAT file system for USB flash drives (because FAT is best for flash drives) and just live with this permissions issue? Or is it recommended to reformat my flash drive with a more "Ubuntu Friendly" file system that will preserve the permissions?
ext4 is a journalling filesystem which means that if the device is unplugged prematurely it stands more of a chance of recovering the damaged filesystem. The journal part of the write contains information about what is about to be done and it gets cleared after the operation is completed. If it is found that there is an uncompleted journal on a device when it is mounted, the filesystem can be reverted to it's previous state thereby preserving its integrity.
While there is some extra overhead in terms of space involved in having a journalling filesystem on a USB stick, it's actually a good choice for most things.
Obviously, if you need a device that can also plug into any computer at any time then FAT would be the way to go. If you want a device that needs to be plugged into one Windows computer only occasionally, then it's possible to install ext2 device drivers in Windows that will allow it to read any and all ext(x) drives. Of course, since Windows doesn't know about Linux permissions and ownership these will not be handled as well.
You can try formatting your drive as UDF(Universal Disk Format). It is the format for use on CD's and DVD's. Most modern OSes will be able to read and write to it.
Right now, looking at my data on UDF formatted drive, Linux file permissions seem to be preserved. So far, it's worked for me.
Another good thing about UDF formatted drive is that it can store a single large file of up to 16 Exabyte(correct me if I'm wrong.), whereas Fat32 can only store a file of size 4GB or less and MAX partition size for FAT32 is only 2TB.
It works good on Win7 and 8. For older Windows OSes like XP and 2000, you can read from the drive but you have to install some sort of driver to write to it.
For Mac, OS X 10.5 and above has full compatibility. Here's a full compatibility chart. UDF Compatibility Chart
On Ubuntu, follow these steps to format a drive as UDF.
sudo apt-get update
sudo apt-get install udftools
Okay, now you want to delete the current partitions in the target drive. You can either use a GUI tool like Disk Utility, or do the following.
sudo blkid
Find your drive in the output. (they look something like /dev/sdb or /dev/sdc) Now do the following, but replace the 'x' in /dev/sdx to point to the drive that you want to clear its partition. Do this for both lines of code.
sudo dd if=/dev/zero of=/dev/sdx bs=1M count=1
sudo mkudffs -b 512 --media-type=hd --utf8 --lvid=DriveLabel --vid=DriveLabel --fsid=DriveLabel /dev/sdx
You could alter where it says 'DriveLabel' to your liking.
That should be it.
Actually, I do this slightly differently, but decided that this method was easier to follow. I referenced this method from this site.
I hope this helps someone out there.