I've messed up my dual 750GB dual boot (Windows 8.1-preinstalled & Ubuntu 14.04) HDD. I am trying to restore my partition table without formatting as I want to try and recover some files with a Windows search. I only have a partial Deja-dup backup and this photo of the fdisk and lsblk output of the partition table taken shortly after I started having problems. I'm using a Ubuntu Live USB on the 4GB (3.5GB) drive. The 114GB drive is a USB I'm using for downloading & storage to limit writing on the HDD.
screen.jpg
I tried Testdisk and saved some files but when restoring the partition table I get a mess of 20 1.5-22MB partitions and one 600+MB. Gparted is graphical and, as far as I know, will not allow me to numerically set the partition start and end--hence sfdisk,
If I write a file identical to an sfdisk (old version) dump named "created_dump.txt" using the info from my fdisk photo, I can use
Code:
sfdisk --force /dev/sdX < created_dump.txt
to make a new partition table identical to the fdisk output photo without formatting.
As you will see, sfdisk does not have "end" and "sectors" columns so using the columns from fdisk and the formula below I have calculated the sizes. When I do, my total is -1 from the fdisk results in the photo so I have added the "+".
End-Start=Sectors
Sectors*bytes (512)=bytes
bytes/1024=kilobytes
kilobytes/1024= megabytes
megabytes/1024=gigabytes
created_dump.txt
Code:
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 4194304+, Id= 7 Recovery
/dev/sda2 : start= 821248, size= 3145728+, Id= 7 ESP
/dev/sda3 : start= 1697792, size= 469203156992+, Id= 7 Gateway
/dev/sda4 : start= 918110208, size= 253961913586+, Id= 83
/dev/sda5 : start= 1450706944, size= 3443351269+, Id= 82
/dev/sda6 : start= 1457928184, size= 15+, Id= 82
My questions:
Does everything in the created_dump.txt look correct? fdisk says that sda4 is Microsoft basic data which would be NTFS Id=82 but lsblk says sda4 is ext4 which would be Id=83. Which one is it and how would I know?
I would appreciate any help. I need step-by-step detailed instructions. If there is a better way to accomplish what I'm trying to do please let me know, I am open to whatever works.
Bookmarks