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.