USB mass storage support


Forum: Other Help Topics
Topic: USB mass storage support
started by: Zucca

Posted by Zucca on Feb. 16 2007,17:38
There are several occasions where I can't mount my USB storage devices.

dmesg shows this:
Quote
hub.c: new USB device 00:07.2-1.3, assigned address 14
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 14
scsi singledevice 2 0 0 1
scsi singledevice 2 0 0 2
scsi singledevice 2 0 0 3
scsi singledevice 2 0 0 4
scsi singledevice 2 0 0 5
scsi singledevice 2 0 0 6
SCSI device sdd: 121049 512-byte hdwr sectors (62 MB)
sdd: Write Protect is off
sdd: sdd1 sdd2 sdd3 sdd4
I/O error: dev 08:31, sector 0
I/O error: dev 08:32, sector 0
I/O error: dev 08:33, sector 0
I/O error: dev 08:34, sector 0

Mount says that I must specify filesystem type.
AFAIK it's FAT32. Anyway, DSL should regonize FAT32 automatically?

Posted by lucky13 on Feb. 16 2007,18:34
How are you trying to mount it? Hotplug should auto-detect it and set up a mount point sequentially with the recognized filesystem. So the first mount point for a flash device should be sda1, the second would be sdb1, etc. If the device (assuming it's a thumbdrive) is the first one you plug in, you should be able to either mount it simply with "sudo mount /mnt/sda1" from command line or with the right click on /mnt/sda1 in emelfm as described elsewhere. I've never had to assign filesystem types when mounting thumbdrives, flash camera devices, or mp3 players with hotplug.
Posted by Zucca on Feb. 16 2007,19:26
Hotpulg creates required lines to fstab. It all works just fine until I have to mount.
To be exact: I mount from emelfm while I'm root (as superuser to make somethings clear), of course (so now there's no telling about this). It does just the same.
So there's no question that I don't know how to mount devices (I know also how to mount in command line). There's just an error somewhere. What I'm looking for is to how to fix this error (bug?).
I cannot access to it with fdisk either. It means that this error isn't actually happening when mounting. it occurs earlier (look the dmesg I pasted).
I had this same problem with my Creative MuVo Slim MP3 player.

Posted by lucky13 on Feb. 16 2007,19:53
Quote (Zucca @ Feb. 16 2007,14:26)
What I'm looking for is to how to fix this error (bug?).
I cannot access to it with fdisk either. It means that this error isn't actually happening when mounting. it occurs earlier (look the dmesg I pasted).
I had this same problem with my Creative MuVo Slim MP3 player.

Are you sure these devices work elsewhere? Have you reformatted them or otherwise done anything with their filesystems? Can you get these devices mounted if you boot with them plugged in? Have you specified a filesystem in a mount command? Please copy your "fdisk -l /dev/sda" (or whatever) here.

Like I wrote while ago, I've never experienced any problem mounting USB storage media with hotplug (including under Knoppix and DSL).

Try rebooting with the USB device (or both) inserted and see if you can mount it after the reboot. If that doesn't work, please paste in your mtab and fstab (along with the fdisk -l devicepath). You can paste those files in if you don't want to reboot. I just want to see that the mount point is created when you plug the device in and what file system its reporting (if any).

Posted by Zucca on Feb. 16 2007,20:08
Booting computer every time when plugging USB storage device isn't just acceptable.
And yes. Mount point is created. But NOT removed on unplugging.

I never encountered these errors with Xubuntu.

Posted by lucky13 on Feb. 16 2007,20:12
Quote (Zucca @ Feb. 16 2007,15:08)
Booting computer every time when plugging USB storage device isn't just acceptable.
And yes. Mount point is created. But NOT removed on unplugging.

I never encountered these errors with Xubuntu.

Hotplug doesn't remove mount points. That's why you get the sequential sda, sdb, etc., instead of recycling points. I agree that you should be able to mount and umount without rebooting. Please paste in at least your mtab to show the points hotplug is setting and the filesystem it's reporting for your devices. (Sorry, I edited my reply while you were replying.)

I'm using Kubuntu. I've likewise never had a problem with it OR with DSL.

Posted by Zucca on Feb. 16 2007,21:52
fdisk -l:
Quote
Disk /dev/sdd: 61 MB, 61977088 bytes
256 heads, 63 sectors/track, 7 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

  Device Boot    Start       End    Blocks   Id  System
/dev/sdd1   ?    266306    266306 2147483647+  ff  BBT
Partition 1 has different physical/logical beginnings (non-Linux?):
    phys=(1023, 255, 63) logical=(266305, 4, 4)
Partition 1 has different physical/logical endings:
    phys=(1023, 255, 63) logical=(266305, 4, 2)
/dev/sdd2   ?    266306    266306 2147483647+  ff  BBT
Partition 2 has different physical/logical beginnings (non-Linux?):
    phys=(1023, 255, 63) logical=(266305, 4, 4)
Partition 2 has different physical/logical endings:
    phys=(1023, 255, 63) logical=(266305, 4, 2)
/dev/sdd3   ?    266306    266306 2147483647+  ff  BBT
Partition 3 has different physical/logical beginnings (non-Linux?):
    phys=(1023, 255, 63) logical=(266305, 4, 4)
Partition 3 has different physical/logical endings:
    phys=(1023, 255, 63) logical=(266305, 4, 2)
/dev/sdd4   ?    266306    266306 2147483647+  ff  BBT
Partition 4 has different physical/logical beginnings (non-Linux?):
    phys=(1023, 255, 63) logical=(266305, 4, 4)
Partition 4 has different physical/logical endings:
    phys=(1023, 255, 63) logical=(266305, 4, 2)


cat /etc/fstab:
Quote
proc      /proc       proc   defaults            0 0
/sys       /sys        sysfs  noauto              0 0
/dev/pts   /dev/pts    devpts mode=0622           0 0
/dev/fd0   /mnt/auto/floppy auto   user,noauto,exec,umask=000    0 0
/dev/cdrom /mnt/auto/cdrom  auto   user,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/sda1 /mnt/sda1 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/sdb1 /mnt/sdb1 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/sdb2 /mnt/sdb2 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/hda2 none swap defaults 0 0
# Added by KNOPPIX
/dev/hda3 /mnt/hda3 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda5 /mnt/hda5 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda6 /mnt/hda6 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/hda7 /mnt/hda7 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda8 /mnt/hda8 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda9 /mnt/hda9 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda10 /mnt/hda10 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/sdc /mnt/sdc auto noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sdd /mnt/sdd vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/sde /mnt/sde auto noauto,users,exec 0 0


cat /etc/mtab
Quote
/dev/root / ext2 rw 0 0
/dev/shm /cdrom tmpfs ro 0 0
/dev/cloop /KNOPPIX iso9660 ro 0 0
/ramdisk /ramdisk tmpfs rw,size=512M 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw,devmode=0666 0 0
tmpfs /ramdisk/tmp tmpfs rw,size=256M 0 0
tmpfs /ramdisk/home tmpfs rw,size=10M 0 0
/pkg/dsl/irssi.uci /opt/irssi iso9660 ro,loop=/dev/cloop1 0 0
/dev/hda10 /mnt/hda10 vfat rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=700,mode=0700,uid=1001 0 0
/dev/hda3 /mnt/hda3 ext3 rw,nosuid,nodev 0 0
/dev/hda6 /mnt/hda6 vfat rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=700,mode=0700,uid=1001 0 0
/dev/sda1 /mnt/sda1 vfat rw,nosuid,nodev,umask=000,uid=1001,gid=50,owner=dsl,devmode=700,mode=0700,uid=1001 0 0
/dev/sdb1 /mnt/sdb1 vfat rw,nosuid,nodev,umask=000,uid=1001,gid=50 0 0
/dev/shm /cdrom tmpfs ro 0 0
/dev/shm /cdrom tmpfs ro 0 0



There. =)

Posted by lucky13 on Feb. 16 2007,23:05
Quote (Zucca @ Feb. 16 2007,16:52)

fdisk -l: Disk /dev/sdd...
/dev/sdd1...
/dev/sdd2...
/dev/sdd3...
/dev/sdd4...

cat /etc/fstab:proc      /proc       proc...
# Added by KNOPPIX
/dev/sdd /mnt/sdd vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0


