1

Windows restore messed up my boot and rendered one of my partitions seemingly "unallocated". So I'm trying to fix it with testdisk. This is the result of the testdisk Analysis:

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org

Disk /dev/sda - 320 GB / 298 GiB - CHS 38913 255 63
     Partition               Start        End    Size in sectors
 D HPFS - NTFS              0  32 33  1697  43 10   27262976
 D HPFS - NTFS           1697  43 11  1709 233 60     204800
 D HPFS - NTFS           1709 233 61 20677  87 18  304711680
>D Linux                20677  87 19 38784  99 35  290889728
 D Linux Swap           38784  99 36 38913  70  5    2070528

The partitions are correct (except I find it strange that they're not cylinder-aligned). But the Linux and Linux Swap partitions should be in an extended partition, which testdisk doesn't seem have caught. So I try to add it with "A" and change its type to "extended LBA", which seems to be what I need judging by the Internet. However, this type (I understand it's usually 0f) is missing from my list:

List of partition type
01 FAT12                50 OnTrack DM RO        a9 NetBSD
02 XENIX root           51 OnTrack DM RW-NOVEL  ab Darwin boot
03 XENIX /usr           52 CP/M-Microport V/386 af HFS
04 FAT16 <32M           53 OnTrack DM WO ???    b7 BSDI
06 FAT16 >32M           54 OnTrack DM DDO       b8 BSDI swap
07 HPFS - NTFS          55 EZ-Drive             bc Acronis
09 AIX data             56 GoldenBow VFeature   be Solaris boot
0a OS/2 Boot Manager    61 SpeedStor            bf Solaris
0b FAT32                63 Unixware, HURD, SCO  c1 secured FAT12
0c FAT32 LBA            64 NetWare 286          c4 secured FAT16
0e FAT16 LBA            65 NetWare 3.11+        c6 sec. Huge-bad FAT16
10 OPUS                 67 Novell               c7 Syrinx Boot-bad NTFS
11 hid. FAT12           68 Novell               d8 CP/M-86
12 Compaq Diagnostics   69 Novell               db CP/M
14 hid. FAT16 <32M      70 DiskSecure MB        de Dell Utility
16 hid. FAT16 >32M      75 PC/IX                e1 SpeedStor FAT12 ext
17 hid. HPFS/NTFS       80 Minix v1.1-1.4a      e3 DOS RO
18 AST swap             81 Minix / old Linux    e4 SpeedStor FAT16 ext
19 Willowtech Photon    82 Linux Swap           eb BeFS
1b hid. FAT32           83 Linux                ee EFI GPT
1c hid. FAT32 LBA       86 NT FAT16 V/S set     ef EFI (FAT-12/16/32)
1e hid. FAT16 LBA       87 HPFS FT mirror-V/S set f0 Linux/PA-RISC boot
20 Willowsoft OFS1      8e Linux LVM            f1 Storage Dimensions
24 NEC MS-DOS 3.x       93 Amoeba               f2 DOS secondary
27 Windows RE(store)    94 Amoeba bad block     f4 SpeedStor
38 Theos                a0 NoteBIOS save2disk   fb VMFS
3c PMagic recovery      a5 FreeBSD              fd Linux RAID
40 VENIX 80286          a6 OpenBSD              fe LANstep
41 PPC PReP Boot        a8 Darwin UFS           ff Xenix bad block
42 W2K Dynamic/SFS

How can I create the extended partition?

2
  • Which Windows version? How exactly did you do the Windows backup and restore? Why did you need to restore?
    – harrymc
    Commented Aug 18, 2016 at 6:50
  • @harrymc, Windows 7 Starter by booting the recovery partition from grub. Why? The machine was given to me in used condition, and I wanted to start fresh. I hardly see how this is relevant, but do enlighten me.
    – dainichi
    Commented Aug 19, 2016 at 5:31

1 Answer 1

1
+50

This is my take on the problem, based on your answer to my comment :

  1. If you have not changed partition positions & sizes during the restore, then the partitions were originally not aligned on cylinder boundaries. In any case, cylinders are only a fiction that the drive uses when communicating with Windows, so are of not much importance.

  2. Windows Restore surely destroyed the Grub boot.

  3. The fact that a partition type changed during the Restore means that the Restore did destroy at least one partition.

Since Windows is in good shape, I think that you should reinstall Linux which will also restore Grub. This will setup the partition table much safer than with testdisk. If necessary, delete and recreate the Linux partitions, but this might not be necessary.

3
  • Thanks, so I won't worry about the cylinders. I can boot Linux fine too by marking the Linux partition as a primary partition, but then my swap partition is dead space. I'm not sure if you're saying that Windows restore messed up the partitions in some way that testdisk can't fix. As far as I can see, all the partitions are fine, the only problem is that testdisk can't mark the last 2 partitions as being logical partitions in an extended partition.
    – dainichi
    Commented Aug 21, 2016 at 20:09
  • testdisk might not be up to the task and there are many other partition editors. However, it's clear that some damage was caused to a partition that Windows was not supposed to touch. Windows may have allocated a hidden partition at the end of the disk and so destroyed the Linux swap, so you could with a bit of chance recreate the swap, and only it, and so avoid reinstallation of Linux.
    – harrymc
    Commented Aug 22, 2016 at 8:26
  • Thanks. I appreciate your help a lot, although it didn't completely satisfy my curiosity. I ended up booting the Linux partition without swap, saving my files, then reformatting the last 2 partitions (Linux and swap) and reinstalling Xubuntu on them.
    – dainichi
    Commented Aug 23, 2016 at 23:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .