This question already has an answer here:
SSD - Windows 8.1 initially booting in GPT/EFI. Shrunk partitions using Gparted to create space for Ubuntu Installs. Also created 128MiB bios_grub partition. Installed Ubuntu 16.04 ( In legacy MBR mode with Grub ). All is well for a while both Windows and Ubuntu boot happily. Windows 8 suddenly stops booting but Ubuntu is just fine. When I use Windows USB recovery all is lost. Nothing boots. I know the files are there and can be found using foremost etc but cannot get proper filenames and folder structure is lost.
Boot from LiveUSB to inspect disk. Not all partitions are visible. Only the first 3
/dev/sda1 2048 2050047 2048000 1000M Microsoft basic data /dev/sda2 2050048 2582527 532480 260M Microsoft basic data /dev/sda3 2582528 4630527 2048000 1000M Microsoft basic data
Tried Testdisk with which I have had reasonable success in the past. However Testdisk also is unable to find all my partitions.
Recreated partitions upto sda7 using gdisk. Now fdisk reports only 1 partition.
$ sudo fdisk -l /dev/sda WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 525.1 GB, 525112713216 bytes 255 heads, 63 sectors/track, 63841 cylinders, total 1025610768 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb7687035 Device Boot Start End Blocks Id System /dev/sda1 1 1025610767 512805383+ ee GPT $ sudo gdisk -l /dev/sda GPT fdisk (gdisk) version 0.8.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 1025610768 sectors, 489.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): ------------------- Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1025610734 Partitions will be aligned on 2048-sector boundaries Total free space is 612129757 sectors (291.9 GiB) Number Start (sector) End (sector) Size Code Name 1 2048 2050047 1000.0 MiB 2700 Basic data partition 2 2050048 2582527 260.0 MiB EF00 EFI system partition 3 2582528 4630527 1000.0 MiB EF00 EFI system partition 4 4630528 4892671 128.0 MiB EF02 5 4892672 197482495 91.8 GiB 0700 6 197482496 397481983 95.4 GiB 8300 7 397481984 413482991 7.6 GiB 8200
Original SSD was.
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors 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: --------------------- Device Start End Sectors Size Type /dev/sda1 2048 2050047 2048000 1000M Microsoft basic data /dev/sda2 2050048 2582527 532480 260M Microsoft basic data /dev/sda3 2582528 4630527 2048000 1000M Microsoft basic data /dev/sda4 4630528 4892671 262144 128M BIOS boot /dev/sda5 4892672 197482495 192589824 91.9G Microsoft basic data /dev/sda6 197482496 397481983 199999488 95.4G Linux filesystem /dev/sda7 397481984 413482991 16001008 7.6G Linux swap /dev/sda8 413485056 ????????? ???????? Approx 170G Microsoft basic data /dev/sda8 ????????? 896514047 ???????? Approx 60G Linux filesystem /dev/sda9 896514048 948942847 52428800 25G Microsoft basic data /dev/sda10 948942848 976773119 27830272 13.3G Microsoft basic data Originally sda8 was /dev/sda8 413485056 896514047 483028992 230.3G Microsoft basic data
I would really like "sda11" back and bootable but can manage with the files from sda11. My 2 cents is that I think the MBR partitions are lost because Windows recovery tried to make everything GPT/EFI. Recreating the partitions using gdisk doesn't help but the window NTFS partition should still be mountable. However this complains NTFS signature missing. Likewise for the linux partition sda6.
$ sudo mount /dev/sda5 mnt mount: block device /dev/sda5 is write-protected, mounting read-only NTFS signature is missing. Failed to mount '/dev/sda5': Invalid argument The device '/dev/sda5' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Also is there a way to just mark a partition to be of a certain filesystem without destroying the data.