Interesting exFat behavior

Forum: LinuxTotal Replies: 16
Author Content
Bob_Robertson

Aug 16, 2013
10:09 AM EDT
So I'm giving exFat a try, so I can make a backup drive that can be read on both Linux and Windows.

That is, with DVD.ISO images, which means Fat32 is out because the files are too big.

Sure, seems like a good idea.

What's interesting is the permissions.

When an SD card, or other Fat device gets auto-mounted, the files show up as the user's user/group. Then, someone else auto-mounting gets their own user/group and everyone has equality of access to the files.

I understand this because Fat has no permissions, or owner/group, being an extremely minimalist file system. I consider this a Useful Thing for such devices.

When copied to exFat, the files are showing up as root/root. This is interesting, because the exFat driver supposedly lives in "fuser" land, and the user "bob" is not having any problems writing to the device which is the usual effect when things are accidentally mounted by root rather than a user.

Anyway, another interesting attribute is that while the file names are stored in mixed case characters, the file system itself is "case insensitive". Fascinating, maybe it's just been so long since I used a Fat file system on a regular basis, this just seems strange to me.

I'm right on the edge of copying everything off the disk, reformatting Ext4, and saying "screw it", but then I remember that I really like being able to mount the disk on anyone's machine, and not having to worry about logging in as "bob" first.
vagabondo

Aug 16, 2013
10:55 AM EDT
You have not explained exactly what you have done, or what hardware or OS you are using.

Effective permissions are a combination of file system and mounting method. Is this a hard drive partition? How was the FS created? How is it mounted?

Why did you not use NTFS-3G ?

Bob_Robertson

Aug 16, 2013
11:31 AM EDT
External USB drive. exFat-fuse and exFat-utils packages installed in Debian Wheezy.

File system created by mkfs -t exfat /dev/sdf1

Mounting is being done automatically by the exfat-fuse installed utilities

Why not NTFS? Maybe I will, maybe I should have. This was an experiment.
JaseP

Aug 16, 2013
3:25 PM EDT
Just go with EXT3 or EXT4 and Samba,... Problem solved... The underlying file system is meanlingless to the Samba server... Instead of manually connecting, you just attach everyone through the network... If you have to make the drive available off site,... you connect the drive to a laptop that is configured to share the drive and then log into their network...

ExFAT is proprietary (under a BS MS patent),... So you're always going to have problems with it.
Bob_Robertson

Aug 16, 2013
3:56 PM EDT
Samba isn't going to help when I plug the USB drive into laptop running Windows. :^)

But again, Ext4 keeps user information, which interferes with plugging the drive into different machines with different users. The simplicity of FAT solves a great many issues.

Indeed it is encumbered with patent cr@p. The drive came configured for NTFS, which I can make work on Linux, or I could format it with Ext and lose transparency for anyone on Windows as well as making different users on different Linux systems have trouble with it.

I chose the least inconvenient path.
JaseP

Aug 16, 2013
4:10 PM EDT
Bob,... You don't connect the drive locally,... you connect it through your laptop running Linux,... And thereby have your transparency... It means you have to have a minimum of two computers and a router working (or one machine running AS a router with a DHCP server, and a client PC),... My multimedia network at my Apt. consists of a MythTV box that also runs a Samba server. Everyone on the network has read/write access to one public directory and read access to the multimedia content. The HTPC clients, or any PC connected to the network, can access the movies, or can backup information to the Public directory... It's much more convenient than lugging a USB drive around (the shared drive is a USB drive formatted to EXT3).
JaseP

Aug 16, 2013
4:24 PM EDT
Oh,... By the way,... Even a small machine,... like a Raspberry PI can act as a Samba server...
Bob_Robertson

Aug 16, 2013
5:04 PM EDT
> You don't connect the drive locally

Yes, I do. :^)

I appreciate your advice, but it doesn't apply to the purpose of the drive.
JaseP

Aug 16, 2013
5:31 PM EDT
Well,... The question has been posed many times before... Here's a link of some different approaches (including mine of having NAS)... http://superuser.com/questions/100629/whats-the-best-way-to-...
Bob_Robertson

Aug 19, 2013
8:45 AM EDT
Ok, I see the miscommunication.

