3

EDIT3
This might be quite the hopeless case, so I posted another method that is simpler, but still need some help with.
https://superuser.com/questions/706244/will-this-work-backup-partition-contents-of-both-linux-and-windows

I've recently resized a partition (/sda2 to make another partition, /sda1) on a disk where Windows 8 and KDE Linux Mint are installed on. A whole lot of things went wrong.

First, the computer wouldn't boot past BIOS and gave me grub rescue. With a Live Linux USB I used the boot-repair app to reinstall grub (on /sda). Thankfully linux booted from the new grub2 menu, but windows would crash when trying to load. When looking into it more on linux I found that apps like KDE Partition Manager and GParted both couldn't read the partition on my /sda disk.

KDE Partition Manager gives me "No valid partition was found on this device". GParted gives me the whole thing is unallocated, and "unable to satisfy all constraints on the partiton".

I then installed another app, FixParts. That gave me the following:

Warning: 0xEE partition doesn't start on sector 1. This can cause problems
in some OSes.

and

Disk size is 250069680 sectors (119.2 GiB)
MBR disk identifier: 0x0FB1A4FB
MBR partitions:

                                                   Can Be   Can Be
Number  Boot  Start Sector   End Sector   Status   Logical  Primary   Code
   1                    63       192779   primary     Y        Y      0x07
   2      *         208839    134062424   logical     Y        Y      0x07
   5             134066176    234067967   logical     Y        Y      0x83
   6             234067968    250068991   primary              Y      0x82

fdisk -l gave me this:

Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 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: 0x0fb1a4fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63      192779       96358+   7  HPFS/NTFS/exFAT
/dev/sda2   *      208839   134062424    66926793    7  HPFS/NTFS/exFAT
/dev/sda3       134066175   250068991    58001408+   f  W95 Ext'd (LBA)
/dev/sda5       134066176   234067967    50000896   83  Linux
/dev/sda6       234067968   250068991     8000512   82  Linux swap / Solaris

where sda1 is just an empty NTFS partition, sda2 contains my Windows 8, sda5 is Linux /(root). /home is on another disk.

I want to keep my data. And I want my Windows 8 and Linux to be on the same disk because it's an SSD. If possible I would also like both Grub and Windows boot files to be on the same disk, but that's a different issue.

EDIT
First I thought the problem was "0xEE partition doesn't start on sector 1", but now I'm not so sure. My other disks (i got 3) give the same error, but the partition apps can read them. However, I remember seeing the boot-repair app reinstalling grub2 on every disk, so maybe that's related. Also, now I see that Windows 8 partition (/dev/sda2) is logical??? Windows cannot boot from logical, so it couldn't have been before. How can I even change that without loosing the data on it?

EDIT2
Really detailed info from boot-repair app: http://paste.ubuntu.com/6805345/

1 Answer 1

6

My goodness, this is just a mess.

Here are just some of the problems that stand out:

"0xEE partition doesn't start on sector 1"

You don't have a type 0xEE partition on those discs, now. If, as this message indicates, you did have it, then at one point your discs were partitioned with a very different partition table mechanism, which your "repairs" seem to have destroyed completely. In such circumstances it's possible that what you see now is the result of a "hybrid" partition table scheme (parallel MBR and EFI partition tables describing, as far as possible, the same partitions) having been repaired to within an inch of its life. Or quite possibly one inch further.

This is one possibility for why Windows 8 won't boot. Microsoft wrongly assumes that installing to a disc partitioned with the MBR partition table implies not booting the EFI way, and the converse as well. If you've "repaired" your partitioning so radically that you've managed to convert the partition table scheme from EFI to MBR, you've probably confused the Hell out of Windows.

Of course, a type 0xEE MBR partition table entry that didn't start at block #1 was a sign of corruption in the first place, so what happened may well not have been this. Another likely explanation is that the 0xEE partition table entry was a ghost. This is supported by the fact that there's no sign that Windows is bootstrapping, or has ever bootstrapped, in the EFI way on your machine.

I remember seeing the boot-repair app reinstalling grub2 on every disk.

This, combined with "repairing" a type 0xEE protective MBR record into complete nonexistence, will have wiped any EFI partition table. This presuming that it really was EFI-partitioned in the first place, of course.

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img.

You have grub installed in its usual MBR virus mode, with its core.img right where the EFI partition table would be.

now I see that Windows 8 partition (/dev/sda2) is logical???

Not in the output from fdisk, you don't. There's nothing there that indicates that. And the fact that it has been allocated minor device number 2 is a strong indication that it is a primary partition. Secondary partitions get numbers starting from 5.

Of course, FixParts could be (and no doubt is) telling the truth. In which case your MBR partition table has no active primary partition at all, Windows 8 truly is in a logical volume in an extended partition, and no wonder things won't boot. VBR bootstrap programs don't play well in secondary partitions, unless a Boot Manager fixes their BPBs up on the fly, and I'm fairly sure that Grub doesn't do that. You'll need to undo the conversion from primary partition to secondary partition here. Your Windows 8 volume definitely should be a primary partition.

