Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howtos:slackware_admin:recovery_boot_option [2012/09/25 01:54 (UTC)] (current)
mfillpot moved from general howtos section
Line 1: Line 1:
 +<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). -->
 +====== Setting up a Recovery Boot Option ======
  
 +===== Overview and Purpose =====
 +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.
 +
 +===== File Preparation =====
 +  - Before you begin to make changes to your system you will need to obtain the file ''​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.
 +  - Enter the root prompt by issuing the command **//su//** or signing into the system as the root user.
 +  - Mount the ''​usbboot.img''​ file using the loopback option into an unused directory such as ''/​mnt/​tmp''​ with the command <​code>​mount -o loop /​tmp/​usbboot.img /​mnt/​tmp</​code>​
 +  - Create a separate directory in your ''/​boot''​ directory to contain the necessary files such as ''/​boot/​recovery''​ with the command <​code>​mkdir /​boot/​recovery</​code>​
 +  - Copy the files from the ''​usbboot.img''​ mounted directory into the newly created recovery directory with the **//cp//** command such as <​code>​cp -rv /mnt/tmp/* /​boot/​recovery/</​code>​
 +  - Unmount the mounted usbboot.img file by issuing the command<​code>​umount /​mnt/​tmp</​code>​
 +
 +===== lilo Configuration =====
 +
 +<​note>​In various cases the installed lilo application may not support the image sizes that are used for the installation medium, such as when attempting to reference the Slackware 14.0 usbboot image from lilo in Slackware 13.37.
 +
 +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.
 +</​note>​
 +
 +Before we begin modifying the lilo configuration you must first
 +understand why the various options are being used.
 +  * **image** points to the kernel image which will be booted.
 +    * For 32-bit Slackware the options are **hugesmp.s** and **huge.s**.
 +    * For 64-bit Slackware the only option is **huge.s**.
 +  * **label** lists the label that will be presented for the option in the bootloader menu.
 +  * **initrd** lists the initial RAM disk that is used to load the temporary file system.
 +  * **password**,​ no explanation needed, enter the password that you wish to use to lock down entry into the boot option.
 +  * **read-only** is used to tell the system to mount the file system as read-only.
 +
 +Using your favorite text editor modify the ''/​etc/​lilo.conf''​ file to include the entry as shown below:
 +<​file>​image = /​boot/​recovery/​huge.s
 +  label = slackware-recovery
 +  initrd = /​boot/​recovery/​initrd.img
 +  password = newpassword
 +  read-only
 +</​file>​
 +
 +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:
 +<​code>​
 +root@darkstar:​~#​ lilo
 +Added linux  *
 +Added recovery
 +</​code>​
 +
 +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:
 +<​code>​chmod 600 /​etc/​lilo.conf</​code>​
 +
 +===== Adding a memtest Option =====
 +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.
 +<​file>​
 +image = /​boot/​recovery/​memtest
 +  label = memtest
 +  password = newpassword
 +  read-only
 +</​file>​
 +
 +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.
 +<​code>​
 +root@darkstar:​~#​ lilo
 +Added linux  *
 +Added recovery
 +Added memtest
 +</​code>​
 +
 +
 +====== Sources ======
 +<!-- If you are copying information from another source, then specify that source -->
 +<!-- * Original source: [[http://​some.website.org/​some/​page.html]] -->
 +<!-- Authors are allowed to give credit to themselves! -->
 +  * Originally written by [[wiki:​user:​mfillpot | mfillpot]] ​
 +<!-- * Contributions by [[wiki:​user:​yyy | User Y]] -->
 +
 +<!-- Please do not modify anything below, except adding new tags.-->
 +<!-- You must remove the tag-word "​template"​ below before saving your new page -->
 +{{tag>​howtos slackware_administration usbboot recovery memtest lilo author_mfillpot}}

In Other Languages
QR Code
QR Code howtos:slackware_admin:recovery_boot_option (generated for current page)