1

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?

3

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.

1
  • 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.
    – LawrenceC
    Feb 26 '11 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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