Skip to contentSkip to conversation

Problem mounting USB external drive

DISCUSSION Andrew Robinson 2 participants 3 messages May 3, 2004

lore
Share & tools
lore
#0 lore raw

I've got an external drive in a USB 2.0 enclosure that I would like to have mounted when I plug it in. I'm running Fedora Core 1. I have created an entry in /etc/updfstab.conf that successfully adds an entry to the /etc/fstab and creates a mount point in /mnt. I can then mount the drive from the CLI. Poking around the Fedora mailing list, the answer to automated mounting seemed to lie in the /etc/hotplug/usb/usb-storage script. I created the script and verified that it was executed. However, updfstab does not seem to get run until after usb-storage is completed. Hence, no automatic mount.

My question is this. What is the correct way within the hotplug framework to get a hot-plugged drive to mount automatically?

If this is the wrong forum to ask this question, I apologize. Could someone point me in the right direction to ask it.

Thanks!

Andrew Robinson

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 3 lines · Andrew Robinson

My question is this. What is the correct way within the hotplug framework to get a hot-plugged drive to mount automatically?

Use something like devlabel. It should handle it for you just fine.

Good luck,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Andrew Robinson
Quoted 8 lines · Greg KH
Quoted 2 lines · Andrew Robinson

My question is this. What is the correct way within the hotplug framework to get a hot-plugged drive to mount automatically?

Use something like devlabel. It should handle it for you just fine.

After studying the man page and playing with the program a bit, I cannot figure out how to get devlabel to work for me. When I plug in the drive, updfstab adds this entry to the /etc/fstab:

/dev/extdrive /mnt/extdrive auto noauto,owner,kudzu 0 0

That is based on this entry in the /etc/updfstab.conf file:

device extdrive {
     match   hd "WD800JB-00FMA0"
     symlink true
}

The device symlink is this:

lrwxrwxrwx 1 root root 9 May 3 16:11 /dev/extdrive -> /dev/sda1

So to get a reference to the symlink in the fstab file, I have to configure updfstab to create that link. When I try to add this entry to devlabel, it complains that the symlink already exists. So I turned off the drive and tried to add the entry to devlabel, and it complained that the device file /dev/sda1 did not exist. The other way to add a devlabel entry is by UUID, but this drive does not seem to have one. When I run /usr/bin/partition_uuid /dev/sda1 (when /dev/sda1 exists), I get this response:

partition_uuid: partition does not appear to have a UUID

When I run /usr/bin/scsi_unique_id against the device file, I get this response:

model: WDC WD800JB-00FMA0
page83: No page83 information found.
page80: No page80 information found.

I could be missing something (I never underestimate my ability to screw up), but it appears devlabel will not work for me in this instance. That gets me back to my original problem. When I plug in this disk drive, I get a valid entry in /etc/fstab. How do I mount that entry during the hotplug sequence?

Thanks!

Andrew Robinson

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel