LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mount: wrong fs type, bad option, bad superblock on /dev/sda1 (https://www.linuxquestions.org/questions/linux-hardware-18/mount-wrong-fs-type-bad-option-bad-superblock-on-dev-sda1-566231/)

yekim 07-03-2007 04:10 AM

mount: wrong fs type, bad option, bad superblock on /dev/sda1
 
I'm trying to mount a possibly corrupted memory chip from a camera so that I can save some vacation photos. I put the chip into a USB multi-card reader/writer and am getting the following error when I try to mount it:

mount -t vfat /dev/sda /mnt/sda

mount: wrong fs type, bad option, bad superblock on /dev/sda

I found a couple of other postings with similar problems. It was recommended to run fdisk on it. So I did and fdisk spits back this:

The number of cylinders for this disk is set to 4294.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

If I print the partition table I get this:

Command (m for help): p

Disk /dev/sda: 2044 MB, 2044723200 bytes
31 heads, 30 sectors/track, 4294 cylinders
Units = cylinders of 930 * 512 = 476160 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 4295 1996676+ 6 FAT16

Command (m for help):

If I go to the expert menu and print the partition table I get this:

Expert command (m for help): p

Disk /dev/sda: 31 heads, 30 sectors, 4294 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 3 59 0 30 30 990 247 3993353 06
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00

Expert command (m for help):

If I verify the partition table on the expert menu I get this:

Expert command (m for help): v
246 unallocated sectors

Expert command (m for help):

Is there a way I can mount this chip cleanly in order to rescue data from it?

Thanks,
Mike

P.S. Subject line of this message says /dev/sda1. It's a typo...should say /dev/sda.

rupertwh 07-03-2007 04:19 AM

Quote:

Originally Posted by yekim
P.S. Subject line of this message says /dev/sda1. It's a typo...should say /dev/sda.

Actually, your subject is correct. /dev/sda1 is the partition you want to mount. Not /dev/sda which is the whole disk.

farslayer 07-03-2007 08:00 AM

Yeah shouldn't the mount command be: mount /dev/sda1 /mnt/sda you seem to be trying to mount the device rather than the partition on the device.. It should detect the file system automatically, I don't usually specify the filesystem when mounting a USB drive, or SD card..

yekim 07-03-2007 09:44 AM

mount: wrong fs type, bad option, bad superblock on /dev/sda1
 
Quote:

Originally Posted by rupertwh
Actually, your subject is correct. /dev/sda1 is the partition you want to mount. Not /dev/sda which is the whole disk.

Actually, I have tried mount -t vfat /dev/sda1 /dev/sda1 and
mount -t vfat /dev/sda /dev/sda1 and I get the same results - the error message in the subject line.

farslayer 07-03-2007 10:06 PM

what does fdisk -l /dev/sda show as the output ?

and when you said
Quote:

mount -t vfat /dev/sda1 /dev/sda1
did you actually mean
mount -t vfat /dev/sda1 /mnt/sda1 ?


and the directories
/mnt/sda
/mnt/sda1

do exist right ?

yekim 07-04-2007 11:34 AM

Quote:

Originally Posted by farslayer
what does fdisk -l /dev/sda show as the output ?

and when you said

did you actually mean
mount -t vfat /dev/sda1 /mnt/sda1 ?


and the directories
/mnt/sda
/mnt/sda1

do exist right ?

Farslayer:

Yes, sorry about the typo.

I meant "mount -t vfat /dev/sda1 /mnt/sda1" and yes, I created the directory in /dev before attempting to mount.

Mike

michaelk 07-04-2007 01:13 PM

Quote:

I meant "mount -t vfat /dev/sda1 /mnt/sda1" and yes, I created the directory in /dev before attempting to mount
Must be another typo. You probably meant that you created the directory in /mnt not /dev. I assume that what you mean by possibly corrupted is that the memory card will not work in the camera.

fdisk creates partitions but will not repair a filesystem. If it is indeed corrupted then you can try to repair using the command dosfsck. Check the man pages for additional information.
dosfsck -v /dev/sda1

I've never attempted to repair a DOS filesystem using dosfsck and do not know how well it works. You might want to make a copy of the partition first just in case.
dd if=/dev/sda1 of=/somewhere/camera.img

yekim 07-05-2007 12:10 AM

Quote:

Originally Posted by michaelk
Must be another typo. You probably meant that you created the directory in /mnt not /dev. I assume that what you mean by possibly corrupted is that the memory card will not work in the camera.

fdisk creates partitions but will not repair a filesystem. If it is indeed corrupted then you can try to repair using the command dosfsck. Check the man pages for additional information.
dosfsck -v /dev/sda1

I've never attempted to repair a DOS filesystem using dosfsck and do not know how well it works. You might want to make a copy of the partition first just in case.
dd if=/dev/sda1 of=/somewhere/camera.img

Michaelk

Yes, another typo. I did mean /mnt rather than /dev.

I did copy the data from the chip to a camera.img file in my home filesystem using your command. I will read the manpage for dosfsck and see what I can do to repair the filesystem. Thanks! This is what I wanted to do in the first place - save the data from the chip and try and repair things. Can I use dosfsck on the camera.img file I created or do I need to use it on the chip?

michaelk 07-05-2007 06:26 AM

Use it on the chip

yekim 07-05-2007 09:46 AM

Quote:

Originally Posted by michaelk
Use it on the chip

Thanks Michaelk!

I did use it on the chip and here's what happened:

root@1[~]# dosfsck -v /dev/sda1
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Currently, only 1 or 2 FATs are supported, not 255.

root@1[~]#

I made sure that the lock switch on the chip was off so it was writable. Attempting to mount the chip produces the same error message I got before.

I'm not sure how to decode the resulting dosfsck message.

Mike

michaelk 07-05-2007 11:28 AM

Looks like the filesystem is corrupted. Either the filesystem has been corrupted or the chip has failed. As the error message stated here should only be two File Allocation Tables not 255 so basically dosfsck did not know what to do.

Might want to try using a windows recovery program to see if it can rebuild the FAT.


All times are GMT -5. The time now is 10:31 PM.