Make " restored" XP partition image boot for Linux (first)-XP dual-boot
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Make " restored" XP partition image boot for Linux (first)-XP dual-boot
I wish to dual-boot Linux and WinXP Pro on a second (desktop) computer where Linux is already installed. I do not have a WinXP install CD and cannot use the OEM drive image on a hidden partition of a first (laptop)computer with XP Pro installed because I want to install it to the third partition on the desktop (after Linux and Linux Swap). So I "restored" an Acronis partition image of the laptop C drive to this third partition and made it Active, but it does not appear in the Grub menu (Linux boots OK). I assume Windows cannot be booted because the MBR was not included. The alternative is to start afresh, abandon Linux and Clone the XP drive to the desktop first partition, but that would mean losing an established Linux 10.04 system.
Two questions:
1. Is it possible to make this partition on the desktop bootable?
2. If that's possible, what will need to be done to the Grub bootloader?
If you have an existing dual-boot system with XP look at the GRUB menu for that system. Duplicate the lines which enable booting to the XP partition replacing the disk/partition numbers with the correct values for the computer that won't currently boot into XP.
If you are using GRUB version 2 you can use update-grub to recreate the grub configuration file. It should automatically locate and install the menu item for each bootable operating system.
First of all, let me point out that in no way do I support your decision to use an unofficial version of Windows XP, and nobody here will condone your doing so officially.
That said, I will answer your questions based upon the assumption that you have legally acquired a copy of a Windows XP installation disk and are setting out to install it with the COA signed by Microsoft.
In answer to the question of how to make the recovered image bootable, the answer is that you need to manually add the Windows partition to the GRUB menu. I use LILO, so I can only tell you that there is information about how to add a Windows XP partition on LILO, and on Grub.
Now, for a legal installation of XP that will dual boot, you will have to do a few things first. If Grub gives you the option of making a bootable flash disk, floppy disk, or CDROM, do it! You need to take that step because Windows installation disk will overwrite the 'boot sector' even if you install onto the second or third primary partition. Yes, you can have up to four primary partitions on a hard drive, plus an unlimited number of 'logical' ones. Do not let those old MSDOS documents fool you. Install Windows XP normally on that non-first primary partition. You will wipe the boot sector, but will not lose your Linux partition or your swap partition. That is why you created the boot disk/device. You boot with the boot device, create a new reference for Windows XP, and reinstall grub on the boot sector of the hard drive. I learned that trick with Windows 98 and BeOS, so it's been a while.
Xp will not boot if moved from one PC to another with different CPU, ram, nic, video card..... It is also illegal for a OEM version of Xp to change the PC.
An installed Xp does not need MBR to boot.
It is just 2 to 3 lines to type to ask Grub or Lilo to boot an installed Xp.
Thank you PhantasyConcepts and Saikee for raising the question of legality. I regard the OEM WinXP OS on a laptop that I own as legal, but if it is true that I am not allowed to move it to another PC, and that that won't work, I must accept it and give up!
I actually expect the laptop to fail soon (its 5 years old) and though I would like to keep XP and my data, I do not want to replace the HDD on the laptop.
rdgreenlaw: I do not have a current dual-boot system (just Linux 10.04)and will have to acquire a (legal!) WinXP CD to do a fresh install.
Thanks for your replies!
I do move my MS Windows around when the hardware getting old or fail but always on one machine as MS check this every time I am on the Internet.
XP needs a re-activation every time a significant change in the hardware. A complete switch over leads to the system locking itself requiring MS to unlock from the Internet. MS generally permit a re-activation if the last one has been for some time. If the re-activation is recent/frequent the user will not be able to re-activate by Internet and must call MS directly to get the XP working again.
I do move my MS Windows around when the hardware getting old or fail but always on one machine as MS check this every time I am on the Internet.
The links you gave have been helpful. Windows XP now appears in the Grub boot menu but will not boot. I get:
"error no such device "
"error no disk"
I have attached output "Results" from bootinfoscript. It appears to me that the partition containing Windows is recognised but will not boot.
fstab appears to record an earlier installation to another disk, sdb (still attached, but empty now) but does not reflect the current situation.
I can see no reference to Windows in sda1/boot/grub/grub.cfg
Although it says "do not edit this file" there is an option to create a new /etc/grub.d/40_custom file. Will that help? And how should it be done?
Actually the error message is:
error: no such device: 5639c291826637e4
which is the correct uuid of the Windows partition (sda3)
Last edited by mowley; 07-19-2010 at 12:01 AM.
Reason: addition
If you Windows is in the 3rd partition of 1st disk (Grub2 counts disk from 0 but partition from 1) it will be known to Grub2 as (hd0,3). These lines in a Grub prompt (obtainable from press the "c" key at a Grub menu instead of booting a system) will fire up your Windows
Code:
set root=(hd0,3)
chainloader +1
boot
If the above works and you want to add Windows to /boot/grub.grub.cfg then add these lines
Code:
menuentry 'Windows in sda3 known to Grub2 as (hd0,3)' {
set root=(hd0,3)
chainloader +1
}
The necessary condition to boot an installed Windows in this case is sda3 must has NTLDR, boot.ini and a boot loader residing in its boot sector.
Thank you, Onebuck. Comment noted and taken seriously, please see my post of 7-15-10.
My EULA(2004) states:
1.2 SOFTWARE as a Component of the COMPUTER - Transfer.
This license may not be shared, transferred to or used
concurrently on different computers.
A recent revised and simplified EULA (http://www.microsoft.com/windowsxp/eula/pro.mspx) states:
4.TRANSFER-Internal. You may move the Product to a different Workstation Computer. After the transfer, you must completely remove the Product from the former Workstation Computer.
(This may of course refer to an installation CD, as you are suggesting)
Of course I will seek clarification/permission if reqired, but I believe I am observing the spirit of the agreement. Please tell me if you disagree.
Last edited by mowley; 07-19-2010 at 07:15 PM.
Reason: quoted date correction
It is important that there is no cracking involved here.
The method to boot a MS Windows with Grub is a well published procedure by loading Xp's own boot loader at the "+1" position. The whole procedure is if Grub has been booted first it can boot up another boot loader and transfer the control to the second boot loader. This is no different from using NTLDR of Xp to boot a Linux.
It is not certain how the OP intends to restore the Xp image but it sounds the image been sourced from another PC. Only the OEM version of the XP is not transferrable. I think various posts have already pointed out the illegality.
In any case the restored Xp will check the hard ware (if booted up) to the EULA rules and MS will lock the Xp up if it is a direct transfer from one PC to another PC. If the XP is not locked it will still require a re-activation. If MS prepares re-activate the Xp then the OP may be in luck.
If the OP's XP is locked or cannot be activated by Internet then the OP must call MS to sort it out. Therefore by helping him to boot up a previous saved image can at least clarify a few things.
I believe MS allows a system to migrate if there is a total hardware failure resulting the system no longer usable as there could be valuable personal data inside the installed system. Also many hardware from time to time can become obsolete, no longer available in the market and have to be substituted if the XP is to continue its life.
It is important that there is no cracking involved here.
..............
If the OP's XP is locked or cannot be activated by Internet then the OP must call MS to sort it out. Therefore by helping him to boot up a previous saved image can at least clarify a few things.
........
If you Windows is in the 3rd partition of 1st disk (Grub2 counts disk from 0 but partition from 1) it will be known to Grub2 as (hd0,3). These lines in a Grub prompt (obtainable from press the "c" key at a Grub menu instead of booting a system) will fire up your Windows
Code:
set root=(hd0,3)
chainloader +1
boot
..........
The necessary condition to boot an installed Windows in this case is sda3 must has NTLDR, boot.ini and a boot loader residing in its boot sector.
I followed the instructions above but the partition did not boot. Got same error message "error: no such disk:..." with the correct Windows uuid.
The partition has NTLDR and boot.ini
Grub2 recognises Windows on sda3 but can't boot it.
Grub appears not to find "core.img" for Linux at first, but eventually does (see RESULTS.txt, attached to my 7-19-10 post).
There appears to be a discrepancy in fstab: it lists the Linux partitions as installed in drive sdb1 (they were once). sdb is still attached but is now empty (I could try disconnecting it).
And during boot-up the uuid of the old SWAP partition flashes up briefly. It is different from the uuid of the current SWAP on sda1. The uuid of the EXT4 partition however is the same (all visible in RESULTS.txt). Should fstab be fixed? And how?
I am considering a fresh Restore to the first partition of current "sdb" as a single drive, after disconnecting the current dual-boot drive "sda".
If you boots a MS Windows from a Grub2 prompt do worry about fstab or core.img or swap.
A Grub2 prompt by necessity would have only two files in memory; boot.img and core.img otherwise Grub2 cannot function.
If there is an error of no such disk there you can investigate by Grub2 command like
Code:
ls (hd0,3)
and should be able to see the Xp partition if it has been restored. Grub2 can read a NTFS partition and so you can ask Grub2 to display boot.ini with command
If there is an error of no such disk there you can investigate by Grub2 command like
Code:
ls (hd0,3)
and should be able to see the Xp partition if it has been restored. Grub2 can read a NTFS partition and so you can ask Grub2 to display boot.ini with command
Code:
cat (hd0,3)/boot.ini
as (h0,3) should be the "C" of your MS Windows.
I disconnected the second hard drive (sdb) and followed the instructions above. From 'c' at the Grub menu:
grub> ls (hd0,3)
Partition hdo,3: filesystem type ntfs-Label "Fixed Disc" UUID 5639c291826637e4
grub> cat (hdo,3)/boot.ini
error: no such disk
grub> cat (hdo,3) /boot.ini
error: file name required
Every attempt to boot Windows ends in STOP: 0x0000007B which is interpreted as "unable to find boot device". "Fixed Disk" is "C" in the Windows partition.
I can view boot.ini via Linux and "Fixed Disk" in File Manager. The Windows partition is set at hdo,3
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.