Windows is also going to write a disk signature to the MBR at offset 1B8 (hex). Although you can back up the MBR and then restore it after installing Windows, that could make Windows unable to boot. So, you are better off to reinstall LILO after installing Windows.
To re-install LILO using the Slackware setup disk, do the following.
- Boot the Slackware 64-bit Setup disk
- Mount your root partition (replace "sda1" with your root device name)
mount -t ext4 /dev/sda1 /mnt
- Mount "dev" file-system so you can use "chroot".
mount --bind /dev /mnt/dev
- Mount "proc" file-system so you can use "chroot".
mount --bind /proc /mnt/proc
- Mount "sysfs" file-system so you can use "chroot".
mount --bind /sys /mnt/sys
- Use "chroot" to make your root file-system be the root.
- Edit "lilo.conf" to add a menu entry for Windows
- Run the "lilo" command to re-install "lilo"
- Exit from the "chroot" shell
- Un-mount your root file-system.
- Reboot by pressing Ctrl+Alt+Delete
Here are the added lines for "lilo.conf" to boot Windows.
other = /dev/sda2
label = windows
Replace "sda2" with the correct device for your Windows partition (the partition containing "bootmgr" or "ntldr").
If you back up your MBR, be careful. If you or Windows make any partition changes afterward, restoring the MBR will undo those changes. Make any changes such as re-sizing partitions before you back up the MBR.
Here is how to back up the MBR to a file.
dd if=/dev/sda of=/mbr.bin bs=512 count=1
You can replace "/mbr.bin" with whatever path and file name you want to use for the backup of the MBR sector.
You should make another backup copy of the MBR to a different file before you restore a copy of the MBR.
To restore the MBR from a file use this command.
dd if=/mbr.bin of=/dev/sda bs=512 count=1
If Windows does not boot after restoring the MBR, you can use a Windows Setup disk to repair the Boot Configuration Database. Choose the option to start a command prompt and then use this command to repair the boot configuration.