Uninstalling LILO Bootloader...Lil' Help Sh0rd? -1 reply

Please wait...

Peeping Tom

I take what n0e says way too seriously

50 XP

1st March 2003

0 Uploads

2,619 Posts

0 Threads

#1 16 years ago

Alright, well, a few months ago, I had installed Mandrake Linux, but I have now decided to install Red Hat (Thus rendering Mandrake Obselete). However, I stupidly deleted my EXT2 Partition containing linux (Yes, I know, bad N00b...)! Now, i'm stuck with LILO showing up every time I boot, and I just wanna get rid of it and have a clean installation. The preoblem is, I don't know how to uninstall LILO now that I don't have linux! Would creating a new EXT2 Partition and Installing Red Hat (Which I planned on anyways) install a fresh copy of the bootloader so Mandrake'll stop showing up? Should I run Knoppix in order to enter the commands i've found floationg around the web that (according to their sources) will uninstall LILO? This'ld be a last resort for me, as I don't really feel like Dling an ISO of Knoppix (Upload/Download Cap). So, anyone wanna take a shot at it?




zsh_xx

50 XP

25th November 2000

0 Uploads

232 Posts

0 Threads

#2 16 years ago

When Lilo overwrites a boot sector, it saves a backup copy in /boot/boot.xxyy, where xxyy are the major and minor numbers of the device, in hex. You can see the major and minor numbers of your disk or partition by running "ls -l /dev//device''. For example, the first sector of /dev/hda (major 3, minor 0) will be saved in /boot/boot.0300, installing Lilo on /dev/fd0 creates /boot/boot.0200 and installing on /dev/sdb3 (major 8, minor 19) creates /boot/boot.0813. Note that Lilo won't create the file if there is already one so you don't need to care about the backup copy whenever you reinstall Lilo (for example, after recompiling your kernel). The backup copies found in /boot/ are always the snapshot of the situation before installing any Lilo.

If you ever need to uninstall Lilo (for example, in the unfortunate case you need to uninstall Linux), you just need to restore the original boot sector. If Lilo is installed in /dev/hda, just do "dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1'' (I personally just do "cat /boot/boot.0300 > /dev/hda'', but this is not safe, as this will restore the original partition table as well, which you might have modified in the meanwhile). This command is much easier to run than trying "fdisk /mbr'' from a DOS shell: it allows you to cleanly remove Linux from a disk without ever booting anything but Linux. After removing Lilo remember to run Linux' fdisk to destroy any Linux partition (DOS' fdisk is unable to remove non-dos partitions).

If you installed Lilo on your root partition (e.g.,/dev/hda2), nothing special needs to be done to uninstall Lilo. Just run Linux' fdisk to remove Linux partitions from the partition table. You must also mark the DOS partition as bootable.

Did you have Windows installed previously? You may either run 'fdisk /mbr' or 'FIXMBR' (Windows 2000/XP/2003), which overwrites LILO ;)




knipple

I'm too cool to Post

50 XP

30th September 2003

0 Uploads

1,739 Posts

0 Threads

#3 16 years ago

*sending post to Sh0rd* im stumped




Sh0rD

¥ Uberhacker ¥

50 XP

11th August 2002

0 Uploads

2,118 Posts

0 Threads

#4 16 years ago

yup, just use a bootdisk and fdisk it




Peeping Tom

I take what n0e says way too seriously

50 XP

1st March 2003

0 Uploads

2,619 Posts

0 Threads

#5 16 years ago

Yeah, so I just booted into the recovery console and typed "FIXMBR". Thanks a lot for your help, folks!