can't boot cloned XP - fixmbr/fixboot don't work

Discussions about using Windows guests in VirtualBox.
Post Reply
mageus
Posts: 2
Joined: 16. Nov 2008, 20:02

can't boot cloned XP - fixmbr/fixboot don't work

Post by mageus »

I have a 10GB .vdi with a 3GB WXP partition. I used Drive Image to clone the partition to another 3GB .vdi. However, the new drive won't boot, gives a no disk found error (typical of bootloader issues).

- the new partition is viewable by linux/wxp boot disks and is not corrupt
- boot.ini is setup correctly; ntloader
- gparted thinks the partition tables are fine
- I've used fixmbr/fixboot multiple times to no avail.

Interesting thing, everytime I run fixmbr it says the partition table is screwed up (despite having already run fixmbr).

Tried this with clonezilla with the same problem.

Basically it sounds like the bootloader's not getting installed properly, or the boot sectors are screwed up.

Any ideas?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Post by vbox4me2 »

Why not use the clonevdi command from the cli tool?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I assume that you remembered to activate the new partition. Forgetting to do this has burnt me this way in the past.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You can also do a clean install of XP, then restore the image. The MBR will be written by the installer and after the restore image, you have the setup you want.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
ekeis98
Posts: 13
Joined: 12. Jul 2007, 00:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, other Linux
Location: Germany

Post by ekeis98 »

I stuck in the same problem as mageus and I hope for some help here.

I have a WXPP 3GB partition, runs fine, but too small. So I made a new harddisk (20GB, dynamic growing) via the virtual disk manager and cloned the WXPP_3GB into the new disk with KNOPPIX 5.3 dd_rescue tool. Normally this works fine - with real harddisks.

But in VirtualBox it won't work, I don't know for what reason.

Before VBox gets into boot phase it says 'A disk read error occured. Press CTRL+ALT-DEL to restart' the standard message when the bootsector is destroyed or the harddisk is not accessible.

What I did:
- fixmbr
- fixboot
- save old bootsector with KNOPPIX dd and write it to the new vdisk
- reinstall windows in repair mode
- using testdisk under KNOPPIX to repair harddisk
- did the cloning alternatively with dd and writing the bootsector from old to new
- etc, etc

It must be something inside VBox.
Maybe this behaviour is because of a wrong disk geometry? Ist it possible to edit it (like I can in vmware entering the virtual BIOS)?
Mybe the 20GB-vdisk is too big?
Has someone experienced the same behaviour?

I need help.

Thanks in advance.
Regards,
Oliver
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

A lot of this is discussed in my tutorial All about VDIs.

Your process is incorrect. You can dd count=1 bs=512 from the old disk to the new. This will copy the boot sector. However, the partition information will be incorrect in that you will have a single partition of 3Gb. You need to use fdisk to delete this and replace it with a 6Gb partition say. The NTFS copy tool will copy the 3Gb NTFS partition from the old disk to the new partition.

You now have a 3Gb filesystem in a 6Gb partition. Another of the NTFS utilities will grow the 3Gb filesystem to fill the full 6Gb partition. You then need to remember to activate the partition because the NT MBR bootstrap boots from the first active partition it finds.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ekeis98
Posts: 13
Joined: 12. Jul 2007, 00:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, other Linux
Location: Germany

Post by ekeis98 »

Hi Terry,

thanks for dealing with my problem. I've read your tutorial before and I found other hints in addition. So the essence was the process below.

Well, my process is exactly as follows:
01. create a new 20GB VDI file and asign it to my VBOX as primary slave; the original WinXP is assigned as primary master
02. boot Knoppix-5.3-live-CD; start terminal; become superuser with su
03. dd if=/dev/hda bs=512 count=1 of=/XPmbr
04. dd if=/dev/hda of=/dev/hdb
05. dd if=/XPmbr of=/dev/hdb
06. close Knoppix-5.3-live-CD
07. boot original WinXP, console and execute "chkdsk D: /F" (D: should be the copy)
08. reboot WinXP twice (recommended by gparted)
09. detach the small original VDI file and make the copy primary master
10. boot Knoppix-5.3-live-CD again
11. resize /dev/hda1 with gparted

Result: 'A disk read error occured. Press CTRL+ALT-DEL to restart'

