View Full Version : automount usb drive or flash reader on server--SOLVED
Cajun Mike 03-17-2007, 09:55 AM on a server running command line only? any ideas?
eaux-yeah 03-18-2007, 03:24 PM sudo apt-get install hal hal-device-manager pmount usbmountWhen installing the normal Ubuntu Desktop, all of these are installed by default. The Server install does not install all of them.
After all is installed, perform:
sudo update-rc.d -f dbus remove
sudo update-rc.d dbus defaults 12
to make sure all is setup correctly.
Note, if you added anything in the /etc/fstab file trying to make this work, remove it. It is not needed.
Try that and see what happens.
You can see what's happening live if you type:
sudo tail -f /var/log/messagesbefore inserting the USB Drive.
.
Cajun Mike 03-24-2007, 08:53 AM ok that worked so how do i access it . it's not showing up in media???
Mar 24 08:34:16 server1 -- MARK --
Mar 24 08:50:31 server1 kernel: [42951573.830000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
Mar 24 08:50:31 server1 kernel: [42951573.840000] sda: Write Protect is off
Mar 24 08:50:31 server1 kernel: [42951573.940000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
Mar 24 08:50:31 server1 kernel: [42951573.940000] sda: Write Protect is off
Mar 24 08:50:31 server1 kernel: [42951573.990000] sda: sda1
This is from dmesg
949397.170000] usb-storage: device scan complete
[42949397.180000] Vendor: EPSON Model: Stylus Storage Rev: 1.00
[42949397.180000] Type: Direct-Access ANSI SCSI revision: 02
[42949397.210000] sd 3:0:0:0: Attached scsi removable disk sda
[42949397.250000] sd 3:0:0:0: Attached scsi generic sg0 type 0
[42949399.120000] NET: Registered protocol family 10
[42949399.120000] lo: Disabled Privacy Extensions
[42949399.120000] IPv6 over IPv4 tunneling driver
[42949409.180000] eth0: no IPv6 routers present
[42951573.830000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42951573.840000] sda: Write Protect is off
[42951573.840000] sda: Mode Sense: 0d 00 00 08
[42951573.840000] sda: assuming drive cache: write through
[42951573.940000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42951573.940000] sda: Write Protect is off
[42951573.940000] sda: Mode Sense: 0d 00 00 08
[42951573.940000] sda: assuming drive cache: write through
[42951573.990000] sda: sda1
When i typed the first command it was like whoa it installed a bunch of stuff.
I tried ssh in through nautilus but I don't see it?
Cajun Mike 03-24-2007, 09:09 AM mkdir /media/compactflash
mount -t auto /dev/sda1 /media/compactflash
ok i renaned it epsondrive, it seems if you stick in more than one flash card in read whoever was there first has control.
there should be a way to automount and dismount?
how about this in fstab?
none /sys sysfs defaults 0 0
eaux-yeah 03-24-2007, 02:24 PM I tried ssh in through nautilus but I don't see it?Wait a minute, this is on the "server" correct? You have Nautilus on the server?? The server shouldn't even be running X.
how about this in fstab?
none /sys sysfs defaults 0 0You shouldn't even have to mess with /etc/fstab at all for auto-mounting usb devices.
Is dbus/hald, udev, and autofs running?
run:
sudo sysvconfigMake SURE that autofs, dbus, and udev are selected.
If any are NOT selected, select them, and restart your system (yeah, you can manually start the services, I just want you to restart to make sure).
When the system comes back up, insert the usbstick and run:
sudo mountPost the output of that command here.
Cajun Mike 03-24-2007, 07:23 PM answer to first question ssh nautilus from other machine (some peoples children)
2nd no it's not there but I read about it that i why I asked!
will do the others and respond back
Cajun Mike 03-25-2007, 07:16 AM ok autofs was not there dbus is but no ref to hald?
udev is there too.
Cajun Mike 03-25-2007, 07:23 AM /dev/hda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hdb1 on /media/storage type ext3 (rw)
eaux-yeah 03-25-2007, 12:13 PM sudo apt-get autofs binfmt-supportMake sure they are started at boot:
sudo update-rc.d autofs defaults 12
sudo update-rc.d binfmt-support defaults 12
or
sudo sysvconfig
That looks like the missing pieces. Remove whatever you manually set in /etc/fstab.
Autofs (automount) takes care of all that.
Cajun Mike 03-26-2007, 07:29 AM well i had already taken out what i had put in fstab a few post back. :p
so how do i look at the content of the drives? One is a usb-160Gb @sdb1
and the other is a compactflash-512Mb @sda1
eaux-yeah 03-26-2007, 01:44 PM So you have autofs and binfmt-support running?
When you plug your usbkey in, what does the 'mount' command show?
Cajun Mike 03-26-2007, 04:02 PM /dev/hda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hdb1 on /media/storage type ext3 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
This is with a USB Drive, a 512Mb Compactflash and a 512Mb Usb Thumbdrive
Thsi is what dmesg shows
[42949402.350000] sd 3:0:0:0: Attached scsi removable disk sda
[42949402.370000] sd 3:0:0:0: Attached scsi generic sg0 type 0
[42949471.460000] usb 3-6: new high speed USB device using ehci_hcd and address 4
[42949471.710000] usb 3-6: configuration #1 chosen from 1 choice
[42949471.710000] scsi4 : SCSI emulation for USB Mass Storage devices
[42949471.710000] usb-storage: device found at 4
[42949471.710000] usb-storage: waiting for device to settle before scanning
[42949476.710000] usb-storage: device scan complete
[42949476.750000] Vendor: ST316002 Model: 1A Rev: 8.01
[42949476.750000] Type: Direct-Access ANSI SCSI revision: 00
[42949476.750000] SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
[42949476.750000] sdb: Write Protect is off
[42949476.750000] sdb: Mode Sense: 03 00 00 00
[42949476.750000] sdb: assuming drive cache: write through
[42949476.810000] SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
[42949476.810000] sdb: Write Protect is off
[42949476.810000] sdb: Mode Sense: 03 00 00 00
[42949476.810000] sdb: assuming drive cache: write through
[42949476.870000] sdb: sdb1
[42949476.890000] sd 4:0:0:0: Attached scsi disk sdb
[42949476.890000] sd 4:0:0:0: Attached scsi generic sg1 type 0
[42949700.700000] usb 3-6: USB disconnect, address 4
[42949724.960000] kjournald starting. Commit interval 5 seconds
[42949724.960000] EXT3 FS on hdb1, internal journal
[42949724.960000] EXT3-fs: mounted filesystem with ordered data mode.
[42949732.650000] NET: Registered protocol family 10
[42949732.650000] lo: Disabled Privacy Extensions
[42949732.650000] IPv6 over IPv4 tunneling driver
[42949743.160000] eth0: no IPv6 routers present
[42950129.700000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42950129.700000] sda: Write Protect is off
[42950129.700000] sda: Mode Sense: 0d 00 00 08
[42950129.700000] sda: assuming drive cache: write through
[42950129.800000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42950129.800000] sda: Write Protect is off
[42950129.800000] sda: Mode Sense: 0d 00 00 08
[42950129.800000] sda: assuming drive cache: write through
[42950129.850000] sda: sda1
[42951666.580000] usb 3-6: new high speed USB device using ehci_hcd and address 5
[42951666.820000] usb 3-6: configuration #1 chosen from 1 choice
[42951666.820000] scsi5 : SCSI emulation for USB Mass Storage devices
[42951666.820000] usb-storage: device found at 5
[42951666.820000] usb-storage: waiting for device to settle before scanning
[42951671.820000] usb-storage: device scan complete
[42951671.850000] Vendor: ST316002 Model: 1A Rev: 8.01
[42951671.850000] Type: Direct-Access ANSI SCSI revision: 00
[42951671.860000] SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
[42951671.860000] sdb: Write Protect is off
[42951671.860000] sdb: Mode Sense: 03 00 00 00
[42951671.860000] sdb: assuming drive cache: write through
[42951671.900000] SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
[42951671.910000] sdb: Write Protect is off
[42951671.910000] sdb: Mode Sense: 03 00 00 00
[42951671.910000] sdb: assuming drive cache: write through
[42951671.950000] sdb: sdb1
[42951671.970000] sd 5:0:0:0: Attached scsi disk sdb
[42951671.970000] sd 5:0:0:0: Attached scsi generic sg1 type 0
[42978072.930000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42978072.930000] sda: Write Protect is off
[42978072.930000] sda: Mode Sense: 0d 00 00 08
[42978072.930000] sda: assuming drive cache: write through
[42978072.970000] SCSI device sda: 1000944 512-byte hdwr sectors (512 MB)
[42978072.970000] sda: Write Protect is off
[42978072.970000] sda: Mode Sense: 0d 00 00 08
[42978072.970000] sda: assuming drive cache: write through
[42978073.010000] sda: sda1
[42978849.670000] ohci_hcd 0000:00:02.0: wakeup
[42978850.120000] usb 1-3: new full speed USB device using ohci_hcd and address 2
[42978850.350000] usb 1-3: configuration #1 chosen from 1 choice
[42978850.350000] scsi6 : SCSI emulation for USB Mass Storage devices
[42978850.350000] usb-storage: device found at 2
[42978850.350000] usb-storage: waiting for device to settle before scanning
[42978855.350000] usb-storage: device scan complete
[42978855.360000] Vendor: USB 1.1 Model: Flash Drive Rev: 1.89
[42978855.360000] Type: Direct-Access ANSI SCSI revision: 02
[42978855.450000] SCSI device sdc: 64000 512-byte hdwr sectors (33 MB)
[42978855.460000] sdc: Write Protect is off
[42978855.460000] sdc: Mode Sense: 03 00 00 00
[42978855.460000] sdc: assuming drive cache: write through
[42978855.520000] SCSI device sdc: 64000 512-byte hdwr sectors (33 MB)
[42978855.530000] sdc: Write Protect is off
[42978855.530000] sdc: Mode Sense: 03 00 00 00
[42978855.530000] sdc: assuming drive cache: write through
[42978855.570000] sdc: unknown partition table
[42978855.600000] sd 6:0:0:0: Attached scsi removable disk sdc
[42978855.600000] sd 6:0:0:0: Attached scsi generic sg2 type 0
[42979118.030000] usb 1-3: USB disconnect, address 2
[42979186.480000] usb 3-5: new high speed USB device using ehci_hcd and address 7
[42979186.630000] usb 3-5: configuration #1 chosen from 1 choice
[42979186.630000] scsi7 : SCSI emulation for USB Mass Storage devices
[42979186.630000] usb-storage: device found at 7
[42979186.630000] usb-storage: waiting for device to settle before scanning
[42979191.630000] usb-storage: device scan complete
[42979191.630000] Vendor: SanDisk Model: Cruzer Micro Rev: 0.1
[42979191.630000] Type: Direct-Access ANSI SCSI revision: 02
[42979191.630000] SCSI device sdc: 1000944 512-byte hdwr sectors (512 MB)
[42979191.630000] sdc: Write Protect is off
[42979191.630000] sdc: Mode Sense: 03 00 00 00
[42979191.630000] sdc: assuming drive cache: write through
[42979191.670000] SCSI device sdc: 1000944 512-byte hdwr sectors (512 MB)
[42979191.670000] sdc: Write Protect is off
[42979191.670000] sdc: Mode Sense: 03 00 00 00
[42979191.670000] sdc: assuming drive cache: write through
[42979191.700000] sdc: sdc1
[42979191.700000] sd 7:0:0:0: Attached scsi removable disk sdc
[42979191.700000] sd 7:0:0:0: Attached scsi generic sg2 type 0
eaux-yeah 03-26-2007, 10:00 PM Do the following files exist?
/etc/udev/rules.d/65-persistent-storage.rules
/etc/udev/rules.d/z60_usbmount.rules
also:
ps ax|grep udevdoes it report:
/sbin/udevd --daemon?
Cajun Mike 03-27-2007, 10:45 AM 2073 ? S<s 0:00 /sbin/udevd --daemon
16423 pts/0 S+ 0:00 grep udev
check, check and check
eaux-yeah 03-27-2007, 03:26 PM OK, having finally having some time to dig into this a bit more, a solution has been found.
For anyone that may find this thread useful, this particular thread is dealing with the Ubuntu 'Server' (http://www.ubuntu.com/products/whatisubuntu/serveredition). FYI, the 'Server' is completely different than the normal Ubuntu 'Desktop' (http://www.ubuntu.com/products/whatisubuntu/desktopedition). The 'Server' is basically very minimal, stripped-down version. Now you know, if you didn't before.
The Desktop version uses pmount, udev, hal, and the gnome-volume-manager to automount usbsticks (usbkeys, pendrive, whatever?)
The Server does not come with X (NO GUI, all 100% terminal based). Of course X CAN be installed, but it's for a server, real servers do need no stinkin' GUI! :ezbill:
In the case of Ubuntu Server, pmount, hal, and udev should be installed, BUT, instead of gnome-volume-manager, the application ivman (http://ivman.sourceforge.net) should be installed. Ubuntu automatically puts this in the startup config file when installed. so you won't have to worry about it not starting at boot.
From the ivman site:
Ivman is a generic handler for HAL (http://freedesktop.org/wiki/Software_2fhal) events.
Originally for automounting, it can now be used to run arbitrary commands when events or conditions occur or properties are modified on your hardware
Once again, this is for the Ubuntu Server and most other distros NOT running X.
Hope this helps someone.
|
|