I'm not trying to share files. I'm making a backup that can be read, at need, by Windows.
CFWhitman

Aug 19, 2013
9:06 AM EDT
ExFAT is new enough so that I'm not really familiar with the issues of using it. I did buy a 64GB SD card that came preformatted as ExFAT, but I reformatted it to FAT32, since it was for my OpenPandora, and it would be a pain to try to use ExFAT on that (assuming it's possible at all at this point).

Your choices are:

1. Keep going with what you've got. You will probably find a reasonable way to deal with all the quirks as time goes by (though perhaps not).

2. Switch to NTFS. Permission issues can be problematic when switching between different users. It does work pretty well on Linux at this point.

3. Use Ext2. There is a solid driver for Ext2 for Windows. Of course, permissions can be an issue just like with NTFS. Another problem is that Windows machines will not have the driver built in. One possible solution for that if you are going to use the drive on various Windows machines is to put the driver on a small FAT partition on the device so that you can install it before you access the rest of the drive.

I've left out the possibilities of using FAT32 or any kind of solution involving using another computer, virtual machine, network mount, or some combination of those things because they don't fit in with what you want to do. If there is another file system that would be a reasonable alternative, I'm not aware of it.
Bob_Robertson

Aug 19, 2013
9:31 AM EDT
What struck me was the difference in permissions, user/group, etc., from FATxx as per how things work with other FAT devices, like SD cards and thumb drives, etc., when automagically mounted.

I expect that, as the exFat automounter evolves, the automounter will have whatever magic wand waved that needs to be waved so that it has the same kind of user/group action that the other FAT mounters do. Specifically, that it takes on the attributes of the user logged in since there are no user/group permissions built into the file system itself.
JaseP

Aug 19, 2013
6:45 PM EDT
ExFAT support is reverse engineered, except for those parties that want to pay MS a royalty fee for using it... The danger of using ExFAT is the same as using FAT32, insofar as MS can attempt to shut down any use of the file format due to patents (whether truly valid or not).

Are you trying to make a backup *.iso of your entire partition???
BernardSwiss

Aug 19, 2013
7:40 PM EDT
Is anyone up to date on how the invalidation of MS FAT32 patents effects patent concerns over ExFAT?
Bob_Robertson

Aug 20, 2013
9:22 AM EDT
> Are you trying to make a backup *.iso of your entire partition???

No, just lots of files.
vagabondo

Aug 22, 2013
4:52 AM EDT
Caveat: I am not familiar with Debian

> How is it mounted? You will discover this with a command something like:

mount |grep exfat

> External USB drive

Exfat is intended for removable flash memory devices. It is not well suited for a spinning hard drive.. For backup a stable journaling fs is preferable; in this instance ntfs, or perhaps reiserfs.

> I expect that, as the exFat automounter evolves ...

Automounting is via the automount daemon and controlled by autofs. The primary config file is /etc/auto.master

A removable device should be mounted to a tmpfs with a symlink to the current users home directory. Sometimes removable devices are mounted in /media (which is best for removable media in fixed devices, e.g. floppies and tapes). In the latter case mount directories (and their permissions) can be retained and cause problems on re-use.

If the drive will be regularly connected to the system, it is probably better to treat it as (semi)permanent. Create a suitable mount point/directory (e.g. /home/backup) and a fstab entry (preferably mounting by UUID or Label to avoid problems with other removable devices). That way you get to choose the mount permissions.

burdicda

Feb 22, 2016
10:31 PM EDT
Hey this looks like a good place to share some freaky issues experienced with exfat format under Debian Jessie .... So some friends bought me a photography course with iso files that where very large like 6gig and bang run face first into limits with fat. I go out and purchase 2 small usb drives shirtpocket size but 1TB, and also a 3TB Book style. I format all three in Exfat...my debian has all the exfat support installed and working...I even format the drives with a brand new Windows laptop not from linux. Then when I am copying the large files the two smaller drives behave just fine...but the big one is doing some crazy stuff like dumping everything in root directory or completely wiping everything in root directory out and replacing with just the files I told it to copy to a subdir. I got so fed up I reformatted the big one 3T Book style to ntfs and all is working now....It just seems based on my experiences...that exfat is not ready for primetime in all circumstances on all sized drives.

You cannot post until you login.