LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-15-2010, 08:07 AM   #1
mowley
Member
 
Registered: Jul 2010
Posts: 30

Rep: Reputation: 15
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?
 
Old 07-15-2010, 08:45 AM   #2
rdgreenlaw
Member
 
Registered: May 2007
Location: Newport, Maine, USA
Distribution: Debian 8.7
Posts: 73

Rep: Reputation: 18
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.
 
Old 07-15-2010, 09:02 AM   #3
PhantasyConcepts
LQ Newbie
 
Registered: May 2009
Posts: 19

Rep: Reputation: 3
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.
 
Old 07-15-2010, 10:36 AM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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.
 
Old 07-15-2010, 11:40 PM   #5
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
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!
 
Old 07-16-2010, 02:47 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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.
 
Old 07-18-2010, 10:04 PM   #7
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
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)
Attached Files
File Type: txt RESULTS.txt (9.9 KB, 17 views)

Last edited by mowley; 07-19-2010 at 12:01 AM. Reason: addition
 
Old 07-19-2010, 02:41 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
You can edit /boot/grub/grub.cfg.

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.
 
Old 07-19-2010, 06:52 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

Welcome to LQ!

Read the 'EULA' for M$ WinXP to clarify what is allowed.

LQ Rules prohibit cracking in any way.

The OP is requesting such. OP should contact M$ to get authorization of use or obtain a valid copy for install.
 
Old 07-19-2010, 08:11 AM   #10
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 07-19-2010, 08:18 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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.

Last edited by saikee; 07-19-2010 at 08:30 AM.
 
Old 07-19-2010, 07:22 PM   #12
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
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.
........
That is the way I see it.
 
Old 07-22-2010, 11:03 PM   #13
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Still no boot

Quote:
Originally Posted by saikee View Post
You can edit /boot/grub/grub.cfg.

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".
 
Old 07-23-2010, 02:20 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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
Code:
cat (hd0,3)/boot.ini
as (h0,3) should be the "C" of your MS Windows.
 
Old 07-24-2010, 08:00 PM   #15
mowley
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
still no boot

Quote:
Originally Posted by saikee View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dual boot fedora & vista - boot error - "GRUB loading stage 2" ans Fedora 1 08-20-2007 03:35 AM
Constant "Resolving host" on linux dual boot system fof3 Linux - Networking 10 07-05-2007 02:20 PM
Grub/Dual boot - Windows partition restored via dd won't boot pazzport Ubuntu 1 01-06-2006 01:29 PM
Dual-boot install: "Could not find kernel image: linux / boot:" JEBBEDIAH C Linux - Newbie 16 02-02-2005 08:25 PM
I Dual Boot, Is there Compatable "Drive imaging" that works with linux joncolby Linux - Software 6 06-21-2004 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration