boot - Partition problems after resizing
2014-04
EDIT3
This might be quite the hopeless case, so I posted another method that is simpler, but still need some help with.
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/
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
orhd0,msdos1
at all.
- Do away with grub in MBR virus mode, and reinstall a conventional MBR bootstrap program on
The rest is up to you.
I have a dualboot computer with Windows Vista (on hd0) and Ubuntu 9.10. The bootloader is GRUB and the windows bootloader lets me decide between Vista and Ubuntu-Installation (broken WuBi). But now (i don't know why that changed) I can't use start the windows-bootloader anymore. The error message is "no such device: AE1440441440122F" I tried "ls" on the grub-prompt and it gave me a list like:
(hd0) (hd1) (hd1,0) (hd1,1) (hd1,2) ... (fd0)
It recognizes all partitions of hd1 (the ubuntu-harddisk) but not of hd0(the win-disk). .. WHY?
Here is the result of the "boot info script" for the technical details:
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 2 is installed in the MBR of /dev/sda and looks for
(UUID=a7c510e3-2399-437b-ab92-fa609e48d63f)/boot/grub.
=> No boot loader is installed in the MBR of /dev/sdb
sda1: _________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows Vista
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe
/wubildr.mbr /wubildr
sda2: _________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:
sdb1: _________________________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
Mounting failed:
mount: unknown filesystem type ''
sdb2: _________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:
sdb3: _________________________________________________________________________
File system: Bios Boot Partition
Boot sector type: -
Boot sector info:
sdb4: _________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
sdb5: _________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
=========================== Drive/Partition Info: =============================
Drive: sda ___________________ _____________________________________________________
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x52554d66
Partition Boot Start End Size Id System
/dev/sda1 * 2,048 307,202,047 307,200,000 7 HPFS/NTFS
/dev/sda2 307,202,048 1,250,258,943 943,056,896 7 HPFS/NTFS
Drive: sdb ___________________ _____________________________________________________
Disk /dev/sdb: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000
Partition Boot Start End Size Id System
/dev/sdb1 1 1,250,263,727 1,250,263,727 ee GPT
GUID Partition Table detected.
Partition Start End Size System
/dev/sdb1 34 262,177 262,144 Microsoft Windows
/dev/sdb2 262,178 1,131,253,933 1,130,991,756 Linux or Data
/dev/sdb3 1,131,253,934 1,131,255,887 1,954 Bios Boot Partition
/dev/sdb4 1,131,255,888 1,245,312,528 114,056,641 Linux or Data
/dev/sdb5 1,245,312,529 1,250,263,694 4,951,166 Linux Swap
blkid -c /dev/null: ____________________________________________________________
Device UUID TYPE LABEL
/dev/sda1 AE1440441440122F ntfs
/dev/sda2 3AE66E4DE66E0A09 ntfs data
/dev/sdb2 5419D16119DAA4DE ntfs LaufwerkD
/dev/sdb4 a7c510e3-2399-437b-ab92-fa609e48d63f ext4
/dev/sdb5 60a0143a-e01b-450a-bbd1-f22059e47b65 swap
============================ "mount | grep ^/dev output: ===========================
Device Mount_Point Type Options
/dev/sdb4 / ext4 (rw,errors=remount-ro)
/dev/sr0 /media/cdrom0 iso9660 (ro,nosuid,nodev,utf8,user=daniel)
/dev/sda1 /media/AE1440441440122F fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
=========================== sdb4/boot/grub/grub.cfg: ===========================
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set a7c510e3-2399-437b-ab92-fa609e48d63f
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set a7c510e3-2399-437b-ab92-fa609e48d63f
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=a7c510e3-2399-437b-ab92-fa609e48d63f ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set a7c510e3-2399-437b-ab92-fa609e48d63f
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=a7c510e3-2399-437b-ab92-fa609e48d63f ro single
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set a7c510e3-2399-437b-ab92-fa609e48d63f
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=a7c510e3-2399-437b-ab92-fa609e48d63f ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,4)
search --no-floppy --fs-uuid --set a7c510e3-2399-437b-ab92-fa609e48d63f
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=a7c510e3-2399-437b-ab92-fa609e48d63f ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ae1440441440122f
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
=============================== sdb4/etc/fstab: ===============================
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sdb4 during installation
UUID=a7c510e3-2399-437b-ab92-fa609e48d63f / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb5 during installation
UUID=60a0143a-e01b-450a-bbd1-f22059e47b65 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
=================== sdb4: Location of files loaded by Grub: ===================
583.8GB: boot/grub/core.img
583.8GB: boot/grub/grub.cfg
579.7GB: boot/initrd.img-2.6.31-14-generic
580.0GB: boot/initrd.img-2.6.31-20-generic
579.7GB: boot/vmlinuz-2.6.31-14-generic
579.8GB: boot/vmlinuz-2.6.31-20-generic
580.0GB: initrd.img
579.7GB: initrd.img.old
579.8GB: vmlinuz
579.7GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================
Unknown BootLoader on sdb1
00000000 54 34 dc 3b 8b ff 6c fa 3e 59 3d 24 25 af 5f 9b |T4.;..l.>Y=$%._.|
00000010 72 f8 36 3d 56 30 22 fd c6 08 5e 39 7f dc 29 48 |r.6=V0"...^9..)H|
00000020 48 e5 24 52 77 b0 fc 64 b6 ce 48 c3 07 ce b5 81 |H.$Rw..d..H.....|
00000030 06 68 60 4f 6e fb 83 92 df 3a 54 b9 df 21 2a cd |.h`On....:T..!*.|
00000040 1e 2f e2 49 fe cf 81 2d 52 17 1a 4e 66 b4 f3 f0 |./.I...-R..Nf...|
00000050 41 25 e3 96 26 28 fe 19 61 72 75 f8 40 a3 b7 ef |A%..&(..aru.@...|
00000060 5f 79 dc cb 28 44 44 7c 9b 9a 7b 6c 4b 4b 60 0f |_y..(DD|..{lKK`.|
00000070 a9 97 87 bc 85 9f db bb d2 1a 88 9f aa 49 18 d5 |.............I..|
00000080 92 2d db 7e fe f7 8d 7a 18 c0 33 c5 bd 7a 46 07 |.-.~...z..3..zF.|
00000090 c8 27 13 66 94 49 62 9f bc 99 56 55 25 fb 94 a9 |.'.f.Ib...VU%...|
000000a0 3f b2 a7 0a 87 d0 a4 4e 51 f1 09 02 c4 29 eb ff |?......NQ....)..|
000000b0 26 3b 51 3e 5a 0c db ee a6 57 a7 c3 ba a1 74 90 |&;Q>Z....W....t.|
000000c0 ee 70 08 18 cc b8 d0 22 ce 96 c7 cb 68 40 98 20 |.p....."....h@. |
000000d0 49 3d 07 ec df d1 8d cf 19 bc 42 90 70 24 01 b4 |I=........B.p$..|
000000e0 28 cf c6 50 d3 95 5a 1b 18 15 33 c7 b2 a8 95 92 |(..P..Z...3.....|
000000f0 bb 93 fe 18 2b 81 c1 6b 9c 30 f1 65 50 6a 80 3d |....+..k.0.ePj.=|
00000100 74 37 a8 59 a6 51 8a 63 b6 d8 16 9f a9 47 2a 7c |t7.Y.Q.c.....G*||
00000110 04 a7 fe 69 47 02 bf e9 b7 1b 7a ea 60 5c 3c 53 |...iG.....z.`\<S|
00000120 5b 10 78 dc 4d d2 a8 22 30 45 37 fb 56 06 9f 06 |[.x.M.."0E7.V...|
00000130 aa df cf 87 3a 3e cf 72 f2 e5 a6 c6 aa e2 7c 1c |....:>.r......|.|
00000140 64 c2 fc 80 ce 02 fc 7f 0f c6 60 81 bf cd 3b 5a |d.........`...;Z|
00000150 37 a5 38 1b 0c 1b 39 2e d6 f6 3d a2 36 e5 87 c3 |7.8...9...=.6...|
00000160 17 b5 fd ee 33 c7 ce a3 d9 c2 57 dc ee 85 48 9d |....3.....W...H.|
00000170 33 60 02 cd c5 83 44 44 ea b6 07 25 0a 4b a6 6e |3`....DD...%.K.n|
00000180 fc 51 42 cd 84 0b 65 b6 19 a1 e5 b2 eb 14 0c fa |.QB...e.........|
00000190 24 77 f5 44 6e 5d 39 dd b6 8e cc f8 30 fe 21 46 |$w.Dn]9.....0.!F|
000001a0 9c ff 95 c6 c7 b5 0a df 54 ca d2 ac bc 64 d0 97 |........T....d..|
000001b0 94 54 d9 29 0f 91 60 20 c3 e4 53 c2 b0 e4 40 72 |.T.)..` ..S...@r|
000001c0 7e 25 bc 81 06 ad 05 46 14 a7 e6 71 6b 5c db 9c |~%.....F...qk\..|
000001d0 0a 5e 76 23 ae 06 01 36 98 21 65 2c 90 e7 4b 1a |.^v#...6.!e,..K.|
000001e0 2a 2d 80 a5 48 db 9e 14 e0 9f e9 aa 00 e3 77 32 |*-..H.........w2|
000001f0 0f fd 94 db 55 a6 64 46 be ae ca de da ee 89 68 |....U.dF.......h|
00000200
=======Devices which don't seem to have a corresponding hard drive==============
sdc sdd sde
Did you ever solve this? I see the question was asked 2 years ago, but anyway...
You need the line insmod part_msdos
somewhere in the grub.cfg file. I couldn't find it in the log you posted.
I just had a similar problem using a hdd that has a GUID Partition Table instead of an MBR; then you need the line insmod part_gpt