Hdd question and help

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.

one partition whole size of HDD created. Partition table type GPT.

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.

There’s no evidence of that. Unfortunately, we can’t see what you see … it’s best to show actual output.

Contrary to what was suggested to run “(like fsblk -f )” show the output of this command:

# lsblk -f

We (at least I) want real ouput!

fdisk -l

and

lsblk -f

Sorry, my typo. :angry:

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.

dax@Dax:~> lsblk -f
NAME        FSTYPE FSVER LABEL   UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                  
└─sda1                                                                               
nvme1n1                                                                              
└─nvme1n1p1 ext4   1.0   home    c37cfb7e-6408-4641-8bc0-a0a66c4101ac  138.2G    65% /home
nvme0n1                                                                              
├─nvme0n1p1 vfat   FAT16 bootefi 95A4-A1BC                                44M    55% /boot/efi
├─nvme0n1p2 swap   1     swap    9cfeddf9-5afe-4f39-9f43-fec68457de7d                [SWAP]
└─nvme0n1p3 ext4   1.0   root    b55282b4-613b-4dd8-a4fe-3efa12f44a4f  206.5G     4% /
dax@Dax:~> 

dax@Dax:~> sudo fdisk -l
[sudo] password for root: 
Disk /dev/nvme1n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDS500G2X0C-00L350                      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 38CC3A14-6F4B-42E6-8030-B11D1D3C3D14

Device         Start       End   Sectors   Size Type
/dev/nvme1n1p1  2048 976750591 976748544 465.8G Linux filesystem


Disk /dev/nvme0n1: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 970 EVO 250GB               
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1A27BE6C-D19F-46CE-AF2D-5C69780ED0EE

Device           Start       End   Sectors   Size Type
/dev/nvme0n1p1    2048    204799    202752    99M EFI System
/dev/nvme0n1p2  204800   4399103   4194304     2G Linux swap
/dev/nvme0n1p3 4399104 488378367 483979264 230.8G Linux filesystem


Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10JPLX-00M
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 710B355A-6996-4723-BB52-4CD00FE0805C

Device     Start   End Sectors Size Type
/dev/sda1     34 32767   32734  16M Microsoft reserved

Partition 1 does not start on physical sector boundary.
dax@Dax:~> 

As you can see. Microsoft has maybe the partition table and certainly the first 18MB of the first partition overwritten.

@hcvv thank you for reply.

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.

Hi, install gparted, try and see if it can detect the partition problem.

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):