2

I have an external HDD that appears to be broken. Cannot be opened in Windows nor in Ubuntu (it is a NTFS file system). On Windows I have run (two times now) the command chkdsk. There it identifies certain memory segments which are unreadable. I thought that it would 'flag' these, and avoid them while trying to read in the HDD. But after I ran that program, Windows was still unable to open it. So either I am wrong, or my disk is beyond repair.

Assuming that I am wrong, I turned to Ubuntu to see if gparted or fsck could be of any help. The 'check' function in gparted gave me an error... and not much additional information.

First checking where the partition is, running lsblk gives

sdb      8:16   0 298,1G  0 disk 
└─sdb1   8:17   0 298,1G  0 part 

Moving on to fsck, I ran the following command

root@...# fsck /dev/sdb1 -y
fsck from util-linux 2.31.1

Nothing more. So that was quite strange. Therefore I tried the whole disk and not one partition. This gave

root@...# fsck /dev/sdb -y
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-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 dos partition table in /dev/sdb

Thus the stated error is

fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

Since I am sure (thanks to gparted) that I am dealing with an ntfs file system, and not ext[0-9].. I think that the proposed solution (running ef2fsck is not applicable to me.

I don't know how to continue from here. I believe if certain memory segments can be avoided to read in.. I think I can retrieve some data from it. But I don't know how to do this.

heynnema
  • 70,711
zwep
  • 165
  • Can't judge if it is a duplicate.. but extra information is definitely convenient! Thanks – zwep Aug 23 '19 at 14:03
  • @karel ntfsfix should not be used to fix this problem. – heynnema Aug 23 '19 at 14:17
  • It would be instructive to see if the SMART data shows us anything. In Ubuntu, start the Disks app. Select the disk. Then select to show the SMART Data window. Screenshot the ENTIRE window (requires scrolling, and two screenshots) and edit that into your question. You can also run the SMART Tests. Report back. Start comments to me with @heynnema or I may miss them. – heynnema Aug 23 '19 at 14:26
  • @heynnema thanks for the advice. I am currently out of time. Will try it tomorrow and let you know – zwep Aug 23 '19 at 14:48
  • I have problem with NTFS disk which used by Windows (but Windows not installed there). After run Windows and do full restart problem is gone – CodeBy Jul 08 '22 at 14:05

2 Answers2

4

fsck and gparted apps cannot be used to fix a problem with a ntfs partition. ntfsfix should not be used to try and fix this problem.

Windows tools should normally be used. However, chkdsk is not helping here.

You might try using testdisk from the Ubuntu OS.

sudo apt-get update # update the software databases

sudo apt-get install testdisk # install testdisk

sudo testdisk # start testdisk

Go to http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step for help in using this tool.

heynnema
  • 70,711
  • 2
    thanks for pointing this out again. Using the advanced section, I was able to copy my most valued files already. This tool really saved the day – zwep Aug 24 '19 at 15:24
  • @zwep Great news! You might still post the SMART Data for me to look at, so I can tell you if there's a hardware failure pending. – heynnema Aug 24 '19 at 16:07
  • After my vacation.. I tried it again, but now my hdd really is dead. Can't make any contact, even lsblk or Disks on Ubuntu won't recognize it.. – zwep Sep 11 '19 at 05:47
  • @zwep check if your BIOS sees the drive. Also try gparted. – heynnema Sep 11 '19 at 22:48
  • testdisk solved also my problem with bad magic number on suberblock! – bogec May 30 '23 at 15:36
1

Get another disk.

For your first try, clone the disk using ntfsclone.

After that most likely fails, instead get some read only access to the bad device one of these ways:

  • mount [-t ntfs] -o ro (if it thinks it's ext or mentions things other than ntfs, use -t)
  • ntfsls, ntfscp, ntfsrecover (part of ntfs-3g)
  • testdisk
  • photorec (this tool only finds file formats it recognizes... it's not a full recover)

And then just clone the entire disk to the new one.

And I think the output about fsck talking about ext might mean that it actually thinks you have ext. Maybe it has an ext superblock on it. This can be the source of your problem... maybe the ntfs is actually healthy, but linux is confused. Or maybe some linux was confused enough to mount it as ext and write to it, destroying the NTFS. Be careful about that in the future... use wipefs or zero the device (eg. with dd) before formatting next time. Don't trust formatting tools to do that... they will miss things they aren't aware of; wipefs misses less because it specializes in that; and dd misses nothing as long as you point it at the right range of sectors (I always zero first and last 100MB).

Peter
  • 437