Slackware as a Linux rescue environment: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
*Download from one of the Slackware mirrors the kernel and initrd image, which Slackware uses for the installation:
* Download from one of the Slackware mirrors the kernel and initrd image, which Slackware uses for the installation:
:http://mirrors.slackware.com/slackware/slackware64-15.0/kernels/huge.s/bzImage
:https://mirrors.slackware.com/slackware/slackware64-15.0/kernels/huge.s/bzImage
:http://mirrors.slackware.com/slackware/slackware64-15.0/isolinux/initrd.img
:https://mirrors.slackware.com/slackware/slackware64-15.0/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.
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.
*Unpack initrd image (as root):
* Unpack initrd image (as root):
<pre># mkdir dir
<pre># mkdir dir
# cd dir
# cd dir
# xzcat ../initrd.img | cpio -di</pre>
# xzcat ../initrd.img | cpio -di
*[[Chroot]] to dir and set a root password; exit chroot
# chroot .</pre>
*Pack the modified initrd image: <code>cd dir; find . | cpio -o -H newc | xz -9fv > ../initrd.img</code>
* Set a root password; exit chroot
*Install a Linux distribution (e.g., Debian) on the remote server
* Pack the modified initrd image: <code>find . | cpio -o -H newc | xz -9fv -C crc32 > ../initrd.img</code>
*Put <code>bzImage</code> and <code>initrd.img</code> to /boot/slack/ directory on the remote server
* Install a Linux distribution (e.g., Debian) on the remote server
* Put <code>bzImage</code> and <code>initrd.img</code> to /boot/rescue/ directory on the remote server
*Overwrite the content of the file <code>/boot/grub/grub.cfg</code> with the following, mutatis mutandis:
*Overwrite the content of the file <code>/boot/grub/grub.cfg</code> with the following, mutatis mutandis:
<pre>set default=0
<pre>set default=0
set timeout=0
set timeout=5
set root='mduuid/b8608ac730803da4ddddedeb768a2e24'
 
menuentry "Slackware 14.2 install" {
search --set=root --no-floppy --label ROOT
   linux  /slack/bzImage load_ramdisk=1 prompt_ramdisk=0 rw \
 
                              printk.time=0 SLACK_KERNEL=huge.s \
menuentry "Rescue (Installation Media)" {
        kbd=us nic=auto:eth0:static:198.51.100.85:26:198.51.100.65
   linux  /boot/rescue/bzImage load_ramdisk=1 prompt_ramdisk=0 rw \
   initrd /slack/initrd.img
    printk.time=0 SLACK_KERNEL=huge.s \
}</pre>
    kbd=us nic=auto:eth0:static:198.51.100.85:26:198.51.100.65
   initrd /boot/rescue/initrd.img
}
</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>.  For more options see
:http://docs.slackware.com/howtos:slackware_admin:booting_install_from_hdd and
:http://docs.slackware.com/howtos:slackware_admin:booting_install_from_hdd and

Revision as of 20:34, 16 July 2022

  • Download from one of the Slackware mirrors the kernel and initrd image, which Slackware uses for the installation:
https://mirrors.slackware.com/slackware/slackware64-15.0/kernels/huge.s/bzImage
https://mirrors.slackware.com/slackware/slackware64-15.0/isolinux/initrd.img

It is possible to use bzImage from a different Slackware version (e.g., -current), in this case the directory /lib/modules/X.X.X/ inside initrd.img must be upgraded to the same version (see next item for how to unpack initrd.img). This can be useful to support newer hardware.

  • Unpack initrd image (as root):
# mkdir dir
# cd dir
# xzcat ../initrd.img | cpio -di
# chroot .
  • Set a root password; exit chroot
  • Pack the modified initrd image: find . | cpio -o -H newc | xz -9fv -C crc32 > ../initrd.img
  • Install a Linux distribution (e.g., Debian) 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=huge.s \
    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]. For more options see

http://docs.slackware.com/howtos:slackware_admin:booting_install_from_hdd and
http://alien.slackbook.org/blog/remote-installation-of-slackware-using-ssh/
  • Reboot, then run source /etc/profile
  • Install Slackware in the usual way