Ubuntu 10.10 Maverick - VFAT usb drives mount with root access only

Asked by Tong Sun

Hi,

Exactly as what happens in Ubuntu 10.04, VFAT usb drives mount with root access only,
https://bugs.launchpad.net/ubuntu/+bug/573981

same thing happens to Ubuntu 10.10 Maverick now.

The workaround in above bug report doesn't apply to me -- I don't have usbmount installed.

Tech details is the same as
https://bugs.launchpad.net/ubuntu/+bug/573981/comments/13

when I mount the vfat manually with very specific read and write permissions for my user id of 1000 and have 777 permissions to the whole mount point, everything are still mounted as root:root

# chmod -R 777 /media/usb1
# ls -l /media | grep usb1
drwxrwxrwx 32 myuser myuser 16384 2010-09-23 23:08 usb1

and the mount

/dev/sdb3 on /media/usb1 type vfat (rw,noexec,nosuid,nodev,umask=0000,uid=1000,gid=1000)

# ls -l /media | grep usb1
drwx------ 4 root root 4096 1969-12-31 19:00 usb1

# ls -l /media/usb1
-rw-r--r-- 1 root root 22 2010-09-12 00:15 file1.txt
. . .

The same mount command have always been working fine under Debian.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Tong Sun (suntong001) said :
#1

Forgot to mention, this is a brand new Ubuntu 10.10 Maverick installation, not upgraded.

Revision history for this message
Sam_ (and-sam) said :
#2

It should be mounted static?
Try this.
Generate the UUID
sudo blkid

Entry in fstab e.g.
UUID=<UUID> /media/<Name> vfat utf8,umask=007,gid=46 0 2

After editing fstab:
sudo mount -a
or
reboot.

https://help.ubuntu.com/community/Fstab

User groups is ok?
e.g.
adm
dialout
cdrom
floppy
audio
dip
video
plugdev
fuse
lpadmin
scanner
sambashare
admin

Revision history for this message
Sam_ (and-sam) said :
#3
Revision history for this message
Tong Sun (suntong001) said :
#4

> It should be mounted static?

Shouldn't be matter.

> User groups is ok?

Doesn't matter, I'm using sudo.

> Examples (with gid=100 instead 46)
> https://help.ubuntu.com/community/MountingWindowsPartitions

Still the same:

$ ls -ld /mnt/usbpen
drwxr-xr-x 2 tong tong 4096 2010-08-06 18:36 /mnt/usbpen

$ sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 /dev/sdc1 /mnt/usbpen

$ ls -ld /mnt/usbpen
drwx------ 5 root root 4096 1969-12-31 19:00 /mnt/usbpen

$ sudo ls -l /mnt/usbpen
-rw-r--r-- 1 root root 22 2010-09-12 00:15 file1.txt
. . .

Revision history for this message
Sam_ (and-sam) said :
#5

Weird, usually external media mounts without complicated config for current logged in user.
Ok, lets say user:group is owner of mountpoint.
May not sound logical, but after you mounted it with sudo, unmount:
sudo umount /path_of/mountpoint
Then try access as user, via Nautilus or Places.

Revision history for this message
Tong Sun (suntong001) said :
#6

> usually external media mounts without complicated config for current logged in user.

oh, yeah, noticed that as well after my last post, the external usb has already been auto-mounted as /media/KINGSTON. but ...

> mounted it with sudo, . . . Then try access as user, via Nautilus or Places.

Doesn't work:

$ ls -ld /media/KINGSTON
drwx------ 5 root root 4096 1969-12-31 19:00 /media/KINGSTON/

See, the auto-mounted mount point is still owned by root:root, and nobody else than root can access it.

Revision history for this message
Tong Sun (suntong001) said :
#7

> the auto-mounted mount point is still owned by root:root, and nobody else than root can access it.

Ok, put it this way,

which package control the auto mounting under Ubuntu?
how can I configure it to allow user:group access?

Thanks

Revision history for this message
Sam_ (and-sam) said :
#8
Revision history for this message
Tong Sun (suntong001) said :
#9

Thanks a lot for taking time to find answers for me.

> Mount parameter 'defaults' incl. 'auto', in this case user gets no access.

Ok, without 'defaults', tried but still NOK:

$ ls -ld /mnt/usbpen
drwxr-xr-x 2 tong tong 4096 2010-08-06 18:36 /mnt/usbpen

sudo mount -t vfat -o user,exec,uid=1000,gid=100,umask=000 /dev/sdc1 /mnt/usbpen

$ mount | grep sdc
/dev/sdc2 on /media/SD-Live type ext2 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdc1 on /media/SSD type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
/dev/sdc1 on /mnt/usbpen type vfat (rw,nosuid,nodev,uid=1000,gid=100,umask=000)

ls -ld /mnt/usbpen /media/SSD
drwx------ 3 root root 16384 1969-12-31 19:00 /media/SSD
drwx------ 3 root root 16384 1969-12-31 19:00 /mnt/usbpen/

> Maybe also test section 'Mount the Drive'.

Same thing.

> Assume the package is mountall.

Ok, took a look, but found it's for mounting filesystems *during boot*, not after it.

> http://packages.ubuntu.com/maverick/gnome-disk-utility

Ok, took a look, but wasn't able to find any document how to configure it, including
under,
/usr/share/doc/gnome-disk-utility

> https://wiki.ubuntu.com/DebuggingRemovableDevices

Isn't that for HAL?

Anyway, here are the required outputs (the rests are irrelevant, IMO):

