3

My first nvme disk allows dual booting of Ubuntu 20.04 and Windows 10 and that is functioning fine. My second disk is a 1TB SSD drive and is normally a single 1TB partition (I am pretty sure it was ext4) and it is about 66% full of data and has no need for booting. Ubuntu now reports the second disk as having just one 16MB partition with the remainder of the disk being free space. The 16MB partition is now of Type “Microsoft Reserved” and it spans from sector 34 to sector 32734.

It seems that when I booted into Windows 10 yesterday and ran Window’s Disk Manager that I have inadvertently clobbered the linux partition table even though I was cautious of not writing to disk.

Is there any hope of recovering the ext4 partition now that I appear to have overwritten sectors 34 to 32734?

  • Is there any hope of recovering ... The answer is no. – David Aug 29 '21 at 08:01
  • 2
    Under normal circumstances you cannot access data when the partition or file system has been deleted or overwritten. There are advanced data recovery tools like testdisk and photorec but they may or may not find any files. Anything you do to the disk at this point decreases the chance you can recover any data so the best thing to do is make a bit-for-bit copy of the drive before doing anything else. If you are a novice user and the data is important, you should take it to a data recovery specialist. We all make mistakes and hard drives fail so backups are essential. – Nmath Aug 29 '21 at 08:15
  • 1
    There is hope of recovery. Check out this link. It’s about resizing a partition. https://askubuntu.com/questions/24027/how-can-i-resize-an-ext-root-partition-at-runtime The first steps blow away the partition which is where you are. Then you recreate the partition table. I’ve done this and it works. Assuming your data is still there (deleting a partition doesn’t immediately wipe it) you have a chance of recovery. You might want to copy the entire disk before you start and then remove the Microsoft partition – PonJar Aug 29 '21 at 08:33
  • Apt has a few notable disk restoration packages. Chances are slim if the data has been overwritten, but its worth a try. After following Nmath's advice, and PonJar's advice, try running apt search restoration. For next time, this is an advantage of uefi. – Nate T Aug 29 '21 at 10:29

1 Answers1

5

I managed to recover all my data after applying e2fsck and referencing the fourth superblock. This created a device dev/sda which I was able to mount directly and lift all the data off the disk. There was no reference to dev/sda1 partition in this instance. Rebooting the computer causes the disk to revert back to the 16MB windows reserved partition and empty space. I’ll be zeroing out the front end of this disk before re-instituting my ext4 partition and keeping well clear of Windows Disk Manager from here on. It seems to be a very arrogant and draconian practice that Microsoft has adopted where it attempts to destroy something that it does not recognize.