Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Thursday, 12 January 2023

Slackware 15 install on Thinkpad p53

The following is my account of installing Slackware 15 onto a Lenovo ThinkPad P53


See also previous Debian install here 

This install was forced out of issues that manifested following the upgrade from Debian 10.5 Buster to 11 Bullsleye, as documented here

Firstly, get Slackware 15 ISO from here and burn/copy it to a DVD/USB drive, I chose the latter and used Belena Etcher as I was using my Mac.

I initially chose to use both UEFI and Legacy boot as it was my intention to dual boot both Slackware and Debian, with the latter having been previously installed onto the second hard disk, with windows 10 on the first.

It's worth noting that the naming conventions for these disks are nmve0n1 and nmve1n1 with the first and second partitions being referenced as nmve0n1p1 and nmve0n1p2 for the first disk and nmve0n1p1 and nmve0n1p2 for the second disk.

Slackware installation went as it normally does and I chose to install LILO to the MBR of the first disk as I pretty much always do only this time realized I had made a huge mistake. Following this, I rebooted and was not presented with the LILO screen I was expecting, regardless of which drive I chose to boot into and what was more concerning at this stage is that I could also no longer see the GRUB that allowed me to boot into Debian on the second disk.


So...

 

I could boot using the installation media by running;

boot: huge.s root=/dev/nvme0n1p2 rdinit= ro

where the above pointed to the root (/) partition of my install


The problem (I believe), the drive was partitioned using gpt and LILO didn't seem to like that, apparently gpt partitions do not have a MBR[source needed]

To resolve, I changed the BIOS to Legacy boot and carried out installation again but this time when partitioning the disks, use cfdisk -z /dev/nmve0n1

The -z allows us to start with a fresh layout and as such choose dos/msdos partition type as opposed to gpt.

Additionally and importantly, choosing expert mode to install LILO, adding the partitions and pointing the install location to /dev/nvme0n1

I also decided to add all the other partitions to LILO, even the Debian ones which were on /dev/nvme1n1p* (this was just to give me the option of one of the other ones working in case I had messed up the mappings)

On rebooting, I could see LILO (result) but it would not boot into Slackware with the given correct root partition which was /dev/nvme0n1p2 but interestingly, it would boot into it using /dev/nvme1n1p2 which I found completely bizarre. (lucky I added the additional mappings).

So at this stage, at least I could boot into my installation, albeit using a different LILO boot option.

The LILO installation issue above was documented here

Basically, I had to change the way the disks were referenced in both /etc/fstab and /etc/lilo.conf to use the UUID's, this was done using the guide here

Firstly, to sort out /etc/fstab

In summary, get the UUID of the disks by running sudo blkid for the /etc/fstab

A completed  example is as below, with the original mount points commented out;

#/dev/nvme0n1p4   
UUID=c6d4635d-b761-4444-a442-5fe48a7590c8    swap             swap        defaults         0   0

#/dev/nvme0n1p2   
UUID=3b1d3213-540a-415c-bc33-fb925cd431a2    /                reiserfs    defaults         1   1

#/dev/nvme0n1p1
UUID=ed82b79a-ee90-45a1-b182-5f58c9ffc1c8    /boot            ext2        defaults         1   2

#/dev/nvme0n1p3
UUID=a3f0d62e-3157-41ad-a1ee-76ffed48349d    /home            reiserfs    defaults         1   2

#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0

 

Then, to sort out /etc/lilo.conf

We need to get the disk-by-id for the boot variable for /etc/lilo.conf from ls /dev/disk/by-id -al

The value used is highlighted in the below example;

lrwxrwxrwx 1 root root   9 Jan 12 08:00 ata-Crucial_CT500MX200SSD1_15261055680A -> ../../sda
lrwxrwxrwx 1 root root  10 Jan 12 08:00 ata-Crucial_CT500MX200SSD1_15261055680A-part1 -> ../../sda1
lrwxrwxrwx 1 root root  13 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_201954442304 -> ../../nvme1n1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_201954442304-part1 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_201954442304-part2 -> ../../nvme1n1p2
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_201954442304-part3 -> ../../nvme1n1p3
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_201954442304-part4 -> ../../nvme1n1p4
lrwxrwxrwx 1 root root  13 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877 -> ../../nvme0n1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877-part4 -> ../../nvme0n1p4

lrwxrwxrwx 1 root root  13 Jan 12 08:00 nvme-eui.001b444a44fa43be -> ../../nvme1n1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b444a44fa43be-part1 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b444a44fa43be-part2 -> ../../nvme1n1p2
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b444a44fa43be-part3 -> ../../nvme1n1p3
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b444a44fa43be-part4 -> ../../nvme1n1p4
lrwxrwxrwx 1 root root  13 Jan 12 08:00 nvme-eui.001b448b4639e799 -> ../../nvme0n1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b448b4639e799-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b448b4639e799-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b448b4639e799-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root  15 Jan 12 08:00 nvme-eui.001b448b4639e799-part4 -> ../../nvme0n1p4


Almost done...

Before we create the lilo config file, we need to make an initrd using mkinitrd

There  is a /usr/share/mkinitrd/mkinitrd_command_generator.sh which will help with making the initrd and should be run first. The -k option can be used to point to the kernel, if you have more than one kernel installed, otherwise, just running the command on it's own will suffice.

An example would be;
/usr/share/mkinitrd/mkinitrd_command_generator.sh

which in my case returned;

#
# mkinitrd_command_generator.sh revision 1.45
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 5.15.19 -f reiserfs -r /dev/nvme0n1p2 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:reiserfs -u -o /boot/initrd.gz

 

The above would then be the command to create the initrd file, but...

We need to change the -r location (in my case /dev/nvme0n1p2) to match that of the root partition, we get this from running blkid

It is also advisable to change the /boot/initrd.gz to somehthing relating to the current kernel version, in my case this was changed to /boot/initrd-5.15.19.gz

So in my example, the command would have looked like;

 
mkinitrd -c -k 5.15.19 -f reiserfs -r "UUID=3b1d3213-540a-415c-bc33-fb925cd431a2" -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:reiserfs -u -o /boot/initrd-5.15.19.gz

 

An extract from /etc/lilo.conf should look like the below, with old entry commented out;

#boot = /dev/nvme0n1
boot = /dev/disk/by-id/nvme-WDC_PC_SN730_SDBQNTY-512G-1001_20229A802877

...

image = /boot/vmlinuz
  initrd = /boot/initrd-5.15.19.gz
  root = /dev/nvme0n1p2
  label = Slackware
  read-only

Finally

We have then just run lilo which will install lilo using the boot variable. Note: lilo -t will test the lilo.conf file.


 

 

 

 

 

 

 

 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.