Fixing BooBoos with Multiple Linux Distros on Lenovo P70 ThinkPad Mobile Workstation

Anecdotal Video

This video from the Hunt for Red October seems somewhat relevant here to my funny way of thinking so I'm including the link here (and also because it's a good clip imho). When you have Linux problems, well, "just turn into it and close the distance".

Summary

I'm doing work with OpenvSwitch and LXC on UEK4 kernel. I need a script to run for the OpenvSwitch onboot. I'm not sure how to do this on Oracle Linux 7 (I know how to set this up on Ubuntu) and I'm experimenting. Being only saavy on network topics I need for Oracle, As anyone who has futzed with network configurations knows from experience, this is a great way to bork your boot if you make a mistake or misconfiguration.

Since most of my network expertise if around OpenvSwitch and LXC, it means I'm not a fully-qualified linux network expert by any means. I made a change to /sbin/ifup-local hoping it would solve what I needed, but instead it borked boot of Oracle Linux all kernels of course. Now what? Well, if you have multiple Linux OS distros installed on Lenovo P70 Mobile Workstation, fixing such mistakes is really much easier than before because you can use your other Linux distro on the M.2 NVMe to fix the issue with the Linux distro on the SSD (or vice versa) for rescue operations. Here's what happened.

BTW the funny thing about this is that I was "reinventing the wheel" with this desultory activity because I had already solved this problem as documented here but had forgotten it!

Problem

I put the following in /sbin/ifup-local and removed the safety measures by removing the if-then-else clause (wrong!). Now my Oracle Linux won't boot into the desktop. So now I have to edit or remove /sbin/ifup-local. How to do this? Well, if you have multiple UEFI-boot Linux OS on your Lenovo P70 and using LVM for all OS you can just mount the root LVM of the Oracle Linux in the Ubuntu OS and make the fix. Shown below, "ol-root" is the LVM root volume of my Oracle Linux 7 on the SSD. I've booted into the Ubuntu on the M.2 NVMe and now will fix the bad configuration on the Oracle Linux. Easy.

oracle@u1604:~$ ls -l /dev/mapper

total 0

crw------- 1 root root 10, 236 Oct 12 11:22 control

lrwxrwxrwx 1 root root 7 Oct 12 11:22 ol-home -> ../dm-3

lrwxrwxrwx 1 root root 7 Oct 12 11:22 ol-root -> ../dm-4

lrwxrwxrwx 1 root root 7 Oct 12 11:22 ol-swap -> ../dm-2

lrwxrwxrwx 1 root root 7 Oct 12 11:22 ubuntu--vg-root -> ../dm-0

lrwxrwxrwx 1 root root 7 Oct 12 11:22 ubuntu--vg-swap_1 -> ../dm-1

oracle@u1604:~$ cd /mnt

oracle@u1604:/mnt$ ls -lrt

total 0

oracle@u1604:/mnt$

oracle@u1604:~$ sudo mount /dev/mapper/ol-root /mnt

[sudo] password for oracle:

oracle@u1604:~$ df -TH

Filesystem Type Size Used Avail Use% Mounted on

udev devtmpfs 34G 0 34G 0% /dev

tmpfs tmpfs 6.8G 10M 6.8G 1% /run

/dev/mapper/ubuntu--vg-root ext4 917G 5.0G 866G 1% /

tmpfs tmpfs 34G 213k 34G 1% /dev/shm

tmpfs tmpfs 5.3M 4.1k 5.3M 1% /run/lock

tmpfs tmpfs 34G 0 34G 0% /sys/fs/cgroup

/dev/nvme1n1p2 ext2 496M 119M 352M 26% /boot

/dev/nvme1n1p1 vfat 536M 3.8M 533M 1% /boot/efi

tmpfs tmpfs 6.8G 4.1k 6.8G 1% /run/user/108

tmpfs tmpfs 6.8G 54k 6.8G 1% /run/user/1000

/dev/mapper/ol-root xfs 54G 19G 36G 35% /mnt

oracle@u1604:~$ cd /mnt/sbin

oracle@u1604:/mnt/sbin$ ls -l ifup-local

-rwxr-xr-x. 1 root root 51 Oct 12 11:18 ifup-local

oracle@u1604:/mnt/sbin$ cat ifup-local <-- Not a good idea to have added this file in this form - borked boot on Oracle Linux

#!/bin/sh

/etc/network/openvswitch/crt_ovs_sw1.sh

oracle@u1604:/mnt/sbin$ sudo rm ifup-local <-- Since it's a file I added/created I can just delete it.

oracle@u1604:/mnt/sbin$

Now go ahead and reboot into the Oracle Linux. Problem solved. No need for a rescue disk.