Advise to reinstall XP with Linux

Mike Reinehr cmr
Mon Nov 1 14:03:57 PST 2004


Jean,

I'm not one of the experts on this list, but I think I can contribute a couple 
of ideas, here, without causing too much trouble.

On Monday 01 November 2004 10:27 am, Jean Sagi wrote:
> Hi all,
>
> This might be not very common, but I finaly manged to crash my WindowsME
> on the first disk I have (/dev/hda), by resizing the partition where it
> reside with Diskdrake.
>
> Luckyly, all my linux partions where on my second disk (dev/hdb), and I
> can boot'em without any problem, so as you may guess the lost was not much.
>
> So, now, I want to install XP in my first disk (yes... I like to play
> with the devil), but leaving my linuxes on second disk _intact_ and I'm
> not very sure on how to proceed and maybe someone here want to share
> some ideas on how to acomplish this.
>
> I think that:
>
> - First I have to do a boot disk.

 That would, certainly, be a good idea, but not absolutely necessary, if you 
have a Knoppix disk available.

> - Second save lilo on /dev/hda (the first 512 bytes)...

 dd if=/dev/hda of=somefile bs=512 count=1

 Unless I'm remembering this wrong, this should copy the first sector of your 
first hard drive to a file somewhere. You could first copy it to a file on 
one of your Linux partitions and later make a floppy copy for good measure. 
This sector includes the bootloader and the partition table.

 (Restoring is easily done with: dd if=somefile of=/dev/hda bs=512 count=1)

Use fdisk or cfdisk to repartition the first hard drive for WinXP. Set the 
partition active.

Reboot to make sure all is well with the partition table & boot loader 
(restore from previous backup if all is not well).

If all is well make another backup of the boot sector (including the new 
partition table).

>    (Don't know hot to do it, Have to ckeck it)
> - Third XP on hda1, that's the scary part cause I think XP erases boot
>    code on hda.

 Yup! WinXP (all Windows products will write their own boot loader to the boot 
sector)

 Boot from your WinXP disk and install to /dev/hda.

> - Finally manage a way to reinstall lilo so that linuxes on
>    hdb are restored, and be able to boot XP also.

 Boot from your Linux boot disk or Knoppix disk and use dd to restore your 
boot sector from the second backup. Then do what ever it is you have to do to 
reconfigure LILO to boot your newly installed WinXP. (With GRUB all you would 
have to do is edit the grub/menu.lst file with a text editor.)
>
> Any help/hint would be very appreciated.
>
>
> Chucho!
> _______________________________________________
> Linux-users mailing list
> Linux-users at linux-sxs.org
> http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users

Hope this helps more than it hurts.

Mike
-- 
Debian 'Sarge': Registered Linux User #241964
----
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC
--------


More information about the Linux-users mailing list