This shows you the differences between two versions of the page.
— |
internal:grub-lilo [2011/01/11 23:48] (current) solar created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How to replace GRUB with LILO on a remote Linux server ====== | ||
+ | We generally prefer to use LILO (which comes with [[http://www.openwall.com/Owl/|Owl]]) rather than GRUB (a more popular choice these days) on remote Linux servers that we administer. This is due to LILO's pre-reboot configuration file parsing and the "lilo -R" feature, which we rely upon for our [[reboot|remote reboots]]. | ||
+ | |||
+ | On many occasions, we're given a server with GRUB pre-installed, and we want to replace GRUB with LILO (usually along with replacing the system with Owl). Unfortunately, there's some risk that we make an error in the LILO configuration, so the server will fail to come back up, and GRUB will no longer be there too. | ||
+ | |||
+ | Luckily, there's a way to add a fallback to GRUB from LILO. Simply copy GRUB's MBR to a partition's boot sector: | ||
+ | |||
+ | dd if=/dev/sda of=/dev/sda1 bs=512 count=1 | ||
+ | |||
+ | Then specify the fallback to GRUB in ''/etc/lilo.conf'' like this: | ||
+ | |||
+ | <code> | ||
+ | other=/dev/sda1 | ||
+ | label=grub | ||
+ | </code> | ||
+ | |||
+ | In fact, make the fallback the default - either by listing the above section first (before any ''image'' sections) or by specifying ''default=grub''. Then activate the new "LILO native" label (one that uses ''image'') with ''lilo -R'' (giving the label name as that command's argument) - and reboot. | ||
+ | If everything goes well, the "LILO native" label will boot up successfully. If not, the next reboot will result in a fallback to GRUB (via LILO). In order to automate this next reboot on some possible failures, specify ''append="panic=10"'' or ''addappend="panic=10"'' (as appropriate) on the "LILO native" target. | ||
+ | |||
+ | The above has been tested with migration from CentOS 5.5 (GRUB) to Owl 3.0 (LILO). |