/dev/sda1: LABEL="SYSTEM RESERVED" UUID="01CF186FCBFB6340" TYPE="ntfs"
...
/dev/sda2    *        208,839   134,062,424   133,853,586   7 NTFS / exFAT / HPFS

Your first primary partition is apparently your (Poor Man's) system volume. But your second primary partition (or first seconeary partition, depending from whether one believes fdisk or FixParts) is the one marked as active. This will also confuse Windows. For starters, it won't recognize your first primary partition as "system", because it has no active flag.

Also (on the presumption that fdisk is right), as you are booting the old PC/AT firmware way (rather than the EFI way) your bootstrap will be loading the wrong VBR from the wrong volume, if that's truly meant to be the System Reserved volume. If FixParts is right, your bootstrap will be loading the wrong VBR from the wrong volume, and with the wrong BPB values as well.

Which brings me onto:

=================== hexdump -n512 -C /dev/sda1
00000000  eb 52 90 4e 54 46 53 20  20 20 20 00 02 08 00 00  |.R.NTFS    .....|
...
000001a0  0d 0a 4e 54 4c 44 52 20  69 73 20 6d 69 73 73 69  |..NTLDR is missi|
000001b0  6e 67 00 0d 0a 4e 54 4c  44 52 20 69 73 20 63 6f  |ng...NTLDR is co|
000001c0  6d 70 72 65 73 73 65 64  00 0d 0a 50 72 65 73 73  |mpressed...Press|

Your Poor Man's system volume has the old Windows NT 5.x VBR bootstrap program on it.

=================== hexdump -n512 -C /dev/sda2
00000000  eb 52 90 4e 54 46 53 20  20 20 20 00 02 08 00 00  |.R.NTFS    .....|
....
000001a0  63 75 72 72 65 64 00 0d  0a 42 4f 4f 54 4d 47 52  |curred...BOOTMGR|
000001b0  20 69 73 20 63 6f 6d 70  72 65 73 73 65 64 00 0d  | is compressed..|
000001c0  0a 50 72 65 73 73 20 43  74 72 6c 2b 41 6c 74 2b  |.Press Ctrl+Alt+|

You've got the Windows NT 6.x VBR bootstrap on your second primary partition. This would make it a combined "boot" and "system" volume, because of the active flag.

sda1: __________________________________________________________________________

    Boot sector type:  Windows 2000/XP: NTFS
    Boot files:        

sda2: __________________________________________________________________________

    Boot sector type:  Windows 8/2012: NTFS
    Boot files:        /bootmgr /Windows/System32/winload.exe

But Microsoft's Boot Manager isn't properly there. The BCD store is completely missing. The VBR bootstrap program in your second primary partition can find Microsoft's Boot Manager. But Microsoft's Boot Manager has no BCD store in the system volume.

sdc1: __________________________________________________________________________

    Boot sector type:  Windows 8/2012: NTFS
    Boot files:        /bootmgr /Boot/BCD /NTLDR /ntdetect.com

In contrast: On your third disc, your first primary partition is marked active, and is thus the Poor Man's system volume. Microsoft's Boot Manager and the BCD store are both there, and a Windows NT 6.x VBR bootstrap program is there. This is I suspect what your first disc should look like. But it doesn't.

I suggest:

  • Fix the problem of sda2 being a secondary partition.
  • Mark sda1 as active.
  • sda1 is now your Poor Man's "system" volume once more, as it apparently used to be.
  • Put a Windows NT 6.2 VBR bootstrap program on sda1.
  • Put Microsoft's Boot Manager on sda1.
  • Create a BCD store on sda1.
  • Add a BCD entry for booting off sda2, the Windows 8 "boot" volume.
  • sda1 will now at least bootstrap in the PC/AT way.
  • To make that happen, either:
    • Do away with grub in MBR virus mode, and reinstall a conventional MBR bootstrap program on sda.
    • Add the missing entries to grub, since it currently has no mention of hd0,msdos0 or hd0,msdos1 at all.

The rest is up to you.

4
  • Holy... I know something was very wrong, but not that much all at once. Thanks so very much for replying and all the time you spent in writing all of it. My computer is working again. I went from WinXP having only the /sdc disk --> Win 7 and adding the /sdb disk --> Win8 and adding the /sda SSD. Recently I installed Linux too. Then I tried to put all boot-related data and both Win8 & Linux OS on /sda, and remove win7 altogether. I guess I've done alot to mess things up. Btw, the SYSTEM RESERVED partition on /sda was just an empty partition created by me, which is where things went wrong.
    – Djalaal
    Jan 25, 2014 at 10:32
  • Wow. That's an answer. +1
    – Binoy Babu
    Jan 29, 2014 at 7:28
  • Wonderful. Some time ago I had a problem with my bootmgr (Windows system partition) being on a wrong HD. I solved it with bootmgr command without issues copying it to the active partition of my BIOS booting HD, so there was no jumping between disks.
    – Alex
    Oct 5, 2014 at 22:24
  • That moves me to a question: If I was booting from a SSD but the bootmgr was in another HD, was the VBR of the SSD pointing to a different disk? Is that possible? Otherwise makes no sense for me.
    – Alex
    Oct 5, 2014 at 22:28

You must log in to answer this question.

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