Static Mount of USB external hard drive and memory card docking station

Asked by Peter de Groot

Hi and help.

I am running Ubuntu 8.10 and am trying to statically assign as external USB drive (or rather a docking station)
for my backup cron jobs to run. One interesting thing, is the drive has has 4 card readers as well as a removable SATA drive.

Have trawled google for hours ..... but all of the doc I have read talks about
drive parameters that that I cannot see in the udev output.. Will append a bit of it to the end of this ....

I am trying the usbmount program ... but again it seem to be looking in the udev output for stuff that
does not exist any more.

When I plug it in .. it is recognised ....

syslog and udev output appended

BTW ... how do I turn off the automount thing in the gnome desktop .. the options for removeable drives
and what not appear to be missing !! BTW .. it works however, if I log in..

TIA

Jan 23 18:09:33 curric4182-07 kernel: [ 5472.268017] usb 5-5: new high speed USB device using ehci_hcd and address 5
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.400472] usb 5-5: configuration #1 chosen from 1 choice
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.401272] hub 5-5:1.0: USB hub found
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.401836] hub 5-5:1.0: 4 ports detected
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.696103] usb 5-5.1: new high speed USB device using ehci_hcd and address 6
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.806452] usb 5-5.1: configuration #1 chosen from 1 choice
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.807102] scsi6 : SCSI emulation for USB Mass Storage devices
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.807201] usb-storage: device found at 6
Jan 23 18:09:33 curric4182-07 kernel: [ 5472.807204] usb-storage: waiting for device to settle before scanning
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.804207] usb-storage: device scan complete
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.804798] scsi 6:0:0:0: Direct-Access Generic USB SD Reader 1.00 PQ: 0 ANSI: 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.805312] scsi 6:0:0:1: Direct-Access Generic USB CF Reader 1.01 PQ: 0 ANSI: 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.805919] scsi 6:0:0:2: Direct-Access Generic USB SM Reader 1.02 PQ: 0 ANSI: 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.806418] scsi 6:0:0:3: Direct-Access Generic USB MS Reader 1.03 PQ: 0 ANSI: 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.808758] sd 6:0:0:0: [sde] Attached SCSI removable disk
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.808883] sd 6:0:0:0: Attached scsi generic sg5 type 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.812295] sd 6:0:0:1: [sdf] Attached SCSI removable disk
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.812365] sd 6:0:0:1: Attached scsi generic sg6 type 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.817957] sd 6:0:0:2: [sdg] Attached SCSI removable disk
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.818059] sd 6:0:0:2: Attached scsi generic sg7 type 0
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.820650] sd 6:0:0:3: [sdh] Attached SCSI removable disk
Jan 23 18:09:38 curric4182-07 kernel: [ 5477.820730] sd 6:0:0:3: Attached scsi generic sg8 type 0
Jan 23 18:09:43 curric4182-07 kernel: [ 5483.012076] usb 5-5.4: new high speed USB device using ehci_hcd and address 7
Jan 23 18:09:43 curric4182-07 kernel: [ 5483.122558] usb 5-5.4: configuration #1 chosen from 1 choice
Jan 23 18:09:43 curric4182-07 kernel: [ 5483.123611] scsi7 : SCSI emulation for USB Mass Storage devices
Jan 23 18:09:43 curric4182-07 kernel: [ 5483.124753] usb-storage: device found at 7
Jan 23 18:09:43 curric4182-07 kernel: [ 5483.124759] usb-storage: waiting for device to settle before scanning
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.124166] usb-storage: device scan complete
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.124897] scsi 7:0:0:0: Direct-Access WDC WD50 00AAKS-00C8A0 PQ: 0 ANSI: 2 CCS
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.127508] sd 7:0:0:0: [sdi] 976773168 512-byte hardware sectors (500108 MB)
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.128254] sd 7:0:0:0: [sdi] Write Protect is off
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.128260] sd 7:0:0:0: [sdi] Mode Sense: 00 38 00 00
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.128263] sd 7:0:0:0: [sdi] Assuming drive cache: write through
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.129002] sd 7:0:0:0: [sdi] 976773168 512-byte hardware sectors (500108 MB)
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.129754] sd 7:0:0:0: [sdi] Write Protect is off
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.129757] sd 7:0:0:0: [sdi] Mode Sense: 00 38 00 00
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.129759] sd 7:0:0:0: [sdi] Assuming drive cache: write through
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.129763] sdi: sdi1
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.135655] sd 7:0:0:0: [sdi] Attached SCSI disk
Jan 23 18:09:48 curric4182-07 kernel: [ 5488.135796] sd 7:0:0:0: Attached scsi generic sg9 type 0
Jan 23 18:09:58 curric4182-07 usbmount[8369]: cannot read from /dev/sdg

