friendica.eskimo.com

Linux - Rescue OS Help

I'm trying to setup a new server which among other things will take over the friendica.eskimo.com/ node.

I have the primary OS installed, and then have a separate partition on a drive that isn't part of the bootable drive set, it is a mdraid partition just like the primary but on a different raid device The idea is if something gets scribbled preventing the primary OS from booting, I can boot it to straighten out whatever is broken.

The primary OS root partition is /dev/md0p1, the rescue OS root partition is /dev/md2p1, there is no separate /boot partition, and since it is UEFI, no bios_grub partition. There is only one EFI system disk at /dev/nvme0n1p1, I would rather have two but the UEFI bios on this machine doesn't seem to like that.

I started by installing the primary OS, then copied the entire root partition to /dev/md2p1, and changed the root entry in /etc/fstab and then mounted the secondary OS root partition on /mnt.

Then I did:
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --rbind /sys /mnt/sys
mount --rbind /opt /mnt/opt

Then I chroot'd to /mnt and after checking /etc/fstab and /etc/grub.d/grub.cfg to make sure the root partition was correct I did:

update-initramfs -u
update-grub2

Now when I boot the machine and use F8, I see the original boot disk, /dev/nvme0n1 and if I boot the main OS everything works as expected, but if I select my new rescue OS, it starts up with the / partition being /dev/md0p1 instead of /dev/md2p1.

Thinking I must have missed editing the root file system somewhere, I
mounted /dev/md2p1 on /mnt, chroot'd to that again, and then did:

blkid /dev/md0p1 (get the block ID of the original root device)

find /etc -type f -exec grep 'block id of original root' {} /dev/null \;

To look for any conf's with the original blkid for the original root file system and did not find any.

It has in the boot menu Ubuntu on /dev/md0p1 and Ubuntu on /dev/md2p1, but
when I choose the latter it's still mounting /dev/md0p1 as the root.

Any ideas what I may have missed?

Shoreline, WA, USA
Finally solved this, did work with a second system disk but did not have the boot flag set.