LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to make a corrupted USB stick work? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-make-a-corrupted-usb-stick-work-159662/)

sundancebt 03-18-2004 11:33 PM

How to make a corrupted USB stick work?
 
I have a USB memory stick that was mounting/unmounting just fine under
RH 9.0, which suddenly went corrupt. It wouldn't mount under Linux, and
when I plugged it into a windows XP box it said the stick wasn't formatted.

So I reformatted it under windows, as a FAT32 filesystem, which I believe
is the same as vfat, and now it works okay under windows, but still won't
mount under Linux. I tried it on a several different machines, with the same
result, so it's definitely a problem with the USB stick.

I'd like to try reformatting the stick under Linux instead of windows, but
considering that it won't mount at the moment, is there any way I can achieve
this?

Can anyone else think of anything I could try (other than taking the USB stick
back to the shop and complaining) ?

Cheers,
Sundance

synapse 03-19-2004 12:42 AM

Hi

What commands are you using to mount the stick or program.

cheers
heave you tried

mount -t msdos /dev/sda1 /mnt/usb as root

cheers

beejayzed 03-19-2004 04:50 AM

What does it say when you try and mount it.

sundancebt 03-20-2004 07:01 PM

G'day again,

I originally set it up to work with the line
/dev/sda1 /mnt/usbstick vfat user,noauto.umask=0 0 0
in my /etc/fstab file, and mounting it with the command;
mount /mnt/usbstick
(which worked even when I wasn't root).
As suggested above I tried using the
mount -t msdos /dev/sda1 /dev/usbstick
command as root, but it didn't work :-(

Using either command I'm getting the error message
mount: wrong fs type, bad option, bad superblock on /dev/sda1
or too many mounted filesystems

Thanks for any help,

beejayzed 03-20-2004 07:22 PM

try mount -t auto /dev/sda1 /dev/usbstick

sundancebt 03-22-2004 10:00 PM

Hi there,

beejayzed, I tried setting the filesystem type to auto and it complained about an I/O error and said I had to specify the fs type manually.
With any other option (eg vfat) it complains about `wrong option, too many mounted filesystems' etc.

The command `mount /mnt/usbstick' is working fine with other usb sticks,
so I know there's not a software/command problem. The real issue is whether I can forcibly create a valid Linux filesystem on this particular USB stick, or whether I just have to take it back to the shop and complain.

Thanks again for any help,
Sundance

beejayzed 03-23-2004 03:05 AM

Post your /etc/fstab file, I'll see if I can see anything out of order. Else just take it back to teh shop and complain.

sundancebt 03-23-2004 10:37 PM

Hi there again,

here's the /etc/fstab in all its glory

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults,noauto 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sda1 /mnt/usbstick vfat user,noauto,umask=0 0 0
/dev/hda2 /osshare vfat umask=000 0 0
/dev/hda5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom2 /mnt/cdrom2 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom3 /mnt/cdrom3 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom4 /mnt/cdrom4 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom5 /mnt/cdrom5 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom6 /mnt/cdrom6 udf,iso9660 noauto,owner,kudzu,ro 0 0

Does this mean that linux can't find a device and format it, if it can't mount an unformatted device? It must be possible because windows can do it. I'd hate to think there's something
useful that windows can do and linux (or at least RH) can't.

Thanks for the help,
Sundance

chii-chan 03-23-2004 10:45 PM

CAn you post the messsage from "tail -f /var/log/messages" when you plug in the usb drive?

sundancebt 03-23-2004 11:19 PM

Hi there,

# tail -f /var/log/messages
Mar 24 15:45:19 cssm-96 kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Mar 24 15:45:19 cssm-96 kernel: Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 1
Mar 24 15:45:20 cssm-96 kernel: SCSI device sda: 123904 512-byte hdwr sectors (63 MB)
Mar 24 15:45:20 cssm-96 kernel: sda: Write Protect is off
Mar 24 15:45:20 cssm-96 kernel: sda: sda1 sda2 sda3 sda4
Mar 24 15:45:20 cssm-96 kernel: SCSI device sdb: 2880 512-byte hdwr sectors (1 MB)
Mar 24 15:45:20 cssm-96 kernel: sdb: Write Protect is off
Mar 24 15:45:20 cssm-96 kernel: sdb: sdb1 sdb2 sdb3 sdb4
Mar 24 15:45:23 cssm-96 /etc/hotplug/usb.agent: ... no modules for USB product 8
ec/812/100

Cheers,
Sundance

beejayzed 03-24-2004 03:45 AM

I dunno, maybe someone else has some suggestions. I'm more comfortable in Mandrake coz I've neve used Redhat. From the messages file, it seems as if it hins thare's a missing module or something.
Could you post your /etc/mtab file to see if has anything about it.

chii-chan 03-25-2004 12:10 AM

I would try 'mount -t vfat /dev/sda4 /mnt/usbstick'. Also try sda2 and sda3.

Why there was sdb? Did you mount some other usb drive at the same time?

sundancebt 03-25-2004 04:37 AM

Okay, the /etc/mtab file looks like this;

/dev/hda6 / ext3 rw 0 0
none /proc proc rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
none /dev/shm tmpfs rw 0 0
/dev/hda2 /osshare vfat rw,umask=000 0 0

As for trying /dev/sda2. sda3, sda4, I'm still just getting the usual error message. As for the sdb, the USB stick I have is an ASUS model which was pre-formatted into a 63Mb sector and a 1.44Mb sector. I'd say the 64Mb sector is sda, and the 1.44Mb sector is sdb.

All the best,
Sundance

beejayzed 03-25-2004 04:49 PM

Does anyone here know how to detect devices in order to see their /dev/device entry.
sundancebt,
Maybe the third entry has something to do with it. Try unmounting that device with the umount command and see what happens.

sundancebt 03-25-2004 06:38 PM

Hi beejayzed,

it looks like the answer is "nothing much" when I unmount usbdevfs,
although I'm not entirely sure what I should be looking for.

Cheers,
Sundance


All times are GMT -5. The time now is 12:33 AM.