0

This is Ubuntu 18.10 dual booted with Windows 10. A folder in my external hard disk is not opening. Shows a "lock" sign. And i tried below FSCK commands, it is giving me some direction which I don't understand. Help me to decode/resolve this issue.

pranav@inspiron-5548:~$ sudo umount /dev/sdb
umount: /dev/sdb: not mounted.
pranav@inspiron-5548:~$ sudo fsck /dev/sdb
fsck from util-linux 2.32
e2fsck 1.44.4 (18-Aug-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

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>

Found a gpt partition table in /dev/sdb
pranav@inspiron-5548:~$ sudo fsck -y /dev/sdb
fsck from util-linux 2.32
e2fsck 1.44.4 (18-Aug-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

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>

Found a gpt partition table in /dev/sdb
pranav@inspiron-5548:~$ e2fsck -b 8193 /dev/sdb
e2fsck 1.44.4 (18-Aug-2018)
e2fsck: Permission denied while trying to open /dev/sdb
You must have r/w access to the filesystem or be root
pranav@inspiron-5548:~$ sudo e2fsck -b 8193 /dev/sdb
e2fsck 1.44.4 (18-Aug-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb

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>

Found a gpt partition table in /dev/sdb
pranav@inspiron-5548:~$ sudo e2fsck -b 32768 /dev/sdb
e2fsck 1.44.4 (18-Aug-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb

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>

Found a gpt partition table in /dev/sdb

pranav@inspiron-5548:~$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 465.8 GiB, 500107859968 bytes, 976773164 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2E688F46-2196-5965-EED0-7AF7C385FADA

Device     Start       End   Sectors   Size Type
/dev/sdb1     63 976773119 976773057 465.8G Micros
pranav@inspiron-5548:~$ lsblk -o +LABEL, FSTYPE /dev/sdb
lsblk: unknown column: LABEL,

I selected "Repair File System" from Disk Utitity of Ubuntu. But it does seems to stop. Its been like 20 minutes. What should i do?

Screenshot image

  • I think you added an extra space in the lsblk command, in between +LABEL, and FSTYPE there should be no space. (Or your version of lsblk doesn't support LABEL, which would be strange, it's been around a while, should still be there.) Anyway, try the command again without the space, or even just run lsblk and it should list all drives with it's defaults. – Xen2050 Feb 22 at 2:36
  • Yesterday I tried something on Testdisk and now I can't even open my Harddisk. It says, "Error mounting /dev/sdb1 at media/pranav/528D-CF42: can't read superblock on /dev/sdb1". @Xen2050 Now its more complicated! First, I have to undo the things I did from Testdisk and then only i can try ur commands. SO, help me. – Prabesh Bhattarai Feb 22 at 2:38
  • What did testdisk do? Anyway, if you're trying to mount it only as ext, I'm pretty sure mount will fail. Try mount with no -t type option (or auto), like this (after having a mountpoint directory like /mnt/b ready): mount -v /dev/sdb1 /mnt/b – Xen2050 Feb 22 at 2:44
  • Update: I used Test disk this time but from Windows, and now I can use entire hard disk normally. Harddisk show it consumes 250 GB of space out of 500. But, no files shows up. Nothing. Not even hidden. Still think, we can resolve this with Testdisk. Do u how to use it? @Xen2050 – Prabesh Bhattarai Feb 22 at 7:17
1

Your output contains this a few times:

Found a gpt partition table in /dev/sdb

sdb is the entire drive/device, and it's been partitioned, so the actual partition you want to mount must be sdb1, sdb2, sdb3, etc.

You can use one of these commands to see what partitions there are:

  • fdisk -l /dev/sdb
  • lsblk -o +LABEL,FSTYPE /dev/sdb

Or sometimes it's just nicer to use a GUI like Disks / gnome-disk-utility, to click on the partition you want & click on the "play" button to mount it. But if Disks shows a partition with a padlock sign on it, that means it's encrypted, and the "play" button changes to an "unlocked padlock" so you can decrypt it, if you know the password/phrase.


Update

After seeing some updated info, like the screenshot from Disks, it appears to be a 500GB FAT partition on /dev/sdb1 taking up the whole drive. That explains why mount -t extN was failing. I see no mention of 250GB... unless that's how much space is taken by files?

  • I don't know why Disks' repair filesystem was taking so long, but it doesn't show you the terminal to check, and I haven't had a 500GB FAT filesystem before, it could be trying to read the entire drive or something, and could've taken an hour or two to complete. Running fsck.fat in a terminal would show you what it's doing (especially with the -v verbose flag).

mount (without a -t) should still work, as my comment example mount -v /dev/sdb1 /mnt/b then you could look inside /mnt/b and see what files are there.

If there's really no files then it appears the drive was reformatted (probably by Easeus partition master? FYI the partition type should make no difference to what size files can be written, only the filesystem, and reformatting would definitely erase/lose access to all the old files) so it's not as simple as recovering the old partition info with TestDisk, recovering the whole old ext filesystem may even be impossible. I'm not sure if you could find a backup superblock and use it to "fix" the ext again...

Before doing more writing (attempted fixes) some files might still be on the old disk (as long as Easeus didn't overwrite everything) so recovering a few might be possible with PhotoRec. Here's it's Step-By-Step Guide - your biggest question should be the original filesystem, if it was ext then pick ext, otherwise the only option is "other". If you recover no files with one method, there's nothing to lose by trying the other.

  • I have added more output of commands u mentioned. Maybe now u can help. (Note: sdb is a fully functioning external hard disk. I force cancel something while my hard disk was going through something. Now, some folder has become a "file". But no it doesn't contain any sorts of password or whatsoever. I think its in a raw format. And it can be saved. Probably.) @Xen2050 – Prabesh Bhattarai Feb 21 at 12:41
  • Without more info about what was canceled & what it was doing, and what the folder was & what the file is now, I can't do much more than guess :) – Xen2050 Feb 22 at 2:46
  • :-D Ok I will tell u, I was using Easeus partition master to change partition table from MBR to GTP (or something). (So that i can transfer more than 1 GB of a single file.)But the process was to slow and i can't it. That it. That has corrupted some folder which i can't open now. @Xen2050 And its ur turn. – Prabesh Bhattarai Feb 22 at 2:51
1

If /dev/sdb1 used to be a Linux ext2/3/4 partition, it's not any more. It looks like a "Microsoft Data Partition"... hence fsck is failing to find an ext2/3/4 partition. If it was NTFS, you can't use fsck on it. You'll have to use chkdsk from Windows.

It looks like you dual-boot with Windows 10. Have you recently done some major updates in Windows 10? If so, that may have wiped your /dev/sdb1 partition, esp if /dev/sdb is in MBR partition table format. This is a Microsoft "bug". If this happened, recovery can be done using testdisk. After booting to a Ubuntu Live DVD/USB, install testdisk, and see here for the procedure.

Otherwise, did you install a Windows driver to allow you to read/write to Linux ext2/3/4 partitions. If so, that probably corrupted your partition. Uninstall the driver asap.

Otherwise, did you accidentally format /dev/sdb1?

Update #1:

The user was "...using Easeus partition master to change partition table from MBR to GPT" and cancelled it whilst in process. Bad idea. I hope that you made a backup first. Then they tried to use testdisk to resurrect the partition. More bad idea. The disk is toast, and will require re-init with GPT partition table, then partition it, or reinstall Ubuntu.

  • Yesterday I tried Testdisk and now I can't even open my Harddisk. It says, "Error mounting /dev/sdb1 at media/pranav/528D-CF42: can't read superblock on /dev/sdb1". @heynnema save me from this. – Prabesh Bhattarai Feb 22 at 2:31
  • @PrabeshBhattarai ah... more info that you didn't share before... "I was using Easeus partition master to change partition table from MBR to GPT". Bad news. I hope that you did a backup before you did that. sdb1 is now toast. Re-init it with a GPT partition table, create new partition(s) or reinstall Ubuntu, and call it a lesson learned. Sorry. Please remember to accept my answer if any of it was useful. Thanks! – heynnema Feb 22 at 3:48
  • This is like the 3rd time I am mentioning this. This is an "external Hard disk" like a pen-drive. Nothing is installed on this side. Update: I used Test disk this time but from Windows, and now I use entire the hard disk normally. Harddisk show it consumes 250 GB of space out of 500. But, no files show's up. Nothing. Not even hidden. Still, I think we can resolve this with Testdisk. Do u how to use it? @heynnema – Prabesh Bhattarai Feb 22 at 7:17
  • 1
    @PrabeshBhattarai Why are you saying "This is like the 3rd time I am mentioning this. This is an "external Hard disk" like a pen-drive."? I never said what it was either way. I gave you a link in my answer for instructions on how to use testdisk... cgsecurity.org/wiki/TestDisk_Step_By_Step There's no way anybody can instruct you through it remote control. Was there anything in my Update #1 that wasn't accurate? – heynnema Feb 22 at 8:29
  • @PrabeshBhattarai Please remember to accept my answer if it was helpful. Thanks! – heynnema Feb 22 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.