Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an external USB drive which my system recognizes as /dev/sdb1. I want to have it automounted with 755 permissions on boot and shared over the network with samba. I created the mount point /mnt/mybook for it, and I've mounted it manually with no problems. If I do mount /dev/sdb1 /mnt/mybook, it mounts correctly and I can access the contents.

I figured this would be simple enough, so I read up on fstab and came up with the following line for it:

UUID=C252-9CA3 /mnt/mybook vfat defaults,mode=755 0 0

I got the UUID from blkid.

When I reboot, the drive is not automounted, much less with the 755 permissions I want. How can I make it so the drive gets correctly automounted with the desired permissions?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You could try an alternate approach, which is to recognize your device at the udev level and use /dev/mybook-partition in /etc/fstab. Put something like the following in /etc/udev/rules.d/dwilliams.rules:

KERNEL=="sd*", PROGRAM=="/sbin/blkid %N", RESULT=="C252-9CA3", SYMLINK+="mybook-partition"

The section on Auto mounting USB devices in the Arch wiki for udev might help you further.

share|improve this answer
    
This is better since you might possibly boot the system without the drive attached and if I remember correctly you get dumped in to single-user mode. –  ultrasawblade Feb 26 '11 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.