[TriLUG] Re: USB memory key, removal, IO errors

Lance A. Brown lance at bearcircle.net
Thu Mar 25 14:35:55 EST 2004


Remember that accessing a USB key is just like accessing any other 
filesystem.  It gets mounted and need proper handling before you can 
remove the device from the computer.

Use unmount or eject to handle it.

I have
/dev/sda1 /mnt/usbhd1 vfat noauto,uid=2122,gid=2122,user,owner,rw 0 0
/dev/sda2 /mnt/usbhd2 ext2      noauto,user,rw 0 0

in my /etc/fstab to handle a 128MB USB key with two 64MB partitions, one 
VFAT and one ext2.  Running GNOME I just right click and select 
Disks->usbhd1 or Disks->usbhd2 to mount them and then use the eject 
option on the menu for the device object on my screen before removing 
the key.  Works fine.

I tried to set up autofs to handle it but found autofs to be flakey in 
bad ways so I just handle it manually.

Command line equivalent would be to 'mount /mnt/usbhdb1' and 'umount 
/mnt/usbhd1'.

I found out that running 'eject /dev/sdXX' will clear the scsi system so 
that if you mount one USB storage device, remove it, then mount naother, 
you don't confuse the system.  It works but each new device gets a 
different /dev/sdX assigned to it.  It gets confusing if you swap them 
around a lot.

--[Lance]



Frye, Matthew wrote:
> After I umount my usb key, I receive IO errors when I pull it out.  See
> below:
> 
> Mar 25 11:14:17 hermes kernel: usb.c: USB disconnect on device 00:14.2-2
> address 2
> Mar 25 11:14:17 hermes kernel: sda: Unit Not Ready, sense:
> Mar 25 11:14:17 hermes kernel: Info fld=0xa00 (nonstd), Current 00:00: sense
> key Not Ready
> Mar 25 11:14:17 hermes kernel: sda : READ CAPACITY failed.
> Mar 25 11:14:17 hermes kernel: sda : status = 1, message = 00, host = 0,
> driver = 08
> Mar 25 11:14:17 hermes kernel: Info fld=0xa00 (nonstd), Current sd00:00:
> sense key Not Ready
> Mar 25 11:14:17 hermes kernel: sda : block size assumed to be 512 bytes,
> disk size 1GB.
> Mar 25 11:14:17 hermes kernel: sda: test WP failed, assume Write Enabled
> Mar 25 11:14:17 hermes kernel:  sda: I/O error: dev 08:00, sector 0
> Mar 25 11:14:17 hermes kernel:  I/O error: dev 08:00, sector 0
> Mar 25 11:14:17 hermes kernel:  unable to read partition table
> 
> Is there a step I am missing?  Perhaps something I "should" be doing before
> I yank 'er out of the usb port?  I just don't like to ignore errors.
> 
> Matt
> 

-- 
  Celebrate The Circle: http://www.celebratethecircle.org/
  Carolina Spirit Quest:  http://www.carolinaspiritquest.org/
  My LiveJournal: http://www.livejournal.com/users/labrown/




More information about the TriLUG mailing list