Score:0

Truncated ext4 partition after trying to access my partition from windows with ext2fs

ru flag

After trying to access my Linux partition from Windows operating system, my Linux partition is now truncated to a size 1K byte and I am no longer able to mount that partition.

"fdisk" shows the size of my partition 244.1G which is correct, while "testdisk" and "lsblk" show 1K byte. My corrupted partition is sdd3.

I tried to fix the issue using the fsck command without any success:

~$ sudo fsck.ext4 -f /dev/sdd3
e2fsck 1.45.5 (07-Jan-2020)
fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdd3
Could this be a zero-length partition?

Here is the output of the "fdisk":

Disk /dev/sdd: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRZ-00Z
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: dos
Disk identifier: 0x00001144

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sdd1             2048 1638402047 1638400000 781.3G  7 HPFS/NTFS/exFAT
/dev/sdd2       1638402048 2150402047  512000000 244.1G  7 HPFS/NTFS/exFAT
/dev/sdd3       2150402048 2662402047  512000000 244.1G 85 Linux extended
/dev/sdd4       2662402048 3907028991 1244626944 593.5G  7 HPFS/NTFS/exFAT

and here is the output of "lsblk":

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   3.7T  0 disk 
└─sda1   8:1    0   3.7T  0 part /media/ali/Drive I
sdd      8:48   0   1.8T  0 disk 
├─sdd1   8:49   0 781.3G  0 part /media/ali/Drive F
├─sdd2   8:50   0 244.1G  0 part /media/ali/BE0AE9C60AE97C31
├─sdd3   8:51   0     1K  0 part 
└─sdd4   8:52   0 593.5G  0 part /media/ali/Drive E

It seems that the data on my partition is intact since I'm able to access all my files using magic recovery. when accessing my partition using magic recovery even all my folders' structures are preserved.

any idea to fix the issue is appreciated.

PonJar avatar
in flag
You need to run fsck -f /dev/sdd3 to check and fix any errors with that partition. Run more than once until clean.
ali129 avatar
ru flag
Hi PonJar. thanks for your comment. As I explained I already run the fsck command. I also posted the output of that command in my question.
PonJar avatar
in flag
Sorry, I seem to have overlooked that part of your question. If fsck cannot fix it I’d be inclined to backup the data somewhere safe, then delete and recreate the partition, then restore the data.
in flag
This is just a guess, but is there a GPT partition table which the kernel might be looking at in preference to the old MBR partition table? fdisk will display and edit the MBR partition table. The gdisk program will display and edit the GPT partition table.
ali129 avatar
ru flag
Hi, my disk is only 2 TB. and because of that, I did not bother with GPT at all. it is partitioned using the MBR.
in flag
So this is fundamentally some kind of partition table corruption. Fdisk is apparently showing the partition, but Linux isn't showing it, at least as displayed by lsblk. This is why I suspected that there might have been a GPT partition table. Looking at the bootup dmesg might give some clues, but this isn't a file system issue but some kind of partitioning issue.
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.