Okay, have you tried mounting each partition on sdd separately?

Posted by Zucca on Feb. 17 2007,08:06
That I did first.
Posted by Zucca on Feb. 17 2007,14:40
dmesg | tail shows something now...
Quote
sde : status = 1, message = 00, host = 0, driver = 08
Info fld=0x0, Current sd00:00: sns = f0  2
ASC=3a ASCQ= 0
Raw sense data:0xf0 0x00 0x02 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x3a 0x00 0x00 0x00 0x00 0x00
sde : block size assumed to be 512 bytes, disk size 1GB.  
sde: test WP failed, assume Write Enabled
sde: I/O error: dev 08:40, sector 0
I/O error: dev 08:40, sector 0
unable to read partition table
usb.c: USB disconnect on device 00:07.2-1.1 address 19


It assumes that my memcard has size of one G byte.
I need to change that somehow...

Posted by roberts on Feb. 17 2007,16:17
You have an inconsistent partition table as shown from the "fdisk -l".
That is why you have io errors and other anomalies.

Posted by Zucca on Feb. 18 2007,20:14
This has happened also to newly formatted devices.
Posted by Zucca on Feb. 20 2007,16:31
Hmmm. I wonder if it's because of the old Linux kernel DSL uses?
Xubuntu can regonize all my USB mass storage devices without problems...

Posted by lucky13 on Feb. 21 2007,16:02
Quote (Zucca @ Feb. 20 2007,11:31)
Hmmm. I wonder if it's because of the old Linux kernel DSL uses?

Kernel 2.4.27 isn't "old" and you can read the changelogs at kernel.org to see how many 2.6 improvements and features have been backported to the 2.4 kernels. Hotplug has always been included in the 2.4 kernel and was also backported to the later 2.2 kernels. I don't think there are any significant differences between 2.4 and 2.6 with respect to hotplug detection, but there are differences in how events are handled (e.g., udev/d and hal/d).

< http://wiki.linuxquestions.org/wiki/Hotplug >
< http://linux-hotplug.sourceforge.net/ >

A little timewarp...
Quote
Quote

sde : block size assumed to be 512 bytes, disk size 1GB.  
sde: test WP failed, assume Write Enabled
sde: I/O error: dev 08:40, sector 0
I/O error: dev 08:40, sector 0
unable to read partition table

It assumes that my memcard has size of one G byte.
I need to change that somehow...


Your device is being detected by the "old" kernel; the fdisk output suggested, and so does this dmesg output, that your problems are related to the partitioning of your device. So does your suggestion that it's misread the size of the device. That's not a kernel problem (afaik; I'm open to being shown otherwise). How is the device partitioned -- number of partitions (when it was listed as sdd, the fdisk listed four partitions), filesystem type, size of partitions, total size (and type) of storage device? Did you install something that may have screwed up the MBR on that device?

Quote
Xubuntu can regonize all my USB mass storage devices without problems...

DSL does recognize your device. You just can't mount it for some reason. Are you running testing the same device concurrently on different boxes or did it once work under Xubuntu and now it doesn't under DSL? If the "problem" isn't being detected concurrently, my guess would be something on your device changed from the time you mounted it in Xubuntu and now.

Again, DSL recognizes all my properly-partitioned USB mass storage devices without problems and I can mount them all, too. It always has regardless of how "new" my devices are compared to the age of kernel 2.4.27. Dittos for boxes I have running 2.2 kernels with hotplug. I don't think the age of the kernel is an issue.

Posted by WDef on Feb. 21 2007,22:51
I don't think anyone else (?) has reported these errors, so it has to be something specific to your setup.

How old are these usb devices, and what exactly are they? You mentioned an mp3 player.  Camera flash cards or similar?  The manufacturers generally say not to reformat these from your pc but instead to use their tools.

Regardless of whether or not these same devices are mounting in Kubuntu, I'd consider backing up all data contained therein immediately. They could easily be dying. If you can't mount them then use dd or a program (Norton Ghost?) that can make a device image from raw data.

Can dd even read from one of these devices in dsl?

ie does dd if=/dev/sde of=/home/dsl/diskout bs=512 run ok?

If dd can't read the raw data then it's nothing to do with mount or partition tables, I'd say your device is stuffed.

Posted by Zucca on Feb. 21 2007,23:14
Let's take this example:
I run DSL straight from CD without loading any custom settings. So now there's no single thing I've messed up.
Then I plug my mp3-player in... It works. Mounting, unmounting... everything.
But when I unplug it and than plug it back dsl reports same errors. I cannot mount it anymore. Only working way I have discovered is to reboot the system.
I belive I'm not the only one who just accpts to reboot his/hers computer just to access mp3player again.

Memory cards read with my card reader work better. I can plug and unplug those many times. At the some point same error occurs.
When I plugged my Nokia E70 in data transfer mode (acts as a USB mass storage device) it didn't worked at all. Well ok. directories to /mnt were created, but nothing more.

Posted by ^thehatsrule^ on Feb. 21 2007,23:21
Quote
Kernel 2.4.27
It's 2.4.26

Did you try the 2.4.31 kernel versions of DSL (2.1b)?

EDIT:
Just read your last post, so I'll add this here:
Quote
But when I unplug it and than plug it back dsl reports same errors. I cannot mount it anymore.
Did you unmount and eject before unplugging?

Posted by WDef on Feb. 22 2007,12:05
Quote
I run DSL straight from CD without loading any custom settings. So now there's no single thing I've messed up.
Then I plug my mp3-player in... It works. Mounting, unmounting... everything.
But when I unplug it and than plug it back dsl reports same errors. I cannot mount it anymore. Only working way I have discovered is to reboot the system.


OK now we have a clear statement of your problem.  That helps.

Does this happen with _any_ usb device, or just certain ones?  Ie  have you tried this with other usb devices?

At present I'm sitting here plugging in my usb thumbdrive: mounting, opening, closing, unmounting, and unplugging, and repeating the cycle, on dsl-2.1b (2.4.31 kernel).  No errors.  (I note parenthetically that dsl-2.1b's mount does not display the "must be root to umount" error of later dsls.)

But your problem is ringing a distant bell in the back of my head ....

Posted by WDef on Feb. 22 2007,12:25
Please try this:

After unmounting and unplugging the device, do as root:

Code Sample
rmmod usb-uhci
modprobe usb-uhci


to unload and reload the usb-uhci module.

Then plug the device back in and try to mount.

Posted by xheavenlyx on Feb. 23 2007,13:04
Ohmy, I am having the same problem and stumbles along this page. I will explain the problem in short n easy way:

1. I have a 256MB USB Pen drive. First time it worked perfectly. Mounting and dissmounting.

2. Screrwd it by installing linux on "sda" thinking it was my hard drive few months back. (First time user ^_^)

3. This week Reformatted with windows XP as FAT32, works well in windows.

4. In DSL Gets detected and displays as 'sda4' 'unmounted' at startup.

Now When I try to mount it I get the error

Code Sample
"Error:     or to many mounts to handle" (there is blank space b4 or)


And yes I have no other mounts at the same time. My hda1 is being mounted perfectly. + I have installed DSL on my harddrive and am also inserting the usb pre-boot so hotplug can detect it.

(Another problem is I cant see the status on fdisk since it gives a error 'cannot access dev/hda1 & cannot access dev/sda4'. That I will look for in other posts.)

Posted by xheavenlyx on Feb. 23 2007,13:16
UPDATE

The error is actually:

Error:    or too many mounted filesystems.

2. Yes sudo fdisk works. sorry about that. Shows a normal Win95 Fat32 file system.

Posted by lucky13 on Feb. 23 2007,13:22
Quote (xheavenlyx @ Feb. 23 2007,08:04)
Ohmy, I am having the same problem and stumbles along this page. I will explain the problem in short n easy way:

1. I have a 256MB USB Pen drive. First time it worked perfectly. Mounting and dissmounting.

2. Screrwd it by installing linux on "sda" thinking it was my hard drive few months back. (First time user ^_^)


Did you install GRUB or LILO? What's in your pen's MBR now?

Quote

3. This week Reformatted with windows XP as FAT32, works well in windows.


Did you do a right-click format device or a command from prompt? If you installed GRUB or LILO when you installed DSL (assuming you were using DSL), did you clear out the MBR before reformatting?

Quote

4. In DSL Gets detected and displays as 'sda4' 'unmounted' at startup.

Now When I try to mount it I get the error

Code Sample
"Error:     or to many mounts to handle" (there is blank space b4 or)



It should be setting a point at sda1. Copy your "fdisk -l /dev/sda" here, please. (That's a lower-case L.)

Quote

And yes I have no other mounts at the same time. My hda1 is being mounted perfectly. + I have installed DSL on my harddrive and am also inserting the usb pre-boot so hotplug can detect it.


Hotplug should also detect it and set a point when you're already booted. Have you tried that as well?

Quote

(Another problem is I cant see the status on fdisk since it gives a error 'cannot access dev/hda1 & cannot access dev/sda4'. That I will look for in other posts.)

Try it without partition numbers: /dev/hda and /dev/sda.

Posted by lucky13 on Feb. 23 2007,13:44
Quote (xheavenlyx @ Feb. 23 2007,08:16)
UPDATE

The error is actually:

Error:    or too many mounted filesystems.

Okay. Open a terminal. The line below will produce a hexdump of your MBR. Do you find GRUB (EDIT: or LILO) anywhere in it? It will be on the right side of the output (assuming you have the terminal wide enough) between the greater/less than signs down rightmost column.

dd bs=512 count=1 if=/dev/sda | od -Ax -tx1z -v

Posted by xheavenlyx on Feb. 23 2007,14:33
UPDATE (with a sorry for not being clear)

1. I have installed DSL on my HARD DRIVE hda2 with lilo, nothing to do with my pendrive. The only thing I do with it is to store my data. Pen's MBR is FAT32 from winXP cmd prompt format (more on this later, gets interesting)

2. I will get the dump later on, since I have no easy way of transferring the output to this PC (with windows to go online).

IMPORTANT OBSERVATION:

I have noticed I get the SAME error with CDrom. BUT different CD's can be easily mounted.

Example- DSL cd mount - no problems. 500MB Mp3 CD mount - Error

---------------------------------
Anyway, thats that and 'lucky13' that was a useful command. Though I could not run this part --->  "(pipe) od -Ax -tx1z -v" (will try other tech and informs soon)

AND if I put in sda4 instead of sda. I can see my PEN drive is FAT16 partitioned (I had redone it from FAT32 to FAT16 this afternoon).

NOW I will try romoving heavy files (mp3) from my USB and try running again. Since thats what happened with the CDrom. Heavy mp3CD did not work!

Posted by Zucca on Feb. 23 2007,16:40
Quote (^thehatsrule^ @ Feb. 21 2007,20:21)
Just read your last post, so I'll add this here:
Quote
But when I unplug it and than plug it back dsl reports same errors. I cannot mount it anymore.
Did you unmount and eject before unplugging?

Eject?
Afaik it's just the same as unmount but with cd/dvd etc it really ejects it physically too.

Anyway. I always unmount before unplugging.

Posted by Zucca on Feb. 23 2007,16:43
Quote (WDef @ Feb. 22 2007,09:05)
Quote
I run DSL straight from CD without loading any custom settings. So now there's no single thing I've messed up.
Then I plug my mp3-player in... It works. Mounting, unmounting... everything.
But when I unplug it and than plug it back dsl reports same errors. I cannot mount it anymore. Only working way I have discovered is to reboot the system.


OK now we have a clear statement of your problem.  That helps.

Does this happen with _any_ usb device, or just certain ones?  Ie  have you tried this with other usb devices?

...

Yes This error eventually happens in all situations. No matter what memcard/stick I use.
Posted by WDef on Feb. 23 2007,22:50
But did you try this as I asked?  You didn't say.

Quote
Please try this:

After unmounting and unplugging the device, do as root:

rmmod usb-uhci
modprobe usb-uhci


to unload and reload the usb-uhci module.

Then plug the device back in and try to mount.


Or for that matter try unloading and reloading all the usb-related modules

given by lsmod | grep usb

Because it's possible that's all your rebooting is doing.  Just a stab.

Posted by Zucca on Feb. 23 2007,23:06
I have to test that on my second computer. I have few mem sticks attached to this (server-like) computer and afaik those commands would stop the connection to those devices.
I'll test it in few days. =)

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.