Dual booting Arch Linux and Ubuntu on separate SSDs

 

Issues

I have Arch Linux on one SSD disk and I installed Ubuntu on a new SSD disk. Upon system restart it booted automatically with the GRUB configuration that Ubuntu had installed, not the GRUB configuration that I had for my Arch Linux - BIOS/EFI prioritized the disk Ubuntu is on (issue A, see below). Also this GRUB configuration had an os-prober-generated grub.cfg “menuentry” to boot into my Arch Linux installation (issue B), which unsurprisingly did not work.

Disk setup

I chose identical setup for both of the SSD’s - and thus an EFI partition in the 2 of them.

[root@arch-pc grub.d]# fdisk -l
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: ADATA SP580     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A1ADEEAF-4A37-4807-9C99-6F4B2AAB79D8

Device        Start       End   Sectors  Size Type
/dev/sda1      2048    534527    532480  260M EFI System
/dev/sda2    534528  42477567  41943040   20G Linux filesystem
/dev/sda3  42477568  46671871   4194304    2G Linux swap
/dev/sda4  46671872 214444031 167772160   80G Linux filesystem


Disk /dev/sdb: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: ADATA SU650     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1FBFA320-D304-491E-8AF8-E5965EB695FF

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048    999423    997376   487M EFI System
/dev/sdb2     999424 157249535 156250112  74.5G Linux filesystem
/dev/sdb3  157249536 161155071   3905536   1.9G Linux swap
/dev/sdb4  161155072 468860927 307705856 146.7G Linux filesystem


Disk /dev/mapper/casa: 79.98 GiB, 85882568704 bytes, 167739392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Issue A

First, the problem is that the Ubuntu drive took priority of the Arch drive. Restart, F12 -> BIOS settings. I’ve changes the boot priority to the disk containing Arch.



Issue B - disabling OS prober, so it does not scan drives for OS’es

I’ve added to /etc/default/grub in both of the OS’es:

GRUB_DISABLE_OS_PROBER=true

Adding a grub.cfg “menuentry” for Ubuntu in ArchLinux

Ubuntu root partition is is on /dev/sdb2

[root@arch-pc coffee]# mount /dev/sdb2 /mnt/astules/

Finding the disk number of the disk on which Ubuntu is and the partition of the / mount. Note the “hd1” and “gpt2” in the output.

[root@arch-pc grub.d]# cat /mnt/astules/boot/grub/grub.cfg | grep "set root" | tail -n1
        set root='hd1,gpt2'

By instruction from https://wiki.archlinux.org/index.php/GRUB#GNU/Linux add to /etc/grub.d/40_custom in the Arch Linux partition:

menuentry "Astules Ubuntu"  {
        insmod part_gpt
        insmod btrfs
        insmod ext2
        set root='hd1,gpt2'
        configfile /boot/grub/grub.cfg
}

Updating grub.cfg

[root@arch-pc grub.d]# grub-mkconfig -o /boot/grub/grub.cfg

Reboot.

Success:



Popular posts from this blog

AWS VPN Client on a guest VM

Cyberghost Vpn on Arch Linux

Building collections: Immutable Clojure vs mutable OOP