I'm running a Windows 2003 server on Linux/KVM (But should not matter where it runs actually). The HD image has just one partition starting with 63 sectors offset and all works fine.
Now I want to use 2048 sectors offset and I'm able to create an image where the partition is moved to the right place (1985 sectors back, partition table corrected), using dd
and sfdisk
.
But when I try to boot this it just hangs with 100% CPU usage. The last message is Booting from Hard Disk ...
(That means BIOS and MBR code is able to boot "something").
So even the MBR boot code and partition table seems correct it looks like something has to be changed within the windows system partition itself. What is it?
Here is the original partition layout:
$ fdisk -l /dev/vg0/vm07_root
Disk /dev/vg0/vm07_root: 25 GiB, 26843545600 bytes, 52428800 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
Disklabel type: dos
Disk identifier: 0xb11db11d
Device Boot Start End Sectors Size Id Type
/dev/vg0/vm07_root1 * 63 52426814 52426752 25G 7 HPFS/NTFS/exFAT
Here is the new layout (mounting the moved partiton works):
$ fdisk -l /dev/vg0/vmXX_root
Disk /dev/vg0/vmXX_root: 25 GiB, 26843545600 bytes, 52428800 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
Disklabel type: dos
Disk identifier: 0xb11db11d
Device Boot Start End Sectors Size Id Type
/dev/vg0/vmXX_root1 * 2048 52428799 52426752 25G 7 HPFS/NTFS/exFAT
And here the MBR plus (corrected) partition table hexdump of the new one (I'd also tried other MBR code from syslinux
):
$ dd if=/dev/vg0/vmXX_root skip=0 count=1 | hexdump -C
1+0 records in
1+0 records out
512 bytes copied, 1.9217e-05 s, 26.6 MB/s
00000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |3.....|.P.P....||
00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........|
00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........|
00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 07 8b |...It.8,t.......|
00000040 f0 ac 3c 00 74 fc bb 07 00 b4 0e cd 10 eb f2 88 |..<.t...........|
00000050 4e 10 e8 46 00 73 2a fe 46 10 80 7e 04 0b 74 0b |N..F.s*.F..~..t.|
00000060 80 7e 04 0c 74 05 a0 b6 07 75 d2 80 46 02 06 83 |.~..t....u..F...|
00000070 46 08 06 83 56 0a 00 e8 21 00 73 05 a0 b6 07 eb |F...V...!.s.....|
00000080 bc 81 3e fe 7d 55 aa 74 0b 80 7e 10 00 74 c8 a0 |..>.}U.t..~..t..|
00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V|
000000a0 00 b4 08 cd 13 72 23 8a c1 24 3f 98 8a de 8a fc |.....r#..$?.....|
000000b0 43 f7 e3 8b d1 86 d6 b1 06 d2 ee 42 f7 e2 39 56 |C..........B..9V|
000000c0 0a 77 23 72 05 39 46 08 73 1c b8 01 02 bb 00 7c |.w#r.9F.s......||
000000d0 8b 4e 02 8b 56 00 cd 13 73 51 4f 74 4e 32 e4 8a |.N..V...sQOtN2..|
000000e0 56 00 cd 13 eb e4 8a 56 00 60 bb aa 55 b4 41 cd |V......V.`..U.A.|
000000f0 13 72 36 81 fb 55 aa 75 30 f6 c1 01 74 2b 61 60 |.r6..U.u0...t+a`|
00000100 6a 00 6a 00 ff 76 0a ff 76 08 6a 00 68 00 7c 6a |j.j..v..v.j.h.|j|
00000110 01 6a 10 b4 42 8b f4 cd 13 61 61 73 0e 4f 74 0b |.j..B....aas.Ot.|
00000120 32 e4 8a 56 00 cd 13 eb d6 61 f9 c3 55 6e 67 81 |2..V.....a..Ung.|
00000130 6c 74 69 67 65 20 50 61 72 74 69 74 69 6f 6e 73 |ltige Partitions|
00000140 74 61 62 65 6c 6c 65 00 46 65 68 6c 65 72 20 62 |tabelle.Fehler b|
00000150 65 69 6d 20 4c 61 64 65 6e 20 64 65 73 20 42 65 |eim Laden des Be|
00000160 74 72 69 65 62 73 73 79 73 74 65 6d 73 00 42 65 |triebssystems.Be|
00000170 74 72 69 65 62 73 73 79 73 74 65 6d 20 6e 69 63 |triebssystem nic|
00000180 68 74 20 76 6f 72 68 61 6e 64 65 6e 00 00 00 00 |ht vorhanden....|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 2c 48 6e 1d b1 1d b1 00 00 80 20 |.....,Hn....... |
000001c0 21 00 07 8a 0b bf 00 08 00 00 00 f8 1f 03 00 00 |!...............|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|