You are not logged in.

#1 2007-12-24 03:56:50

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Mount vfat partition and own it

I have an external USB drive with multiple partitions, one of which is VFAT. The partitions are mounted automatically when I plug it in to /media/disk-*. Before plugging the drive in, I ensured that those folders exist and are owned by my user prior to mounting.

drwxr-xr-x  2 b-con users 4096 2007-12-23 19:35 disk-1
drwxr-xr-x  2 b-con users 4096 2007-12-23 19:35 disk-2

If I then just plug the external drive in, the partitions will be mounted automatically and I have write access to the VFAT partition. However, if I mount the VFAT partition manually, the folder gets re-owned by root and I can only write to the disk as root.

How do I manually mount a VFAT partition such that it isn't owned by root, *without* rebooting? What is it that udev (I assume udev is doing the auto-mounting(?)) is doing that I need to?

Last edited by B-Con (2007-12-24 03:57:27)

Offline

#2 2007-12-24 05:06:44

bknitram
Member
From: South Carolina
Registered: 2007-06-25
Posts: 12

Re: Mount vfat partition and own it

Unless you specifically told udev to automount, it wont do it. I would assume that hal and dbus are doing automounting.

As for not getting reowned by root, try passing the -o user options to mount. The users group should own it. AFAIK.

Offline

#3 2007-12-24 07:09:13

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: Mount vfat partition and own it

I tried -o users, the mount point still got owned by root and I can't write to it unless I escalate to root.

Offline

#4 2007-12-24 12:40:35

Jack B
Member
Registered: 2006-06-27
Posts: 107
Website

Re: Mount vfat partition and own it

I haven't done this in a while, so I could be wrong, but I think pmount is the program you are looking for. It's a package in extra.
HTH
Jack

Offline

#5 2007-12-24 17:09:45

ProzacR
Member
Registered: 2007-04-29
Posts: 272

Re: Mount vfat partition and own it

In:
/etc/fstab

/dev/sda3 /mnt/sda3 vfat users,uid=1000,gid=100 0 0

Use your own uid and gid

Offline

#6 2007-12-24 17:36:33

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: Mount vfat partition and own it

@B-Con

Like you I like to mount my USB external drive, so this is what I have done. And it works:

# USB ports (front)
/dev/sdc1 /mnt/usbhd vfat  rw,user,noauto       0       0

Notice that I use noauto to avoid auto mounting the USB and also user so it mounts owned by me with rw (read/write) permissions.

Note: /dev/sdc1 is how my system recognizes my USB, to find out how your's reads it just issue "dmesg" at a console after you plug in the USB and you will get the info.

Hope this helps.

Last edited by ralvez (2007-12-24 17:37:18)

Offline

#7 2007-12-25 08:13:53

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: Mount vfat partition and own it

Ah, right... I can edit /etc/fstab and then mount the system and it will be mounted with the fstab entry, no rebooting necessary. smile

Bleh, I wasn't thinking clearly tonight. I didn't want to have to edit /etc/fstab so I was trying to pass the options via -o to mount. So I was issuing commands like:

sudo mount /dev/sdb8 /media/disk-1 -o rw,user

which would mount it, but own it by root. That confused me for a while, until I woke up and realized that the user doing the mounting *was* root, given that I was using sudo and all... tongue

Thanks guys.

Offline

Board footer

Powered by FluxBB