$ id haldaemon
id: haldaemon: No such user

$ uname -a
Linux coral 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64 GNU/Linux

> https://wiki.ubuntu.com/DebuggingUdev

I believe that the mounting issue has nothing to do with udev at all.

thanks all the same.

Revision history for this message
Tong Sun (suntong001) said :
#10

BTW,

I don't have any usb entries in /etc/fstab:

$ grep sdc /etc/fstab || echo no
no

Revision history for this message
Sam_ (and-sam) said :
#11

When usb is mounted, after unmounting, what happens after:
sudo mount -a
or
mount -a

I'd try: unmount, unplug the stick, wait a little, plug-in and mount -a
Even when you mount as root, when user should get access it must be in plugdev group.

When I switch on external hd and run top there is:
1194 root 20 0 24436 1304 1088 S 0.3 0.1 0:04.25 hald-addon-storage
1395 root 20 0 46696 928 568 S 0.3 0.1 0:02.43 udisks-daemon

Also in sys admin -> system monitor are lots of processes monitoring volumes.

drwx------ 4 user user 4096 1970-01-01 01:00 hd_external
drwx------ 8 user user 16384 1970-01-01 01:00 hd_external

> Isn't that for HAL?

Yep, I know it's about to be deprecated, and supposed to be replaced by udev since Lucid, but it's still there.
http://packages.ubuntu.com/maverick/hal
On Lucid:
http://paste.ubuntu.com/522176/

I guess, somehow HAL, udisks, policykit work together.
http://packages.ubuntu.com/maverick/udisks

> I don't have any usb entries in /etc/fstab

Me too. But in contrary to your experience I switch external hd on or plugin usb-stick and can r-w or whatever. Just wondering and curious.

The gnome-disk-utility is in sys-admin menu.
http://library.gnome.org/devel/gnome-disk-utility/stable/
http://library.gnome.org/devel/gnome-disk-utility/stable/GduPool.html
# Former palimpsest
http://library.gnome.org/users/palimpsest/2.32/palimpsest.html

Process: /usr/lib/gnome-disk-utility/gdu-notification-daemon

Last, what if you mount it, then open Nautilus as root and change owner to user via GUI?

Revision history for this message
Sam_ (and-sam) said :
#12
Revision history for this message
Sam_ (and-sam) said :
#13

And debug page of udev says:
udev does not mount your disks, HAL, gnome-volume-manager and pmount do that.

So taking the excludes, package responsible should be udisks.

Revision history for this message
Tong Sun (suntong001) said :
#14

> According to this HAL is gone.
> https://wiki.ubuntu.com/X/Config/. . .

Yes,

> udev does not mount your disks, HAL, gnome-volume-manager and pmount do that.

True, I don't have either HAL, gnome-volume-manager or pmount installed.

$ dpkg -l | grep -E 'hal|gnome-volume|pmount'
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend

I looked at udisks, but found it is not responsible for mount usb disks either.

> When I switch on external hd and run top there is:
> 1194 root 20 0 24436 1304 1088 S 0.3 0.1 0:04.25 hald-addon-storage

You are using HAL. That's a different story. Can you test with a fresh Ubuntu 10.10 Maverick HD installation please?

Please note that I'm not the only one having this problem, apart from the bug report in 10.04, here are more:

"Tried everything known to me after googling: made myself member of plugdev
groop, run chmode trying to change permission on drive, tried to change the
mount point to my home directory, etc. Nothing works. Googling further did
not give any results. I've not found any reasonable HOW TO but some weired
workarounds that worked for the authors only (according with response on
these posts and my tests)."
-- http://fixunix.com/ubuntu/126884-usb-hard-drive-mount-root-permission-only.html

"This makes me crazy! Maybe someone can fill me in. . . the ownership of the file is automatically changed to root. The "group is also changed to root. I want to change this file's ownership so I can use it as a regular user. So as root I go:
Code:
 chown -R dapperdan:users file_in_question
But I'm not allowed to change this file's ownership even though I'm root!"
-- http://www.linuxforums.org/forum/miscellaneous/49305-i-am-su-root-i-cannot-change-ownership.html

"Group Ownership Problems With Files On External Disk
I'll throw this problem out there, in the hope that somebody can suggest what's going wrong here. . . "
-- http://blogs.sun.com/richb/entry/group_ownership_problems_with_files

"VFAT usb storage device gets mounted with root:root user:group
i'm banging my head for number of days around this problem. . . . mounts external USB storage devices as root. So, as user i cannot write to files on them. . . This is Ubuntu Lucid"
-- http://superuser.com/questions/155727/halevt-troubleshooting-vfat-usb-storage-device-gets-mounted-with-rootroot-user

Revision history for this message
Sam_ (and-sam) said :
#15

Added my output of 10.04 because of the topic:
<Exactly as what happens in Ubuntu 10.04>

I just have one productive workstation at the moment, so I'm not sure if reproducing on 10.10 LiveCD would help you?

Found some background which point to udev, Nautilus and gvfs-gdu-volume-monitor (which is a process running in sys monitor on Lucid).
https://answers.launchpad.net/ubuntu/+source/nautilus/+question/64803
https://bugs.launchpad.net/ubuntu/karmic/+source/gvfs/+bug/396448/comments/4
http://ubuntuforums.org/showpost.php?s=ce8079de3ea42975c24f07058b7c4fb6&p=1537617&postcount=6

Can you help with this problem?

Provide an answer of your own, or ask Tong Sun for more information if necessary.

To post a message you must log in.