Converting a Linux installation to a Slackware one in an OVHcloud server

June 17, 2025 by Roberto Puzzanghera 0 comments

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

  1. install a Linux of your choice
  2. reboot in rescue mode that Linux distro
  3. download the Slackware initrd and prepare the install environment
  4. chroot into the Slackware initrd image
  5. partition and install Slackware over the existing Linux
  6. configure the fresh installed Slackware and reboot


Install a Linux distribution

Enter the "Dedicated servers" control panel, click the "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 in the "Number of disks partioned" if you don't want to bother erasing later 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 in 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 exact net 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" in the following panel. 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 (which should be ~/slackware-chroot/slackware64-15.0_pkg). The directory is created by the program itself.

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.
  • in the /slackware64-15.0_pkg you''l find out that the packages are stored in an "/a" subfolder. This is just to satisfy the setup program, that would not find their location otherwise (I got this issue with Slackware current).
  • 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 should remove that directory, otherwise your Slackware 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 machine and you are done.


This article is licensed under the following license: CC Attribution-Share Alike 4.0 International

Add a comment

Recent comments
Recent posts

RSS feeds