Currently most Linux based distributions install a recovery/safe option and a memory test option in the default bootloader. While Slackware does not install such options by default, they can be easily added to any system.
The recovery prompt that will be installed in this tutorial will be an on-disk option to enter the Slackware usbboot image. This image currently includes a basic command line mode that is used to fix boot issues, the capability to run the setup application for new Slackware installations and access to the memtest86 application.
usb-and-pxe-installers/usbboot.img
, this location is on the root of all installation media or distribution mirrors. It is recommended to place the file into the /tmp
directory so it is easily located.usbboot.img
file using the loopback option into an unused directory such as /mnt/tmp
with the command mount -o loop /tmp/usbboot.img /mnt/tmp
/boot
directory to contain the necessary files such as /boot/recovery
with the command mkdir /boot/recovery
usbboot.img
mounted directory into the newly created recovery directory with the cp command such as cp -rv /mnt/tmp/* /boot/recovery/
umount /mnt/tmp
In those cases you can either upgrade lilo (which may not be possible) or enter the standard prompt from within an installation CD, DVD or USB stick.
Before we begin modifying the lilo configuration you must first understand why the various options are being used.
Using your favorite text editor modify the /etc/lilo.conf
file to include the entry as shown below:
image = /boot/recovery/huge.s label = slackware-recovery initrd = /boot/recovery/initrd.img password = newpassword read-only
Once the new entry has been applied and saved in lilo.conf
you will issue the command lilo, upon completion you will see an output similar to the following which will show that the new option has been successfully applied to the bootloader:
root@darkstar:~# lilo Added linux * Added recovery
Since passwords are being applied within the /etc/lilo.conf
file, it is recommended to modify the permissions of the file so that only root can read the contents. You can apply the recommended permissions by issuing the following command:
chmod 600 /etc/lilo.conf
The memtest option can currently be executed through the recovery command line prompt by issuing the command memtest
, but to decrease the memory footprint of the loaded system we will setup a bootloader option to boot directly into the memtest application.
We will assume that you have already followed the instructions above to create a recovery option, if the instructions were not followed you can follow the basic steps above but only copy the file called memtest
from the usbboot.img
file into the recovery directory.
If you followed the recovery option instructions above, the memtest
binary will already be present in the /boot/recovery
directory.
The file memtest will be referenced as the image for a new lilo entry as shown below.
image = /boot/recovery/memtest label = memtest password = newpassword read-only
Once the new lilo entry has been saved and the lilo command has been run you will see see an output like the following confirming that the new option is available.
root@darkstar:~# lilo Added linux * Added recovery Added memtest