You might try using fsck to check if the filesystem on the pendrive is OK. If it was unplugged before the cache was written, it may be damaged.
Some things to try:
restart the dbus daemon
restart the hal daemon
Umount any usb drives and then unload & reload the ehci_hcd or uhci_hcd kernel modules.
Monitor the kernel messages when inserting the pen drive:
sudo tail -f /var/log/messages
This may alert you to problems.
Examine the udev info.
udevinfo -n env -n /dev/sda1
This will tell you things like the filesystem, the label and the UUID of the filesystem.
For example:
Code:
:~> sudo tail -f /var/log/messages
root's password:
May 26 01:50:45 hpamd64 sudo: jschiwal : TTY=pts/2 ; PWD=/home/jschiwal ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/messages
May 26 01:50:52 hpamd64 kernel: usb 3-1: new high speed USB device using ehci_hcd and address 5
May 26 01:50:52 hpamd64 kernel: usb 3-1: new device found, idVendor=0781, idProduct=5150
May 26 01:50:52 hpamd64 kernel: usb 3-1: new device strings: Mfr=1, Product=2, SerialNumber=3
May 26 01:50:52 hpamd64 kernel: usb 3-1: Product: Cruzer Mini
May 26 01:50:52 hpamd64 kernel: usb 3-1: Manufacturer: SanDisk Corporation
M
...
May 26 01:50:53 hpamd64 kernel: sdc: assuming drive cache: write through
May 26 01:50:53 hpamd64 kernel: sdc: sdc1
May 26 01:50:53 hpamd64 kernel: sd 4:0:0:0: Attached scsi removable disk sdc
Now I know the device node for the partition is /dev/sdc1.
Code:
~> udevinfo -q env -n /dev/sdc1
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.1
ID_SERIAL=SanDisk_Cruzer_Mini_SNDK4F87642EAA601103
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_LABEL=CRUZER512
ID_FS_LABEL_SAFE=CRUZER512
It would be better using LABEL=CRUZER512 or UUID=3B69-1AFD as the device in the /etc/fstab entry. This would allow me to mount the device even if it is assigned to a different device node, such as /dev/sdb1.
If I wanted to manually mount it,
Code:
LABEL=CRUZER512 /media/CRUZER512 vfat noatime,noauto,users,gid=users,fmask=0113,dmask=0002,utf8=true
or
LABEL=CRUZER512 /media/CRUZER512 vfat noatime,noauto,user,uid=1000,gid=users,fmask=0137,dmask=0027,utf8=true
The first fstab entry example allows any normal user to enter "mount /media/CRUZER512" to mount it. It isn't necessary to use sudo.
The second example gives me exclusive write access to the device when mounted. And only root and myself can mount it on this system.