I have a 1TB Western Digital Elements USB drive connected to a sheeva plug with Debian installed. I use autofs for auto mounting USB drives. Here are the options I currently use.

usb1 -fstype=auto,umask=000,user,rw,async :/dev/sda1

The drive spins down every now and then and when that happens, the mount point /mnt/usb1 seems like it disappears. Running dir /mnt displays nothing when the drive spin down; however the drive can still be accessed by dir /mnt/usb1.

Is there a way to setup autofs so that usb1 can always be visible and still allow the drive to spin down?


There's a little trick I use for this type of situation, symbolic links. You probably don't want to put the symbolic links directly in /mnt as some programs scan that folder and will cause the drive to spin up. Try this layout:

/mnt/disks_auto/   # Mount AutoFS here
/mnt/disks/usb1 -> ../disks_auto/usb1

The file usb1 in the disks folder is a relative symbolic link pointing to the usb1 folder (which may or may not appear at any one time. If you have multiple devices automounting with AutoFS, you may want an additional level there as some program that calls stat() on all files inside /mnt/disks will cause them all to mount.

/mnt/disks_auto/   # Mount AutoFS here
/mnt/disks/usb1/disk -> ../../disk_auto/usb1
/mnt/disks/usb2/disk -> ../../disk_auto/usb2
/mnt/disks/usb3/disk -> ../../disk_auto/usb3

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.