4

I've "solved" the following problem, but not in a desirable way.

First, mounting exFAT file systems in Linux was truly as simple as this site says.

The catch is, "as long as you are root."

A user would like to plug in his exFAT file system anytime, but attempting to do so results in:

mount.exfat /dev/sdc1 /media/exfat-device
ERROR: failed to open `/dev/sdc1'

This works as root, but I was able to solve this so that a user can mount it by adding the following line to fstab:

/dev/sdc1 /media/exfat-device exfat-fuse defaults 0 0

However, this is not desirable because it hardcodes sdc1 which assumes (incorrectly) that everything detected as sdc1 will always be exFAT. As an example I connected another non-exFAT drive which gives me no problems, and it's identified as sdc. Then I connect my exFAT device, which becomes sdd, making the fstab addition worthless.

What do I need to do, without giving the user any sudo privileges or elevated access whatsoever, so that any user can connect an exFAT device to that particular machine and read/write to it?

5
  • 1
    Which distro are you using? I haven't used exFAT yet, but shouldn't most distros just automount any devices that are plugged in if they understand the filesystem? Jan 29, 2014 at 15:41
  • Apologies, I should have mentioned that. This is RHEL6, which doesn't have exFAT support out of the box. The link in my message details how to add it (which works great, but only as root). Jan 29, 2014 at 15:43
  • Hm, I guess that the automounter probably doesn't know about exFAT then and therefore won't automatically mount exFAT devices. Maybe there's some kind of udev rule that one could add to fix that? I'm afraid I don't know how automounters work, so I can't be of more help. Jan 29, 2014 at 15:55
  • code.google.com/p/exfat/wiki/HOWTO says that you need util-linux(-ng) >= 2.18. Maybe the installed version on RHEL6 is too old? Jan 29, 2014 at 15:58
  • Nice find. Indeed, RHEL6 supports up to 2.17 :/ So close! Jan 29, 2014 at 16:12

2 Answers 2

4

Most distributions have a command called by blkid. blkid will give you a unique identifier for each drive attached to you linux box. Fstab can uses this identifier, replace the /dev/sdc1 with UUID=XXXXXXXXXXXXX. This means that regardless of the user-space designation (e.g. sdc1 scb2 et cetera) your OS will mount it correctly.

1
  • I tried it for exfat HDD but with no output!!
    – alsadk
    Dec 18, 2018 at 18:01
1

Another option is to give the drive a label and put that into /etc/fstab

e.g.

exfatlabel /dev/sdc1 EXTERNAL

nano /etc/fstab

LABEL=EXTERNAL   /mnt/external    exfat-fuse *options*   0 0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .