Is there any way to reinstall winXP with killing linux.

smack Down

Diamond Member
Sep 10, 2005
4,507
0
0
I have linux step up the way I want but in the process I killed my windows installation. Is there any way to tell XP not to overwrite the boot loader or save the boot loader and reinstall just that with out having to reinstall the whole distrobution?
 

JeffBlair

Member
Jun 17, 2003
29
0
0
As far as I know, there isn't. Not sure what distro you are useing, but with Gentoo, all you do is boot off the CD, mount your / and /boot. CHROOT into / and run grub or lilo. Back to where you were at. As long as your config file is right.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
As far as I know, there isn't. Not sure what distro you are useing, but with Gentoo, all you do is boot off the CD, mount your / and /boot. CHROOT into / and run grub or lilo. Back to where you were at. As long as your config file is right.

That will work with any distribution, hell the rescue disc doesn't even have to match since you'll be chrooted into your old system.
 

lucky9

Senior member
Sep 6, 2003
557
0
0
Install Windows to it's partition.
Boot a Linux LiveCD.
At the GRUB boot screen, hit c
at the command line of GRUB
grub> root (hd0,4) #mounts the partition that you want to boot Linux (change to your setup)
grub> setup (hd0) #installs to the MBR what it needs to Load Linux & chainload to Win
grub> quit
reboot
 

stonecold3169

Platinum Member
Jan 30, 2001
2,060
0
76
Copying your Linux bootloader to a file

After installing your bootloader to the bootsector of a partition, you can copy it to a file. If you used 'boot=/bootsect.lnx' with LILO, you don't need to do this, you already have the needed file. You copy the bootloader from a partition using the 'dd' command (example for partition hda2):
Code:

dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1


This'll copy the first sector or 512 bytes of hda2 (it's bootsector) to the file 'bootsect.lnx' in the / directory. If you installed your bootloader to your partition, it will now be copied to the 'bootsect.lnx' file.



Copying the bootloader file to Windows

If you use FAT32 for your Windows partition, then you can copy the file directly to it in Linux. First it needs to be mounted to a folder, say, /mnt/win :
Code:

mount /dev/hda1 /mnt/win -t vfat


This assumes that Windows considors /dev/hda1 to be it's 'C:\' drive.
Then you can copy the file:
Code:

cp /bootsect.lnx /mnt/win


If you use NTFS, then you'll have to copy via floppy. Get a Windows-formatted floppy. Mount it, to /mnt/floppy:
Code:

mount /dev/fd0 /mnt/floppy -t vfat


Then copy:
Code:

cp /bootsect.lnx /mnt/floppy


Reboot into Windows, & copy the file to the 'C:\' drive.

Editing boot.ini
Now you need to edit your C:\boot.ini file. It is problematic to do this from Linux, because DOS text is slightly different from UNIX text, and you wouldn't be able to save to NTFS. There are some text editors that can save DOS text, though. In Windows, this file may be hidden. You an unhide it by clicking on Tools=>FolderOptions, and turn off the 'Hide system files' option in Explorer, or you can access it via the Control Panel's System tool ([right-click]MyComputer=>Properties=>Advanced), or via the msconfig program, in the 'boot.ini' tab. Add this line to boot.ini:
C:\bootsect.lnx = "Linux"
Now, the next time you bootup, you'll see a menu asking whether to boot Windows or Linux.

 

stonecold3169

Platinum Member
Jan 30, 2001
2,060
0
76
Originally posted by: stonecold3169
Copying your Linux bootloader to a file

After installing your bootloader to the bootsector of a partition, you can copy it to a file. If you used 'boot=/bootsect.lnx' with LILO, you don't need to do this, you already have the needed file. You copy the bootloader from a partition using the 'dd' command (example for partition hda2):
Code:

dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1


This'll copy the first sector or 512 bytes of hda2 (it's bootsector) to the file 'bootsect.lnx' in the / directory. If you installed your bootloader to your partition, it will now be copied to the 'bootsect.lnx' file.



Copying the bootloader file to Windows

If you use FAT32 for your Windows partition, then you can copy the file directly to it in Linux. First it needs to be mounted to a folder, say, /mnt/win :
Code:

mount /dev/hda1 /mnt/win -t vfat


This assumes that Windows considors /dev/hda1 to be it's 'C:\' drive.
Then you can copy the file:
Code:

cp /bootsect.lnx /mnt/win


If you use NTFS, then you'll have to copy via floppy. Get a Windows-formatted floppy. Mount it, to /mnt/floppy:
Code:

mount /dev/fd0 /mnt/floppy -t vfat


Then copy:
Code:

cp /bootsect.lnx /mnt/floppy


Reboot into Windows, & copy the file to the 'C:\' drive.

Editing boot.ini
Now you need to edit your C:\boot.ini file. It is problematic to do this from Linux, because DOS text is slightly different from UNIX text, and you wouldn't be able to save to NTFS. There are some text editors that can save DOS text, though. In Windows, this file may be hidden. You an unhide it by clicking on Tools=>FolderOptions, and turn off the 'Hide system files' option in Explorer, or you can access it via the Control Panel's System tool ([right-click]MyComputer=>Properties=>Advanced), or via the msconfig program, in the 'boot.ini' tab. Add this line to boot.ini:
C:\bootsect.lnx = "Linux"
Now, the next time you bootup, you'll see a menu asking whether to boot Windows or Linux.

this was stolen from someplace online many moons again, so I can't credit it unfortunetly... this worked for me through man and many a distro install