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.