By the way, booting the copy machine between step 9 and 10 brings up the disk error already.
Using 'FIXBOOT' from the WinXP media only turns my German 'disk error' message into English :-(

So in my understanding: the correct 3GB-partition table is copied with the dd-command. So I have a bit-by-bit copy of the original with step 4 and the copy has the appropiate partition table. The bootsector was copied with step 3 and 5. I've controlled the bootable flag beeing set with cfdisk. So I can't see my mistake. :(

Help/explanations appreciated - thanks.
Regards,
Oliver
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Oliver, I can't see any specific errors in your process. Sorry.

However, since step (4) copies the entire content of the 3Gb VDI, including the partition table to hd1, it should now contain a valid partition table with the first partition activated, albeit only 3Gb long. Steps (3) and (5) are therefore redundant. To check that this process is "integral" you can now drop hd0 and move hd1 to hd0. You should now be able to boot from hd0 successfully. Can you do this? If so you have now verified that you have the 3Gb NTFS partition followed by 7Gb unallocated.

You should schedule a boot time chkdsk and reboot the XP to check the integrity of the NTFS before you try doing any resize operations

You should now be able to resize the partition by following http://gparted.sourceforge.net/larry/re ... sizing.htm.

Another resource that you could try is the GParted Forum
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ekeis98
Posts: 13
Joined: 12. Jul 2007, 00:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, other Linux
Location: Germany

Post by ekeis98 »

Hi Terry,

thanks for your reply. In fact my 'lite' process to create a copy VDI was:

01. create a new 20GB VDI file and asign it to my VBOX as primary slave; the original WinXP is assigned as primary master
02. boot Knoppix-5.3-live-CD; start terminal; become superuser with su
03. dd_rescue /dev/hda /dev/hdb
04. close Knoppix-5.3-live-CD
05. boot original WinXP, console and execute "chkdsk D: /F" (D: should be the copy)

I've tried it with ntfsclone also. The result is always the same. Just now I've tried it with a 5GB-VDI file with dd_rescue - the result is the same again. However, these procedures always work with real harddisks. I'm still wondering...

I was running testdisk on Knoppix-LIVE-CD. It gave me a two warnings:
- Incorrect number of heads/cylinder 128 (NTFS) != 16 (HD)
- Bad ending head (CHS and LBA don't match

Is this a hint?
Regards,
Oliver
ekeis98
Posts: 13
Joined: 12. Jul 2007, 00:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, other Linux
Location: Germany

Post by ekeis98 »

Terry, I hate to say, but cloning my harddisk with Acronis-9.0-Boot-CD worked out fine.

I've started my VBox with
- the small VDI (3GB) with WinXP (the small original) as primary master
- the big VDI (20GB), empty (the big copy) as primary slave
- Acronis9.iso as a bootable CD image

Cloning the small original to the big copy didn't cause any problems at all. After the cloning process has finished, I detached the small original from the machine, attached the big copy as primary master and the system started with no problem.

Ok, my problem is solved. But the last thing I'm interested in is: what is the reason? What does Acronis 'better' than the Linux tools dd, dd_rescue and ntfsclone?

Any suggestions?

Many thanks anyway. Of course, the discussion kept me trying on ;-)
Regards,
Oliver
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

AFAIR, the VDI / fdisk geometry defaults to 63 sectors / track and 31 tracks / cylinder. This is just stupid because fdisk by default always cylinder-aligns partitions. This mean (i) that partition clusters are not cluster aligned to the host OS and (ii) the cylinders are enormous and so you lose perhaps 5Mb at the end of the disk since the disk is a multiple of 1Mbyte, but the cylinders are 7,812 Kb long. I now go into fdisk advanced mode and override the geometry to have 32 sectors / track and 16 tracks / cylinder which gives you a cylinder size of 2Mb. Hence you can make your VDI an exact number of cylinders long and as long as you make your VDI (1024N - 128) Mb long, then the clusters in your partitions map exactly onto host clusters.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ekeis98
Posts: 13
Joined: 12. Jul 2007, 00:42
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, other Linux
Location: Germany

Post by ekeis98 »

Hi Terry,
so what would your recommendation regarding changing my procedure (described above)? Maybe you could be in the fdisk-part a little bit more detailed in terms of what to set up correctly making the new VDI boot without disk read error.
And: what is your suggestion regarding the step that Acronis does to make the VDI start directly after cloning?
Regards,
Oliver
Post Reply