I have a hardrive on which was stored music files, photos and other data. I was using it in opensuse tumbleweed. the HDD is formatted in EXT4.
I was trying to setup another PC and disconnected this drive and plugged it in to a Windows 10 PC, stupidly, not thinking that windows would not recognize the EXT4 format. Windows added a small partition to the HDD.
When i could not see my HDD files on Windows, I installed openSuse Tumble weed on the windows PC [standalone OS not dual]. Now when I try to mount this drive I get a msg in Yast Partitioner :
ERROR The device /dev/sda contains partitions.
It cannot be edited directly.
To edit /dev/sda, first delete all its partitions.
The size of the HDD is .91 TiB
The size for the windows partition is 15.98 MiB
My questions are: How do I check if my files are still intact on this HDD?
If I delete the small windows partition am I going to endanger all the other files on this HDD?
OR
Is there another way around this? Please advise.
@LaQuirrELL Sounds more like something you need to ask on Windows forum, perhaps it was running bitlocker?
Get another hard drive of the same specs and dd the whole device onto that drive and then work on that device. Less time/power on the affected device, better chance of some recovery…
There are tools for ext support in Windows: There is the Ext2Fsd third-party driver, and some say that WSL can supposedly do that too.
But if Windows added another partition, it might have overwritten part of that existing Ext4 filesystem. In that case, it will be very hard (if not impossible) to restore the old content.
How had you partitioned that disk? Did you create a filesystem directly on /dev/sda without creating any partitions? (Possible, but unusual)
Did you create partitions on it? What partition table type - the newer GPT or the old MS-DOS style partition table?
It is a bit unclear from your story (without any real information from computer statements (like fsblk -f), but when I understand correct, you created the ext4 file system on the device (/dev/sdN) and not on a partition (like /dev/sdN1`). After that a partition table was created at the beginning of the disk, which means that the beginning of the file system is overwritten, including the superblock. I have no idea if anything can be recovered from such a very bad situation. I guess it is quicker to recover from your backup.
In that case, Windows creating a partition most likely destroyed critical parts of that Ext4 filesystem. This is when that backup that you probably don’t have would be crucial for data recovery.
Actually I do have a backup in part, made 6 months ago, so I have not lost it ALL. I will plug the HDD in question in and do the commands as suggested.
Does this mean HDD data is lost?
or
Is it possible to recover some files through a file recovery program? I have used one before. I think it was called test disk.
I guess so about the file system. Maybe forensics done/suggested by someone who knows a lot about ext4 will help.
I have no idea. As I said earlier “a very bad situation”. And I always hope I can fall back to my backups when disaster strikes. But maybe others have more forensic talents then I have.
Asking the Duck for “ext4 data recovery” leads to a couple of win tools and to this page with a thorough explanation (why the chances are not very high):