Fedora 11 - Mount options for vfat and other volumes for automount.

2010-03-11 315 words 2 mins read

I have been searching to look for how to change the default umask and dmask for the auto-mounted directories. I searched all the google and bing pages that I could, but to no avail. But I found some interesting info though.

Fedora now uses DeviceKit for managing the disks and Devicekit calls udev for actually mounting and unmounting the disks. The operation is controlled by policykit to determine who can do what?

So, with this information, I was pretty sure that I should resort to fstab to mount my disks. But remember another change Fedora made some time back. UUID are preferred way to mount the disk in the fstab. So I thought why not do it this way, so here’s what I did (might save you with some time)

lshal|grep uuid

This will give you output like the below:

udi = ’/org/freedesktop/Hal/devices/volume_uuid_4852_A67D’
info.udi = ’/org/freedesktop/Hal/devices/volume_uuid_4852_A67D’  (string)
volume.uuid = ’4852-A67D’  (string)
volume.uuid = ’’  (string)

This will give you the UUID.  and then you can map the devices with the UUID from the current mount locations.

But if you like to do things the easire way then just run the following:

blkid

The output will be similar to below:

/dev/sda5: LABEL=”” UUID=”XXXX-XXXX” TYPE=”vfat”

Now login as root and add the following to the fstab file in /etc.

If you want to do it with a bash one liner, then you can try this: (Be careful to take a  backup of fstab, as I have not tried this)

IFS=’

’;mount_opts=”rw,uid=500”; for i in $(blkid|grep ”vfat”); do  temp=$(echo $i|awk '{print $3}’);echo ”$temp $mount_opts 0 0”; done

Please note that this will not specify the mount point and thus mount will fail, if you directly use the output in the fstab file. You can insert the mount point in the output as second field.

Also, change the mount_opts value in the above to whatever mount options you want.


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it