Forum Home
Press F1
 
Thread ID: 78127 2007-04-04 01:58:00 Adding windows to a linux/windows system Morgenmuffel (187) Press F1
Post ID Timestamp Content User
538132 2007-04-04 01:58:00 As above

I am looking to add XP to my current 2K/linux machine and i want to avoid getting the boot sector overwritten or at least i want to be able to boot into linux when i am finished,
everytime i have done something of this sort in the past I have ended up having to reinstall linux, and i would like to avoid that

Linux distro is Elive if that is anyhelp.
Morgenmuffel (187)
538133 2007-04-04 02:29:00 Ask Microsoft to fix their installation software so it will behave in a responsible way .

Good luck . :D

It's easy enough to preserve the Linux block and replace it afterwards, though you will have to manually add the Windows option to the boot manager .

dd if=/dev/hda of=/root/bootsector . dat bs=512 count=1 will create a file which you can copy to a floppy (or leave on the hard disk) . Then after the Windows installation, you will need to boot from a CD or something, preferably in single user mode, and use dd again: dd if=/dev/hda5/root/bootsector . dat of=/dev/hda bs=512 count=1 . (if is Input "File" -- which can be a raw block or blocks -- of is Output "File" . bs is BlockSize) dd is a very powerful tool . man dd )

You do need to be very sure about where you are getting and putting things . ;) /dev/hda is the legal name for the whole of hda . . . and double and treble check the syntax . :cool: I think what I've given you is roughly correct, but it's a while since I have done this and "roughly correct" is not really good enough .

I have an idea that both Grub and LILO have ways to save and restore the boot sector .

It's easiest to have a copy of the saved block on a floppy, because it can be tricky to get files from down in the HD file system if you have booted from another device . Of course, make sure the file can be read before carrying on .
Graham L (2)
1