unable to mount a usb flash drive and an SD card after changing mount directory name
I'm not sure exactly what I did, but after messing with some directory names I'm unable to mount both a usb drive and an SD card. When I try to mount them I get this error:
* wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error * I tried mounting them in Windows and it said the drive needs to be formatted. I didn't mess with the partition table or try to format these devices. I think what I did was change the name of the directory it was mounted to while it was mounted, then I started having this problem. One more thing: when I run *lsblk -f* I notice that these devices no longer have UUIDs. All the other devices have UUIDs listed but the field is blank on these devices. I have some data on these drives I don't want to loose so I'd appreciate any help getting these devices to mount without having to re-format. |
You haven't told us which file system was in use, but since you mentioned windows, are we to assume vfat or ntfs?
How is it reported by the following? Code:
fdisk -l Before attempting any further possible corruption during any data recovery exercise, it is a good idea to back the devicde up completely using 'dd' to low-level (bit-by-bit) copy eg Code:
dd if=/dev/sdb1 of=backup.img |
Quote:
Code:
jan@oxygen ~/Data/Dox/2015$ cat /etc/fstab if you insert a usb stick that is formatted in ext4 in a windows machine, windows will reformat the disk to help you. |
Thanks for the reply. Yes I believe it was formatted ntfs. Here's the output from fdisk -l:
Device Boot Start End Sectors Size Id Type /dev/sdb1 63 15240575 15240513 7.3G 83 Linux I'll be sure to back up the drive before trying anything. |
Quote:
Quote:
Did you or do you actually have an entry for sdb1 in /etc/fstab? If you do or did, you would not need to mount it as it should mount on boot. Your fdisk output for that partition shows it as a Linux filesystem. |
I looked at my fstab file and it doesn't have an entry for sdb1. But when I plug in another usb drive it shows as sdb1 and it mounts without issues. Do I need to add a line to fstab?
I may have mispoke when I said it was ntfs. Maybe I re-formatted it to ext4 awhile ago and forgot. I was trying to mount it from terminal, using the mount command. |
No, you don't need an en entry in /etc/fstab. Typically, removable media with a valid system are handled by udev and UDisks2. The fact that a bad super block is reported suggests an ext3/ext4 file system. You could execute following (eg assuming ext3) to get a bit more info about
Code:
sudo fsck.ext3 -v /dev/sdb1 Code:
sudo fsck-v /dev/sb1 Code:
sudo mke2fs -n /dev/sb1 Hopefully, it should be possible to use a superblock copy to repair using something like Code:
sudo e2fsck -b super_block_copy_location /dev/sdb1 |
If you're certain it was ext4, then check status with
Code:
sudo fsck.ext4 -v /dev/sdb1 |
If you can't recover the file system, all hope is not lost. You can work with the device or backup you created to try to recover the files using a utility like foremost.
Read this excellent data recovery guide https://help.ubuntu.com/community/DataRecovery This might help too http://www.levlafayette.com/node/20 |
ext2fs_open2: Bad magic number in super-block
fsck.ext3: Superblock invalid, trying backup blocks... fsck.ext3: Bad magic number in super-block while trying to open /dev/sdb1 Ran *sudo fsck.ext3 -v /dev/sdb1*, here's the output: *************************************************************************************** The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device> ******************************************************************************** When I ran *sudo mke2fs -n /dev/sb1* to find superblock copies, I got this: "The file /dev/sb1 does not exist and no size was specified." |
Sorry, that was a typo. It should have been
Code:
sudo mke2fs -n /dev/sdb1 |
Haha, I didn't catch the typo, just copied and pasted. It worked this time, here's the output:
Creating filesystem with 1905064 4k blocks and 476720 inodes Filesystem UUID: 5a3dd860-724f-45a2-8ebc-351b25f9321c Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 |
Okay, now try the following to use the backup superblock
Code:
sudo e2fsck -b 98304 /dev/sdb1 Code:
sudo mkdir -p /mnt/data Code:
sudo mount -o sb=98304 /dev/sdb1 /mnt/data |
Neither of those worked. For the first command I get:
***************************************************************************** e2fsck: Bad magic number in super-block while trying to open /dev/sdb1 The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device> ****************************************************************************** For the second one I get: ******************************************************************************** mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. ******************************************************************************** I tried each command with a a few different blocks from those listed in the output from *sudo mke2fs -n /dev/sdb1*, none of them worked. I'm looking over the data recover tutorial you linked to. I'll try some of those methods. |
Review the data recovery suggestions in post #9
|
All times are GMT -5. The time now is 04:06 PM. |