So, somehow the partition table on my disk went bananas: at the next boot the system would not start, I got repeatedly kicked in the BIOS and I had no viable boot options. The BIOS still detected the disks properly, so I started a LiveDVD to see what's going on.
So, in the disk with the OS, /dev/sdb
, 128GB SSD, there is no partition table. Both gpart and fdisk report it empty. fdisk report the disklabel type to be gpt.
I tried running testdisk, which identifies the partition table type to be Intel (and not EFI GPT). I tried searching for partitions with both types, but only Intel was successful.
So, first question: is Intel partition type a MBR? Why does EFI GPT not work even if the disk label is GPT?
When starting, the tool finds this partition only:
Disk /dev/sdb - 128 GB / 119 GiB - CHS 15566 255 63
Partition Start End Size in sectors
1 P EFI GPT 0 0 2 15566 29 63 250069679
When I run a Quick Search (or even a full search), the tool finds some partitions, and among these there are 5 partitions that make sense:
FAT32 0 32 33 33 69 36 532480 [SYSTEM]
Linux 33 69 37 163 207 44 2097152
Linux Swap 163 240 14 931 97 62 12328960
Linux 931 97 63 9038 187 45 130244608
Linux 9038 187 46 15565 209 4 104857600
Second question is related to the values displayed: there are 3 values in the start column (e.g. 0 32 33) and 3 in the end column (e.g. 33 69 36), how do I interpret these values?
If I look inside these partitions, using the P: list file
command, I can see that
The first partition contains EFI stuff, such as
drwxr-xr-x 0 0 0 31-Jan-2019 19:26 EFI
drwxr-xr-x 0 0 0 13-Mar-2019 18:29 System
-rwxr-xr-x 0 0 0 21-May-2019 10:55 mach_kernel;5ce3af18
-rwxr-xr-x 0 0 34 13-Mar-2019 18:29 mach_kernel
drwxr-xr-x 0 0 0 26-Oct-2018 00:52 8310a92cdfe04b36b5a63736b6419b48
The second partition is the boot partition, contains efi
, grub2
, vmlinuz
s etc.
The fourth partition contains home folders and the last one contains the root.
Since I can see the files, I recovered /etc/fstab
and /etc/lvm/, which indeed show that the system was configured using LVM.
I am not sure if partitions were extended/logical in some way, I don't even know if that makes sense with GPT and it's not limited to MBR.
Third question, given that testdisk can identify some partitions, I could try to restore the partition table using those values, but what about LVM? What about GPT? How can I restore the previous situation, given that these partitions seem to be properly identified?
Thanks a lot!
EDIT: I throw in the question regarding the extended partitions because apparently I have no way to set them all to primary (this make me think it's MBR) and I would need an extended one, but I am unable to create it.
EDIT 2: Here all the partitions found by an in depth search:
Disk /dev/sdb - 128 GB / 119 GiB - CHS 15566 255 63
Partition Start End Size in sectors
>* FAT32 0 32 33 33 69 36 532480 [SYSTEM] *
P Linux 33 69 37 163 207 44 2097152 *
P Linux Swap 163 240 14 931 97 62 12328960 *
D Linux 931 97 63 9038 187 45 130244608 *
D Linux 4873 98 26 12980 188 8 130244608
D Linux 4875 43 33 12982 133 15 130244608
D Linux 9038 187 46 15565 209 4 104857600 *
D FAT12 9695 133 39 9695 198 39 4096
D HPFS - NTFS 15502 117 40 15566 19 5 1021952
The partitions with files are 1st (EFI), 2nd (/boot), 4th (/home), 7th (/). I marked with a *
at the end of the line the apparently legit partitions.
Edit
I ended up copying the drive with dd
, reinstalling the OS and recovering the data by mounting the old partitions in this way.