This article explains how to convert a given Linux distribution to a Slackware
one in an OVHcloud server. I wrote in the past an article about doing the same for OVH kimsufi.
It is inspired by the Slackware
wiki page Install Slackware on an online.net Dedibox BareMetal Server, which explains the same for a Dedibox BareMetal Server on online.net.
The plan is to
- install a
Linux
of your choice - reboot in rescue mode that
Linux
distro - download the
Slackware
initrd and prepare the install environment - download the set of
Slackware
packages to be installed - chroot into the
Slackware
initrd image - partition and install
Slackware
over the existingLinux
- configure the fresh installed
Slackware
and reboot
Install a Linux
distribution
Enter the "Dedicated servers" control panel, click over "Operating system (OS)" and then the "Install my server" button:
Select a Linux
distro of your choice, that is Debian
12
in my example. You can leave "Basic" as the "Type of OS" and decide not to customize the partion configuration (you will do it during the Slackware
installation):
Click "Next". In the next screen select 1 as the "Number of disks partioned" so that you don't have to bother to erase the software RAID 1 that OVH will build for you by default.
The partions are already configured and you don't need to customize anything else. Click "Next" to proceed with the install of the temporary Debian
OS.
Once the installation has finished, you will get the ssh
login in your mailbox (debian@111.222.333.444
).Take note of the net configuration (ip, gateway, name servers):
> ip r default via 111.222.333.254 dev eno1 proto dhcp src 111.222.333.444 metric 100
so our gateway is 111.222.333.254
and our ip is 111.222.333.444
.
Let's check the same for ipv6:
> ip -6 r ::1 dev lo proto kernel metric 256 pref medium 2001:aaaa:b:cccc::1 dev eth0 proto kernel metric 256 pref medium default via 2001:aaaa:b:dddd:ff:ff:ff:ff dev eth0 metric 1024 onlink pref medium
Our ipv6 is 2001:aaaa:b:cccc::1
and the gateway is 2001:aaaa:b:dddd:ff:ff:ff:ff
.
Be aware that in OVHcloud
the same network informations can be retrieved in the control panel.
Browse your resolv.conf to copy the name servers' ip
> more /etc/resolv.conf nameserver 2001:41d0:3:163::1 nameserver 213.186.33.99
In rescue mode
Now reboot your server in rescue mode by editing the "Boot" button of the OVH's control panel and then "Boot in rescue mode". Choose rescue12-customer
and enter your email to get the login details:
Confirm and then restart your server:
Now retrieve the userid and password from your email and connect to your server via ssh
.
Setting-up the Slackware
installer environment
The Linux environment where we are living now has nothing to do with the Debian
OS that we have installed earlier. You can mount your /dev/sda* or /dev/nvme* partitions with your Debian
installation if you like.
Now it's the time to prepare the Slackware
installer setup:
mkdir -p ~/slackware-chroot cd ~/slackware-chroot wget https://slackware.osuosl.org/slackware64-15.0/isolinux/initrd.img xz -dc < initrd.img | cpio -i --make-directories mount --bind /proc proc mount --bind /sys sys mount --bind /dev dev mount --bind /dev/pts dev/pts mount --bind /run run touch etc/resolv.conf mount --bind /etc/resolv.conf etc/resolv.conf
Here we have pulled down a Slackware
initrd
image and decompressed it. Then we have mounted some suitable system directories. Mounting /etc/resolv.conf will provide DNS
to the environment were we are going to chroot
to run the setup program.
Partition
Now you can (re)partition your disk, or use the partition table that you have already created when installing Debian
. You can edit the partition table with your favourite partitioning tool, e.g. fdisk
, cfdisk
, etc. in the usual way.
In case you have to build Logical Volumes (LVM), you may want to have a look to the page I wrote here.
Download the packages
I prefer to download the required packages myself, instead of letting the setup program do it for me, because I want a minimal system. I have prepared a download shell script and a list of Slackware packages to be downloaded. The script let you choose the Slackware
version, your favourite mirror and your package list file (it's available a package list for current as well), were you have to put the packages to download one per line. The script is able to download also the packages from the "patches" folder.
mkdir -p ~/slackware-chroot cd ~/slackware-chroot wget https://raw.githubusercontent.com/sagredo-dev/Slackware-minimal/refs/heads/main/PKG_LIST_15.0 wget https://raw.githubusercontent.com/sagredo-dev/Slackware-minimal/refs/heads/main/download_slack_pkg.sh chmod +x download_slack_pkg.sh # run the download program ./download_slack_pkg.sh
The packages will be downloaded into ~/slackware-chroot/slackware${ARCH}-${VERSION}_pkg/a (which should be ~/slackware-chroot/slackware64-15.0_pkg/a). The directory is created by the program itself.
If you are wondering why the packages are stored in an /a subfolder, it's just to satisfy the setup program, that would not find their location otherwise (I got this issue with Slackware
current).
Install Slackware
Enter the Slackware
chroot:
chroot ~/slackware-chroot /bin/bash --login export TERM=xterm
Now that you have done the partitions and downloaded the Slackware
packages (you have them in the /slackware64-15.0_pkg dir in your chroot environment) you can run the setup program and perform the installation as you have always done before. Just remember that:
- if you downloaded the packages before, you have to point the setup to the /slackware64-15.0_pkg directory. Otherwise, let the installation program download and install them for you.
- you don't have to reboot the machine at the end of the installation, as you still have to do a couple of configurations.
- if you have an
EFI
boot, and you have something already installed in /boot/efi/EFI like /boot/efi/EFI/Debian, you must remove that directory, otherwise yourSlackware
won't boot.
Configure the installed Slackware
You can look at the root filesystem of the freshly installed Slackware
navigating to the /mnt directory, where it's still mounted after the installation.
You may also want to comment out the following lines in /etc/inittab:
#c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux #c2:12345:respawn:/sbin/agetty 38400 tty2 linux #c3:12345:respawn:/sbin/agetty 38400 tty3 linux #c4:12345:respawn:/sbin/agetty 38400 tty4 linux #c5:12345:respawn:/sbin/agetty 38400 tty5 linux #c6:12345:respawn:/sbin/agetty 38400 tty6 linux
and the following lines in /etc/securetty:
#tty1 #tty2 #tty3 #tty4 #tty5 #tty6
tty[1-6]
are for the standard VT login prompts, but since we have no keyboard and no display, we cannot make any use of them.
Before rebooting, configure the SSH
server as you like. I have just enabled the root
login for the time being. I will disable it after the reboot, when the rsa key
is in place. Edit your /mnt/etc/ssh/sshd_config file and add this line:
PermitRootLogin yes
Now, go to the OVHcloud
control panel and select "Boot" again. You have to enable the boot from the hard disk:
Now reboot your server and you are done.
Troubleshooting
As already mentioned, if you have an EFI
boot, and you have something already installed in /boot/efi/EFI like /boot/efi/EFI/Debian, you must remove that directory, otherwise your Slackware
won't boot. But this cannot be enough for a correct use of Slackware
. In fact, after my apparently successfull installation of Slackware
, I noticed that the kernel parameters added to the append="" option in elilo.conf were ignored:
# cat /proc/cmdline \EFI\Slackware\vmlinuz initrd=EFI\Slackware\initrd.gz
This means that the EFI
boot loader is probably passing these parameters from a remaining EFI
boot entry of the previous Debian
install.
Actually, if I type efibootmgr -v
I can see several entries that have nothing to do with the Slackware
installation. To solve the issue let's erase all entries and reinstall the Slackware EFI
entry with eliloconfig
.
Erase all the existing EFI
boot entries:
efibootmgr | grep Boot | awk '{print $1}' | sed 's/Boot//;s/\*//' | while read id; do efibootmgr -b "$id" -B done
Now the boot menu is empty:
# efibootmgr -v BootCurrent: 0000 Timeout: 2 seconds No BootOrder is set; firmware will attempt recovery
Install a new Slackware
entry with eliloconfig
. You have to select "Install a boot menu entry" here
efibootmgr -v
should now show the newly created Slackware
entry and anything else:
# efibootmgr -v BootCurrent: 0000 Timeout: 2 seconds BootOrder: 0000 Boot0000* Slackware HD(1,GPT,7abf0ed3-61e1-cf41-a8b1-0c81cbd92c29,0x800,0x2f800)/File(\EFI\Slackware\elilo.ef i) dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 f8 02 00 00 00 00 00 d3 0e bf 7a e1 61 41 cf a8 b1 0c 81 cb d9 2c 29 02 02 / 04 04 36 00 5c 00 45 00 46 00 49 00 5c 00 53 00 6c 00 61 00 63 00 6b 00 77 00 61 00 72 00 65 00 5c 00 65 00 6c 00 69 00 6c 00 6f 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Check that you have the following in /boot/efi/EFI/Slackware/
# ls -l /boot/efi/EFI/Slackware/ total 26688 -rwxr-xr-x 1 root root 165 Jun 22 11:50 elilo.conf -rwxr-xr-x 1 root root 239734 Aug 5 2022 elilo.efi -rwxr-xr-x 1 root root 12868764 Jun 22 10:35 initrd.gz -rwxr-xr-x 1 root root 14201344 Jun 20 00:47 vmlinuz
Edit your elilo.conf and add a test string at the end of the append
option (quiet
in the following example):
append="root=/dev/nvme0n1p2 vga=normal ro quiet"
Now reboot and verify that the kernel parameters from elilo
have been parsed:
# cat /proc/cmdline
BOOT_IMAGE=dev000:\EFI\Slackware\vmlinuz root=/dev/nvme0n1p2 vga=normal ro quiet ro
This article is licensed under the following license: CC Attribution-Share Alike 4.0 International