External Hard Disk - Partition damaged after power failure

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Message
Author
tops
Posts: 18
Joined: 29 May 2023, 01:33

External Hard Disk - Partition damaged after power failure

#1 Post by tops »

Hello All, I need some help...

I have an external HD formatted in ext4, which, after a power failure caused by the local provider, lost several folders and files...

I ran testdisk and after some time scanning, it found some information, but when I tried to access it, it was not possible...

Finally, it suggested the test below, but I am not able to run it correctly.

Code: Select all

Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sdc - 3000 GB / 2794 GiB - CHS 357698 64 32

     Partition                  Start        End    Size in sectors

  Linux                    0   8  1 357698  35 21  732566389
superblock 0, blocksize=4096 []
superblock 32768, blocksize=4096 []
superblock 98304, blocksize=4096 []
superblock 163840, blocksize=4096 []
superblock 229376, blocksize=4096 []
superblock 294912, blocksize=4096 []
superblock 819200, blocksize=4096 []
superblock 884736, blocksize=4096 []
superblock 1605632, blocksize=4096 []
superblock 2654208, blocksize=4096 []

To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
Could you help me with this?

I believe it is possible to recover something or even everything from this hard disk...

I have Windows machines and my laptop also has Linux Mint installed, so for ext4 partitions, I believe it is the best option to use at this time, do you agree?

Thanks...
recuperation
Posts: 3036
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: External Hard Disk - Partition damaged after power failure

#2 Post by recuperation »

tops wrote: 06 Jul 2025, 14:31 Hello All, I need some help...

I have an external HD formatted in ext4, which, after a power failure caused by the local provider, lost several folders and files...

I ran testdisk and after some time scanning, it found some information, but when I tried to access it, it was not possible...
What did you find? What do you mean bei "accessing"? Using which means? TestDisk? Any explorer-type shell? What was not possible?
My crystal ball was stolen and I don't have the money to buy a new one...

Finally, it suggested the test below, but I am not able to run it correctly.
Where is your documentation of what you did and how your computer responded?

Code: Select all

Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sdc - 3000 GB / 2794 GiB - CHS 357698 64 32

     Partition                  Start        End    Size in sectors

  Linux                    0   8  1 357698  35 21  732566389
superblock 0, blocksize=4096 []
superblock 32768, blocksize=4096 []
superblock 98304, blocksize=4096 []
superblock 163840, blocksize=4096 []
superblock 229376, blocksize=4096 []
superblock 294912, blocksize=4096 []
superblock 819200, blocksize=4096 []
superblock 884736, blocksize=4096 []
superblock 1605632, blocksize=4096 []
superblock 2654208, blocksize=4096 []

To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
Could you help me with this?

I believe it is possible to recover something or even everything from this hard disk...

I have Windows machines and my laptop also has Linux Mint installed, so for ext4 partitions, I believe it is the best option to use at this time, do you agree?

Thanks...
fsck.ext4 is the equivalent for chkdsk under Windows but fsck.ext4 will only check ext4-filesystems.
Only systems providing that command can run this command. These are typically Linux systems. I don't know if some "windows subsystem für linux" provides it. So, run this command on a linux machine but do not forget to duplicate the defective disk using ddrescue as described in the manual.

As for "Could you help me with this?", be more specific.
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#3 Post by tops »

Hello...

I started by analyzing the possibly damaged disk.
I looked for folders or files that could be recovered in the disk structure.
At the end of the analysis, I received the posted recommendation and when I searched the internet for how to run the disk, I came across this message>
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 0 -B 4096 /dev/sdb
[sudo] senha para rodrigo:
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb
/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
recuperation
Posts: 3036
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: External Hard Disk - Partition damaged after power failure

#4 Post by recuperation »

You should use an alternate superblock.
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#5 Post by tops »

recuperation wrote: 06 Jul 2025, 17:11 You should use an alternate superblock.
Yes, that's exactly what I'm doing right now, running them one by one until the end...

When I get to the end of all the superblocks, do you recommend that I restart my computer or issue another command?
It will still take a while to finish checking all the superblocks...


Thanks
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#6 Post by tops »

Now, the filesystem was repaired using alternates superblock as we can see below>

Code: Select all

rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 0 -B 4096 /dev/sdb1
/dev/sdb1: clean, 16/183148544 files, 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 32768 -B 4096 /dev/sdb1
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 98304 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 163840 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 229376 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
^[[6~/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 294912 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 819200 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 884736 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 1605632 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ sudo fsck.ext4 -p -b 2654208 -B 4096 /dev/sdb1
[sudo] senha para rodrigo:          
/dev/sdb1 was not cleanly unmounted, check forced.
/dev/sdb1: Padding at end of inode bitmap is not set. FIXED.
/dev/sdb1: 16/183148544 files (0.0% non-contiguous), 11784420/732566389 blocks
rodrigo@SonyVaio-VGN-NW270F:~$ 
I'm restarting my PC and be with crossfingers :)
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#7 Post by tops »

Nothing... :oops: :cry:

Only 1 folder is showed, nothing more...

I will analyze the entire hard disk again, with the difference of changing the USB cable, but this cable is fine, I have already used it with other hard disks.

Very SAD!!!
recuperation
Posts: 3036
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: External Hard Disk - Partition damaged after power failure

#8 Post by recuperation »

tops wrote: 06 Jul 2025, 22:49
recuperation wrote: 06 Jul 2025, 17:11 You should use an alternate superblock.
Yes, that's exactly what I'm doing right now, running them one by one until the end...
The repeated superblocks should be identical. Having run one repair command linux will assumably require disconnecting and reconnecting the external disk. Running one command after another without trying by disconnecting and reconnecting is not sufficient to check whether the last superblock used is healing anything.

When I get to the end of all the superblocks, do you recommend that I restart my computer or issue another command?
It will still take a while to finish checking all the superblocks...
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#9 Post by tops »

recuperation wrote: 07 Jul 2025, 11:10
tops wrote: 06 Jul 2025, 22:49
recuperation wrote: 06 Jul 2025, 17:11 You should use an alternate superblock.
Yes, that's exactly what I'm doing right now, running them one by one until the end...
The repeated superblocks should be identical. Having run one repair command linux will assumably require disconnecting and reconnecting the external disk. Running one command after another without trying by disconnecting and reconnecting is not sufficient to check whether the last superblock used is healing anything.

Right! I´ll try and report here...

Thanks again,,,
tops
Posts: 18
Joined: 29 May 2023, 01:33

Re: External Hard Disk - Partition damaged after power failure

#10 Post by tops »

Hello...
I did a new scan on my hard disk and found this information...
From here, what should I do?
I ran the commands shown above, but I was unsuccessful.
TestDisk 7.2, Data Recovery Utility, February 2024




TestDisk 7.2, Data Recovery Utility, February 2024
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org

Disk /dev/sdb - 3000 GB / 2794 GiB - CHS 357698 64 32
Partition Start End Size in sectors
D HPFS - NTFS 0 1 32 357698 19 20 732566069
>D Linux 0 8 1 357698 39 32 732566528
D FAT16 LBA 174041 9 32 174072 23 32 63937
D HFS 182841 1 1 182873 1 1 65536
D Linux 280855 40 1 293533 23 32 25964032
D Linux 282517 40 1 295195 23 32 25964032
D Linux 286638 56 1 299316 39 32 25964032
D Linux 287751 0 1 300428 47 32 25964032
D Linux 287763 56 1 300441 39 32 25964032
D Linux 287764 40 1 300442 23 32 25964032
D Linux 287777 16 1 300454 63 32 25964032
D Linux 287778 0 1 300455 47 32 25964032
D Linux 287778 24 1 300456 7 32 25964032
D Linux 287778 32 1 300456 15 32 25964032
D Linux 287778 48 1 300456 31 32 25964032
D Linux 287778 56 1 300456 39 32 25964032
D Linux 287780 56 1 300458 39 32 25964032
D Linux 287781 32 1 300459 15 32 25964032
D Linux 287795 32 1 300473 15 32 25964032
D HPFS - NTFS 290163 40 1 294246 56 1 8362496
D HPFS - NTFS 291419 24 1 295502 40 1 8362496
D Linux 292128 40 1 304806 23 32 25964032
D Linux Swap 292529 0 1 292650 55 32 249600
D HPFS - NTFS 293026 48 1 293039 16 1 25600
D HPFS - NTFS 293033 32 1 293045 63 32 25600
D HPFS - NTFS 293034 24 1 293134 23 32 204800
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
ext4 blocksize=4096 Large_file Sparse_SB, 3000 GB / 2794 GiB
If I press ENTER on any of the information, nothing is displayed.
Locked