Hello.
I have an installation of Windows 7, Windows XP and Debian GNU/Linux on separate partitions of the same hard disk. Also on the hard disk is the original Windows XP recovery partition that the computer shipped with back in 2005. I've somehow fouled up the XP partition (I copied it and never initial-first booted it, it's probably complicated), so I'd like to re-install it to its intended primary partition from inside Windows 7 (using "expand" from the command prompt perhaps?) or even from inside Debian, or from Recovery Console booted from the CD tray if necessary.
Is this possible? Has anyone tried this before?
Thanks,
David
not sure i understand exactly what your trying to do here.
what exactly have you fouled up? the recovery partition? or the partition with the xp operating system on?
or maybe it's just the bootloader that you've fouled up? i assume your using a version of grub to boot your operating systems?
can you explain what you mean by fouled up and exactly what you did to foul up the partition? also how do you know it's fouled up? just copying a partition shouldn't foul anything up.
if what your trying to re-install is the xp operating system (guess you'll be using the recovery partition image to do this?) then i'm afraid your probably going to lose both the win7 and debian operating systems because the image will restore the pc to a factory state, deleting any partitions you made, so both win7 and debian will need to be installed again after you've got the xp os back up and running.
even if your using an xp cd so you can specify the partition to install onto, it will change the mbr and you won't be able to boot into either win7 or debian, so that will be something else that'll need fixing.
anyway first thing i recommend you do now is to make sure you have everything backed up, because whatever your trying to do i think it's going to be complicated so there might be a chance of something going wrong.
Hi terry1966, and thanks for the response.
These are the steps which led to this scenario:
1) I "recovered" the entire 250 GB hard disk using the recovery partition, so that it was a brand-spanking-new installation of Windows XP.
2) I partitioned the drive using Gparted from an Ubuntu live CD, reserving a primary for XP, a primary for 7, and an extended partition containing logical partitions each for data (fat32), linux-swap, and two ext4 partitions for a main Linux installation and a testing version to mess around with.
3) I copied the XP partition to the second partition. Now, I have two identical XP partitions.
4) I booted the first XP partition and attempted to run the Windows 7 "update" disk that I purchased a while back. This didn't work, since I'm trying to upgrade to 64-bit and the XP installation is a 32-bit. So I did a "custom" installation, in which I had to boot Windows 7 from the DVD and install that way. (I never booted the second XP installation, during which all of the setting up takes place).
5) Installed Debian.
6) Test booted all of the systems. Everything worked except the XP partition. At first, I got the "missing ntoskrnl.exe" message. So I poked around and fixed the boot.ini file in the XP partition to point the chain-loaded bootloader to the correct partition (which is, in this case, itself). Then I tried to boot XP from GRUB again and I got the message "installation was not completed. please run setup again."
So what I want to know is whether I can avoid doing all those steps again, fixing along the way the mistakes I made initially (i.e. testing each of the Windows partitions after each installation) and instead just install XP to the appropriate partition using "expand" from a Windows CMD prompt (from inside Windows 7 or Recovery Console or something like that).
All of these installations are fresh and new and don't have a lot of software installed, so I'm not married to them. But I did spend some time this week getting Debian set up to do production work and I'd rather not have to do all that again.
BTW, losing the MBR after a Windows install is not that big of a problem for me, since I can just re-install GRUB from my Debian 6 netinstall disk. I've had to do it several times now and I'm getting quite comfortable with it.
Thanks,
David
bit concerned you edited the boot.ini file, did you make a backup copy before editing? if so please put it back then it might be a good idea to boot into win7 and then use bcd and see if it can create/repair your boot files so you can boot into both xp and win7. http://neosmart.net/wiki/display/EBCD/Reco…er+with+EasyBCD
also can you use the commands "df" and "fdisk -l" in debian and post the results back in your next reply, i'm still not 100% sure of your partitioning.
i'm thinking you have 3 partitions to do with xp, the hidden restore partition, and then 1st partition where xp was installed onto when you restored to factory and 2nd which you created during partitioning and copied the files onto from the first installed xp partition?
should add the partition with the copied xp files on will not boot into xp, because copying the files to a partition doesn't actually install the os, but the first xp partition should be bootable because that's where xp was installed correctly when you did the factory restore.
david@debian-desktop:~$ sudo /sbin/fdisk -l /dev/sdb
GNU Fdisk 1.2.4
Copyright (C) 1998 - 2006 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Disk /dev/sdb: 250 GB, 250056737280 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9914 79634173 7 HPFS/NTFS
Warning: Partition 1 does not end on cylinder boundary.
/dev/sdb3 9914 14777 39062047 7 HPFS/NTFS
Warning: Partition 3 does not end on cylinder boundary.
/dev/sdb4 14777 29366 117186142 5 Extended
Warning: Partition 4 does not end on cylinder boundary.
/dev/sdb5 14777 19640 39062047 b FAT32
Warning: Partition 5 does not end on cylinder boundary.
/dev/sdb6 19640 20856 9767520 82 Linux swap
Warning: Partition 6 does not end on cylinder boundary.
/dev/sdb7 20856 25111 34178287 83 Linux
Warning: Partition 7 does not end on cylinder boundary.
/dev/sdb8 25111 29366 34178287 83 Linux
Warning: Partition 8 does not end on cylinder boundary.
/dev/sdb2 29367 30401 8305605 c FAT32 LBA
david@debian-desktop:~$
ok looking at that you've installed win7 on the partition that had your xp installation on, instead of using the sdb3 partition which just has the copied xp files on.
i thought you'd created an extra partition for win7 and that's where you'd installed it, so was thinking you could still boot the original xp partition.
sorry to say i think you may now only have 2 options,
1 either start from scratch with another factory restore or
2 find someone with an xp disc you can borrow to install xp onto the sdb3 partition.
probably most important question is how did you copy the xp install from sdb1 to sdb3? ie, did you clone it.
have you used the bcd program in win7 yet and did it see sdb3 as a xp os installed partition and make it bootable?
makes no difference but just curious why is the drive sdb and not sda, do you have another drive in that system?
Hi terry1966,
Well, I was prepared to scrap my whole partitioning scheme and just start from scratch, booting the recovery partition and reinstalling Windows XP. I was certain it would format and erase the whole drive and use the whole thing for the new XP installation. But do you know what? It only used the first partition. So I reinstalled Windows 7 on the second partition and then reinstalled GRUB using my Debian NetInstall disk and now, I can boot everything I need.
Thanks for your help with this and for taking the time to read these posts.
Cheers!
David