I recently reformatted my NVMe Windows C drive to EXT4 for Kubuntu without making a proper backup, and now I need to recover some of the old data that was there before the reformatting. The Linux installation only took up about 35 GB of the 300 GB available space, so I suspect there might still be some recoverable data on it. I can access the drive from both Windows and Linux, but I'm not sure what steps to take to recover my files. Any help would be greatly appreciated!
3 Answers
Thanks for the tips! I'll definitely look into `testdisk` and `photorec`. Fingers crossed there’s something salvageable!
You could try using `testdisk` for recovery, but keep in mind that it might not have much luck since you've written new data on the disk. The outcome really depends on how the partitions were set up initially. If `testdisk` can't retrieve your data, the next step is to use `photorec`, which is part of the same package. It can recover certain file types (not just photos), but keep in mind it won't restore filenames and some recovered files might be corrupted. Sadly, this is about the best you can hope for unless you resort to paid recovery services, which might not be significantly better.
But remember, since you've only installed 35 GB of Linux, that doesn't necessarily mean that all your old data is intact. It totally depends on how the data was stored.
Just a head's up, EXT4 and NTFS organize files totally differently. EXT4 tends to space files across the partition more randomly, while NTFS tends to keep files packed together, usually starting from the front of the partition. So, even if you think only 35 GB is used, that might not mean any previous data is safe at all. Good luck with the recovery!

It's also wise to stop using this drive as your active system disk. You should switch to a live USB or another external disk until you sort out the recovery process. Alternatively, you could create a complete image backup using `dd` to try recovering your files from there.