Score:3

Windows has clobbered my Ubuntu Data Disk

mx flag

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?

David avatar
cn flag
Is there any hope of recovering ... The answer is no.
Nmath avatar
ng flag
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.
PonJar avatar
in flag
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
Nate T avatar
it flag
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.
Score:5
mx flag

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.

sudodus avatar
jp flag
+1+1; Thanks for the warning and the solution :-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.