Jan 23 18:10:08 curric4182-07 usbmount[8375]: cannot acquire lock /var/run/usbmount/.mount.lock
Jan 23 18:10:08 curric4182-07 usbmount[8407]: cannot acquire lock /var/run/usbmount/.mount.lock
Jan 23 18:10:28 curric4182-07 usbmount[8374]: cannot read from /dev/sdf

****************************************************************************************************************************************

Output from

udevinfo -a -p $(udevinfo -q path -n /dev/sdi)

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5.4/5-5.4:1.0/host5/target5:0:0/5:0:0:0/block/sdi/sdi1':
    KERNEL=="sdi1"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{start}=="63"
    ATTR{size}=="976768002"
    ATTR{stat}==" 1754 154924 185110 9848 2 2 4 16 0 3780 9864"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5.4/5-5.4:1.0/host5/target5:0:0/5:0:0:0/block/sdi':
    KERNELS=="sdi"
    SUBSYSTEMS=="block"
    DRIVERS==""
    ATTRS{range}=="16"
    ATTRS{removable}=="0"
    ATTRS{ro}=="0"
    ATTRS{size}=="976773168"
    ATTRS{capability}=="12"
    ATTRS{stat}==" 1782 154962 185638 9996 2 2 4 16 0 3912 10012"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5.4/5-5.4:1.0/host5/target5:0:0/5:0:0:0/block':
    KERNELS=="block"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5.4/5-5.4:1.0/host5/target5:0:0/5:0:0:0':
    KERNELS=="5:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="3"
    ATTRS{vendor}=="WDC WD50"
    ATTRS{model}=="00AAKS-00C8A0 "
    ATTRS{rev}==" "
    ATTRS{state}=="running"
    ATTRS{timeout}=="30"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0x71b"
    ATTRS{iodone_cnt}=="0x71b"
    ATTRS{ioerr_cnt}=="0x0"
    ATTRS{modalias}=="scsi:t-0x00"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="1"
    ATTRS{queue_type}=="none"
    ATTRS{max_sectors}=="240"

  looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5.4/5-5.4:1.0/host5/target5:0:0':
--More--(34%)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Guillermo Belli
Solved:
Last query:
Last reply:
Revision history for this message
Andy Ruddock (andy-ruddock) said :
#1

The drive is on /dev/sdi
In /etc/fstab use :

/dev/sdi /mnt ext3 rw,defaults

Replace /mnt with the directory you want to mount the drive into and ext3 with the volume type

Once it's been mounted at startup automount will ignore it.

Revision history for this message
Best Guillermo Belli (glock24) said :
#2

It is possible that the disk is not always assigned the same device name in /dev, so it would be better to specify the UUID (a unique identifier assigned to a filesystem [partition] at the time of creation [foirmating]) instead of the device name in /etc/fstab

To get the UUID to the following: ls -l /dev/disk/by-uuid/

You will something like this:

lrwxrwxrwx 1 root root 10 2009-01-23 11:16 1efce13a-fdb2-4b15-8cef-6495a0640753 -> ../../sda8
lrwxrwxrwx 1 root root 10 2009-01-23 11:16 50cceb09-609d-4815-abac-11e01b140cd0 -> ../../sda7
lrwxrwxrwx 1 root root 10 2009-01-23 11:16 523A3F308879353A -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-01-23 11:16 8050603a-ef40-4c58-9a92-f6794e8de8ed -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-01-23 11:16 A2F09F72F09F4B83 -> ../../sda6

The UUID is the long number string, take that and modify the line in /etc/fstab:

/dev/sdi /mnt ext3 rw,defaults

with

UUID=50cceb09-609d-4815-abac-11e01b140cd0 /mnt ext3 ext3 rw,defaults

Replace the UUID string for the one of your disk.

Hope this helps.

Revision history for this message
Andy Ruddock (andy-ruddock) said :
#3

Good call.

Revision history for this message
Peter de Groot (peter-de-groot) said :
#4

Thanks Guillermo Belli, that solved my question.

Revision history for this message
Peter de Groot (peter-de-groot) said :
#5

You good little linux .. digging this info out for me. :-)

 /dev/disk/by-uuid/ is a new construct for me .... and very handy. I notice the standard
install uses the UUID as well in the fstab file.

This will also minimise any potential problems where I can change the disk order
in the BIOS... scary. :-P

Many tx for the help people .. . much appreciated.

Peter