[ltp] Moving Windows to secondary disk

John - linux-thinkpad@linux-thinkpad.org
Thu, 7 Sep 2006 12:55:19 -0400


--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On (07/09/06 18:37), Shem Multinymous wrote:
> To: linux-thinkpad <linux-thinkpad@linux-thinkpad.org>
> From: Shem Multinymous <multinymous@gmail.com>
> Subject: [ltp] Moving Windows to secondary disk
> Date: Thu, 07 Sep 2006 18:37:34 +0300
> X-Spam-Status: No, score=3D-1.4 required=3D5.0 tests=3DAWL,BAYES_50,
> 	FORGED_RCVD_HELO autolearn=3Dno version=3D3.1.4
>=20
> Hi,
>=20
> My T43 is configured for dual-boot, but I'm using the Windows
> partition (a shrunk-down preinstall) extremely rarely and would like
> to free up the diskpace.
>=20
> Is it possible to move the whole Windows partition from the system
> disk to an UltraBay disk or (better yet) an external USB disk, and
> still have it boot when selected in the F12 BIOS menu? I guess all the
> driver identifiers will change, and I have no idea how that works in
> Windows.
>=20
> Of course, the Linux analog is roughly as exciting as
> # dd if=3D/dev/sda of=3D/dev/sdb
> # partprobe /dev/sdb
> # mount /dev/sdb1 /mnt
> # perl -i -pe 's/sda/sdb/' /mnt/etc/fstab /mnt/boot/grub/grub.conf
> # grub-install --root-directory=3D/mnt sdb   # is this necessary?
> # reboot
>=20
>=20
>  Shem

At the start, my ThinkPad (A31) was dual booted via grub, Windows XP
on /dev/hda1, sid on the rest, with a home-baked 2.6.xx kernel.

I added a second hard drive in the UltraBay, and created /dev/hdb1
*exactly the same size* (9 GB) as /dev/hda1, along with other
partitions.

I then copied the XP partition to the new drive, using this command:

 dd if=3D/dev/hda1 of=3D/dev/hdb1 bs=3D$((1*1024*1024))

What I did next was A MISTAKE: I booted into Windows, it recognized
both C: and D: drives, and reinstalled itself without asking
permission. I thought everything was OK, and wiped Windows off
/dev/hda. Thereafter, XP would not boot.

I sought help from debian-user@lists.debian.org, and the solution was
provided by Dave Witbrodt (Subject: Re: Will wine|win4lin|VMWare save
my XP bacon?  Date: Fri, 31 Mar 2006). It is to instruct grub to map
hda to hdb and vice versa. The relevant part of /boot/grub/menu.lst is
as follows:

### END DEBIAN AUTOMAGIC KERNELS LIST

title           Other operating systems:
root
title           Windows XP Pro
map             (hd0) (hd1)
map             (hd1) (hd0)
root            (hd1,0)
savedefault
chainloader     +1

With this in place, Windows successfully booted, and on its own hook,
without a single command from me, reinstalled itself. AGAIN! This
remains A MYSTERY!

I hope this helps. Needless to say, your milage may vary, and I offer
NO ASSURANCES. (After all, we're dealing with Window$.)

Still, I ended up with a dual boot machine, Debian sid on /dev/hda and
Windows XP on /dev/hdb1 in the Ultrabay.

--=20
JohnRChamplin@columbus.rr.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
PGP key 1024D/99421A63 2005-01-05
EE51 79E9 F244 D734 A012 1CEC 7813 9FE9 9942 1A63
gpg --keyserver subkeys.pgp.net --recv-keys 99421A63

--fUYQa+Pmc3FrFX/N
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFAE73eBOf6ZlCGmMRAmb3AJ9mhc6R5pDQ2+JKdC2GmDmp+yZjbgCfVdYD
t8LPKGwnYSSKZS9qVqUMSz8=
=D6kS
-----END PGP SIGNATURE-----

--fUYQa+Pmc3FrFX/N--