You are not logged in.

#1 2010-03-02 22:43:47

timm
Member
From: Wisconsin
Registered: 2004-02-25
Posts: 417

Can't get drive to mount using autofs (long)

I am trying to autoload cartridges from my Dell RD1000 usb drive, but have not been successful.  autofs4 module is loaded in rc.conf, and autofs daemon is there as well. I can manually mount the drive using /dev/sdc1 or /dev/disk/by-uuid/etc (what I get from the blkid command).  However, if I plug in a drive it does not automount.  I'm sure I'm missing something here, but cannot figure out what that might be.

My /etc/auto.master file:

# /etc/autofs/auto.master
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(5).

#/media /etc/autofs/auto.media
# added next for RD1000 removable hard drive for backup

/mnt/rd1000   /etc/autofs/auto.rd1000 --timeout=15 --ghost

# eof

My /etc/auto.rd1000 file:

# /etc/auto.rd1000
*           -fstype=auto,rw,sync      :/dev/disk/by-uuid/&
# eof

The last portion of my /var/log/daemon.log after an /etc/rc.d/autofs restart:

Mar  2 16:27:05 viking automount[2224]: umounted indirect mount /mnt/rd1000
Mar  2 16:27:05 viking automount[2224]: shut down path /mnt/rd1000
Mar  2 16:27:05 viking automount[2224]: autofs stopped
Mar  2 16:27:06 viking automount[5374]: Starting automounter version 5.0.5, master map auto.master
Mar  2 16:27:06 viking automount[5374]: using kernel protocol version 5.01
Mar  2 16:27:06 viking automount[5374]: mounted indirect on /mnt/rd1000 with timeout 15, freq 4 seconds
Mar  2 16:27:06 viking automount[5374]: ghosting enabled

But there isn't acually any filesystem mounted.

And this is at the end of dmesg:

csi 4:0:0:0: Direct-Access     DELL     RD1000           2037 PQ: 0 ANSI: 3
sd 4:0:0:0: Attached scsi generic sg3 type 0
usb-storage: device scan complete
sd 4:0:0:0: [sdc] 312573616 512-byte logical blocks: (160 GB/149 GiB)
sd 4:0:0:0: [sdc] Write Protect is off
sd 4:0:0:0: [sdc] Mode Sense: 1f 00 00 08
sd 4:0:0:0: [sdc] Assuming drive cache: write through
sd 4:0:0:0: [sdc] Assuming drive cache: write through
sdc: sdc1
sd 4:0:0:0: [sdc] Assuming drive cache: write through
sd 4:0:0:0: [sdc] Attached SCSI removable disk
sd 4:0:0:0: [sdc] Assuming drive cache: write through
sd 4:0:0:0: [sdc] Assuming drive cache: write through
sdc: sdc1

The explanation in the howto that I'm following is:(they use vchanger, I use rd1000, mine is a 15sec timeout)

After restarting the autofs daemon, whenever a file or directory with a full path beginning with '/mnt/vchanger' is accessed, the autofs filesystem will search the map defined in the /etc/auto.vchanger file for a key matching the path being accessed. In this case, the only key in /etc/auto.vchanger is the wildcard '*', meaning any path name beginning with '/mnt/vchanger' will match. Autofs then automatically mounts the device mapped to the wildcard key at the path being accessed. The /etc/auto.vchanger map file specifies the device to be mounted as /dev/disk/by-uuid/&. The '&' is substituted for the key value. For example, when a program attempts to access /mnt/vchanger/9667f83c-6150-44c7-b0d4-57564f174b35 (or any files or directories below it) the autofs daemon will look at the auto.vchanger map for the key 9667f83c-6150-44c7-b0d4-57564f174b35 and discover that it should mount /dev/disk/by-uuid/9667f83c-6150-44c7-b0d4-57564f174b35 at /mnt/vchanger/9667f83c-6150-44c7-b0d4-57564f174b35 with mount options '-fstype=auto,rw,sync'. After a period of 30 seconds of no activity, autofs will automatically unmount the device.

Always make sure autofs is working properly before continuing with setting up vchanger. If using the above autofs config files, when you plug in a USB drive with filesystem UUID of, say, 9667f83c-6150-44c7-b0d4-57564f174b35, you should be able to list its contents with the command

# ls /mnt/vchanger/9667f83c-6150-44c7-b0d4-57564f174b35

The ls command should trigger an automatic mount of the partition. Then after waiting for the timeout period, the drive should automatically be unmounted.

Offline

Board footer

Powered by FluxBB