How to mount vfat drive on Linux with ownership other than root?
Posted
by
Norman Ramsey
on Server Fault
See other posts from Server Fault
or by Norman Ramsey
Published on 2011-09-14T03:21:07Z
Indexed on
2012/11/24
5:08 UTC
Read the original article
Hit count: 495
I'm running into trouble mounting an iPod on a newly upgraded Debian Squeeze. I suspect either a protocol has changed or I've tickled a bug, which I don't know where to report.
I'm trying to mount the iPod so that I have permission to read and write it. But my efforts come to nothing:
$ sudo mount -v -t vfat -o uid=32074,gid=6202 /dev/sde2 /mnt
/dev/sde2 on /mnt type vfat (rw,uid=32074,gid=6202)
$ ls -l /mnt
total 80
drwxr-xr-x 2 root root 16384 Jan 1 2000 Calendars
drwxr-xr-x 2 root root 16384 Jan 1 2000 Contacts
drwxr-xr-x 2 root root 16384 Jan 1 2000 Notes
drwxr-xr-x 3 root root 16384 Jun 23 2007 Photos
drwxr-xr-x 6 root root 16384 Jun 19 2007 iPod_Control
$ sudo umount /mnt
$ sudo mount -v -t vfat -o uid=nr,gid=nr /dev/sde2 /mnt
/dev/sde2 on /mnt type vfat (rw,uid=32074,gid=6202)
$ ls -l /mnt
total 80
drwxr-xr-x 2 root root 16384 Jan 1 2000 Calendars
drwxr-xr-x 2 root root 16384 Jan 1 2000 Contacts
drwxr-xr-x 2 root root 16384 Jan 1 2000 Notes
drwxr-xr-x 3 root root 16384 Jun 23 2007 Photos
drwxr-xr-x 6 root root 16384 Jun 19 2007 iPod_Control
As you see, I've tried both symbolic and numberic IDs, but the files persist in being owned by root (and only writable by root).
The IDs are really mine; I've had the UID since 1993.
$ id
uid=32074(nr) gid=6202(nr) groups=6202(nr),0(root),2(bin),4(adm),...
I've put an strace at http://pastebin.com/Xue2u9FZ, and the mount(2) call looks good:
mount("/dev/sde2", "/mnt", "vfat", MS_MGC_VAL, "uid=32074,gid=6202") = 0
Finally, here's my kernel version from uname -a
:
Linux homedog 2.6.32-5-686 #1 SMP Mon Jun 13 04:13:06 UTC 2011 i686 GNU/Linux
Does anyone know if
- I should be doing something different, or
- If there is a workaround, or
- If this is a bug, where it should be reported?
© Server Fault or respective owner