Slackware as a Linux rescue environment: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
* Download from one of the Slackware mirrors the kernel and initrd image, which Slackware uses for the installation:
* Download the kernel and initrd image, which Slackware uses for the installation:
:https://mirrors.slackware.com/slackware/slackware64-15.0/kernels/huge.s/bzImage
:https://slackware.osuosl.org/slackware64-current/kernels/generic.s/bzImage
:https://mirrors.slackware.com/slackware/slackware64-15.0/isolinux/initrd.img
:https://slackware.osuosl.org/slackware64-current/isolinux/initrd.img
It is possible to use <code>bzImage</code> from a different Slackware version (e.g., -current), in this case the directory <code>/lib/modules/X.X.X/</code> inside <code>initrd.img</code> must be upgraded to the same version (see next item for how to unpack <code>initrd.img</code>).  This can be useful to support newer hardware.
* If you have an access to the console and prefer to use it instead of a terminal via ssh, skip all steps related to changing <code>initrd.img</code> and don't use <code>kbd=</code> and <code>nic=</code> parameters in <code>grub.cfg</code>
* Unpack initrd image (as root):
<pre># mkdir dir
# cd dir
# xzcat ../initrd.img | cpio -di
# chroot .</pre>
* Set a root password and do other changes if needed.
* Exit chroot
* Pack the modified initrd image: <code>find . | cpio -o -H newc | xz -9fv -C crc32 > ../initrd.img</code>
* Install a Linux distribution that uses grub as boot loader on the remote server
* Install a Linux distribution that uses grub as boot loader on the remote server
* Put <code>bzImage</code> and <code>initrd.img</code> to /boot/rescue/ directory on the remote server
* Put <code>bzImage</code> and <code>initrd.img</code> to /boot/rescue/ directory on the remote server
Line 22: Line 12:
menuentry "Rescue (Installation Media)" {
menuentry "Rescue (Installation Media)" {
   linux  /boot/rescue/bzImage load_ramdisk=1 prompt_ramdisk=0 rw \
   linux  /boot/rescue/bzImage load_ramdisk=1 prompt_ramdisk=0 rw \
     printk.time=0 SLACK_KERNEL=huge.s \
     printk.time=0 SLACK_KERNEL=generic.s instrootpw=your_root_password \
     kbd=us nic=auto:eth0:static:198.51.100.85:26:198.51.100.65
     kbd=us nic=auto:eth0:static:198.51.100.85:26:198.51.100.65
   initrd /boot/rescue/initrd.img
   initrd /boot/rescue/initrd.img
}
}
</pre>
</pre>
where the network configuration is <code>[ip-address]''':'''[netmask]''':'''[gateway]</code>. For more options see
where the network configuration is <code>[ip-address]''':'''[netmask]''':'''[gateway]</code>.
:http://docs.slackware.com/howtos:slackware_admin:booting_install_from_hdd and
:http://alien.slackbook.org/blog/remote-installation-of-slackware-using-ssh/
* Reboot
* Reboot
* <code>$ ssh root@198.51.100.85</code>
* <code>$ ssh root@198.51.100.85</code>
* <code>source /etc/profile</code>
* <code>source /etc/profile</code>
* Install Slackware in the usual way
* The menuentry from the above <code>grub.cfg</code> can be preserved as a rescue boot option (possibly with unchanged <code>initrd.img</code> and without <code>kbd=</code> and <code>nic=</code> parameters).


[[Category: Linux]]
[[Category: Linux]]
[[Category: Hardware]]
[[Category: Hardware]]

Latest revision as of 18:40, 21 December 2025

  • Download the kernel and initrd image, which Slackware uses for the installation:
https://slackware.osuosl.org/slackware64-current/kernels/generic.s/bzImage
https://slackware.osuosl.org/slackware64-current/isolinux/initrd.img
  • Install a Linux distribution that uses grub as boot loader on the remote server
  • Put bzImage and initrd.img to /boot/rescue/ directory on the remote server
  • Overwrite the content of the file /boot/grub/grub.cfg with the following, mutatis mutandis:
set default=0
set timeout=5

search --set=root --no-floppy --label ROOT

menuentry "Rescue (Installation Media)" {
  linux  /boot/rescue/bzImage load_ramdisk=1 prompt_ramdisk=0 rw \
    printk.time=0 SLACK_KERNEL=generic.s instrootpw=your_root_password \
    kbd=us nic=auto:eth0:static:198.51.100.85:26:198.51.100.65
  initrd /boot/rescue/initrd.img
}

where the network configuration is [ip-address]:[netmask]:[gateway].

  • Reboot
  • $ ssh root@198.51.100.85
  • source /etc/profile