LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-23-2007, 11:07 PM   #1
unknownmosquito
Member
 
Registered: Dec 2005
Distribution: Fedora 8
Posts: 57

Rep: Reputation: 15
automount external USB drive


Hello everyone.

I have a USB External HD that hold a large portion of my media, and a desktop. In order to make it work, I have to unplug it before I boot and plug it back in after Gnome has appeared for automount or Gnome Volume Manager to acknowledge its existence.

Are there any setting I'm unaware of that might help in letting it be autodetected even if it was plugged in during boot so that I dont have to keep unplugging it and plugging it back in?


Thanks
Ian
 
Old 05-24-2007, 01:19 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If the device itself detected? If not, you might try restarting the dbus and hal daemons.

If you click on the Computer icon, if the device shows up there, you can try mounting it. I use SuSE with KDE, so I'm accustomed to entering "sysinfo:/" in konqueror.
 
Old 05-24-2007, 02:41 PM   #3
unknownmosquito
Member
 
Registered: Dec 2005
Distribution: Fedora 8
Posts: 57

Original Poster
Rep: Reputation: 15
It only detects it after I unplug the device (it was plugged in during boot) and plug it back in, or wait until Gnome has loaded to plug it in in the first place.

The drive light blinks on it all during boot -- it seems to be confusing udev?
 
Old 05-24-2007, 03:26 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If it isn't assigned a device by udev, then restarting the dbus daemon may help.

If the device isn't even detected looking at "lsusb" you may need to unload and reload a kernel module such as "usb_ehcd". You may need to unmount other usb drives first so you don't lock up the machine.
Code:
sudo /sbin/modprobe -r usb_ehcd
sudo /sbin/modprobe    usb_ehcd
I did this just last week. The system partitions are too full, and I deleted some files in /var/cache I shouldn't have. I wasn't able to connect a usb external drive. Even lsusb didn't show it. After reloading usb_ehcd it was detected.

On my system, there is a command called "halmount" that allows a regular user to trigger a mount. You can use the device name or the mount point as an argument.

For my external drives, I have entries for them in /etc/fstab. That allows me as a regular user to mount them.
Code:
UUID=3da4cc2e-80bd-4c03-94e8-fe25e4b64178       /media/lbigdisk         ext3    acl,user_xattr,noauto,user      0 0
UUID=b545812a-57af-43e8-bbd8-f9b43dd25fc8       /mnt/nd2                xfs     defaults,user,noauto            0 0
I have the nd2 drive plugged in right now so I can walk you through setting it up.
Using "sudo -f tail /var/log/messages" I can get the device detected, if I don't know it:
Code:
...
May 24 20:59:42 hpamd64 kernel:  sdb: sdb1
May 24 20:59:42 hpamd64 kernel: sd 2:0:0:0: Attached scsi disk sdb
May 24 20:59:42 hpamd64 kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0
May 24 20:59:42 hpamd64 kernel: usb-storage: device scan complete
So next I can use the "udevinfo" command to get the UUID of the filesystem:
Code:
udevinfo -q env -n /dev/sdb1
ID_VENDOR=Maxtor_6
ID_MODEL=Y250P0
ID_REVISION=YAR4
ID_SERIAL=Maxtor_6_Y250P0_0332005C
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0
ID_EDD=int13_dev81
ID_FS_USAGE=filesystem
ID_FS_TYPE=xfs
ID_FS_VERSION=
ID_FS_UUID=b545812a-57af-43e8-bbd8-f9b43dd25fc8
ID_FS_LABEL=
ID_FS_LABEL_SAFE=
Note the ID_FS_UUID entry. That is what you use for the /etc/fstab entry in the first field. The filesystem is also listed. That is used for the third field.
Code:
UUID=b545812a-57af-43e8-bbd8-f9b43dd25fc8       /mnt/nd2                xfs     defaults,user,noauto            0 0
Also note the user and noauto options. The user option allow me to mount it as a regular user. I am the owner of the filesystem so it allows me to mount it. The noauto prevents lockups if you boot up without the device plugged in.
For usb pen drives, you can label the Drive and use "LABEL=<your label>" instead of "UUID=" in the fstab entry. For fat32 devices, use the "uid=<yourusername>" option as well and either umask or fmask & dmask options. When you run the mount command, it checks for the "user=<yourusername>" entry in /etc/fstab. If you are that user, you can mount the filesystem without having to use sudo. ( mount is an suid program )

I used the mlabel program to label a usb cruzer pendrive. I had to add two lines to /etc/mtools.conf:
Code:
# added for sandisk
drive e: file="/dev/sda1"
drive f: file="/dev/sdc1"
Code:
sudo minfo f:
root's password:
device information:
===================
filename="/dev/sdc1"
sectors per track: 63
heads: 16
cylinders: 992

mformat command line: mformat -t 992 -h 16 -s 63 -H 233 f:

bootsector information
======================
banner:"!CQ+GIHC"
sector size: 512 bytes
cluster size: 32 sectors
reserved (boot) sectors: 1
fats: 2
max available root directory slots: 512
small size: 0 sectors
media descriptor byte: 0xf8
sectors per fat: 123
sectors per track: 63
heads: 16
hidden sectors: 233
big size: 999703 sectors
physical drive id: 0x80
reserved=0x0
dos4=0x29
serial number: 3B691AFD
disk label="NO NAME    "
disk type="FAT16   "
sudo mlabel f:CRUZER512

Code:
/etc/fstab entry:
LABEL=CRUZER512 /media/Cruzer512 vfat rw,nosuid,nodev,noatime,uid=1000,utf8,shortname=lower,user    0 0
Although udev/hal should be able to automount this device on it's own, it can be convenient having more than one pendrive labeled PODCASTS and having it mount in the same place.
 
Old 06-07-2007, 03:38 PM   #5
Ceran
Member
 
Registered: Sep 2006
Posts: 32

Rep: Reputation: 15
jschiwal, I don't think you're understanding him correctly. I'm having the same problem. Fedora detects and automounts the USB hard drive fine, but only when you plug it in *after* the system has booted. unknownmosquito is asking why it isn't being automounted *during* system startup, so that when he logs in it appears on his desktop. I don't know why you would tell him to restart daemons *during* a reboot, as this makes no sense.
 
Old 06-08-2007, 05:39 PM   #6
bumfluff
LQ Newbie
 
Registered: Jun 2007
Posts: 1

Rep: Reputation: 0
Ah glad it's not just me. Am having exactly the same issue. Used to be fine with Fedora 6 but since upgrading to 7 I've got this issue. Incidentally, the USB drive exists with lsusb:

#Bus 002 Device 004: ID 07ab:fcfe Freecom Technologies
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 001 Device 001: ID 0000:0000

But for some reason does not auto mount on boot. Also, other devices such as iPod do. As said previously, the drive is detected fine if disconnected and connected again.

Very strange. Any help would be greatly appreciated.

Thanks in advance.


Joel
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
automount permissions for external USB HHD mhg Ubuntu 4 11-25-2009 01:44 AM
USB Flash Drive will not automount drlinux VectorLinux 6 04-19-2007 04:47 PM
automount of usb drive konramesh Linux - Hardware 1 12-02-2006 10:16 PM
USB Pen Drive no automount in Suse 10.0 litlmary SUSE / openSUSE 1 05-25-2006 09:29 AM
Mandriva 2006 USB flash Drive Automount casperbg Linux - Hardware 4 10-20-2005 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration