I have a messed up UEFI implementation, and can't seem to get CentOS' entry working again. Originally, both CentOS on /dev/sdb and Gentoo on /dev/sda could be loaded from a GrUB menu when starting the laptop. The boot order in GrUB was controlled by the GrUB on CentOS, not Gentoo.
Last week I decided to move it to Gentoo, and now I can't boot CentOS at all. I was able to get it to boot Gentoo again by using the "File Browser Add Boot Options" and navigating to the /EFI/gentoo/grubx64.efi entry, but can't seem to do the same for CentOS. (It is a Dell XPS 15 9530) NB: I would be quite happy to somehow add CentOS to Gentoo's GrUB menu and boot from it.
I've booted the laptop, gone into Setup, and removed all the "Boot Option Priorities" via "File Browser Del Boot Options". No matter how many times I have done this, it will always, somehow, restore the Ubuntu entry, which was on sdb before CentOS. Even when I removed all the options, hit F10 to Save and reboot, hit F12 to get the Boot Option menu, it has UEFI Options: Ubuntu and USB1 - UEFI OS (which is CentOS USB).
I am trying to add CentOS' GrUB from /dev/sdb by booting the CentOS USB and choosing Troubleshooting --> Restore a CentOS system. This allows me to:
1) Continue, then enter my LUKS passphrase, then for Boot Selection it offers:
[x] 1) Unknown Linux on /dev/sda3
[ ] 2) CentOS Linux Linux 7.5.1804 for x86_64 on /dev/mapper/centos-root
After choosing 2 for CentOS then c to continue, it states the system has been mounted at /mnt/sysimage and press Enter to get a shell and run `chroot /mnt/sysimage` to make your system the root environment. I can chroot, but can't seem to get the correct combination to get a CentOS entry to UEFI and boot it.
Previously I have entered `efibootmgr -c -L CentOS -l /EFI/centos/grubx64 -d /dev/sdb` (and also /dev/sda) as well as other options under /boot/efi/EFI/centos/ but none results in a bootable entry.
These are details of disks, specifically for /dev/sdb:
Code:
/etc/fstab:
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs 26G 19G 7.3G 72% /
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 3.9G 17M 3.9G 1% /run
/dev/sdb2 xfs 1014M 281M 734M 28% /boot
/dev/sdb1 vfat 200M 11M 190M 6% /boot/efi
/dev/sdd1 xfs 15G 6.0G 8.8G 41% /mnt/gentoo
Code:
fdisk -l /dev/sd[b,a]:
Disk /dev/sdb: 32.0 GB, 32017047552 bytes, 62533296 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
Disk label type: gpt
Disk identifier: 866F27F1-9A02-4865-826A-149D5C963E6B
# Start End Size Type Name
1 2048 411647 200M EFI System EFI System Partition
2 411648 2508799 1G Microsoft basic
3 2508800 62531583 28.6G Microsoft basic
Disk /dev/sda: 512.1 GB, 512110190592 bytes, 1000215216 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
Disk label type: gpt
Disk identifier: CAE3F3FC-01B5-403E-AF15-FBDDAB7395D0
# Start End Size Type Name
1 2048 1026047 500M EFI System EFI System
2 1026048 9414655 4G Linux swap Linux swap
3 9414656 219129855 100G Linux filesyste Linux filesystem
4 219129856 1000215182 372.5G Linux filesyste Linux filesystem
Code:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 500M 0 part
├─sda2 8:2 0 4G 0 part [SWAP]
├─sda3 8:3 0 100G 0 part
└─sda4 8:4 0 372.5G 0 part
sdb 8:16 0 29.8G 0 disk
├─sdb1 8:17 0 200M 0 part /boot/efi
├─sdb2 8:18 0 1G 0 part /boot
└─sdb3 8:19 0 28.6G 0 part
└─luks-91958809-4dcf-441a-82fe-d210b830b89e 253:2 0 28.6G 0 crypt
├─centos-swap 253:3 0 3G 0 lvm [SWAP]
└─centos-root 253:4 0 25.6G 0 lvm /
Code:
mount (with LiveUSB and a flash drive):
/dev/mapper/centos-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sdb2 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sdb1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=4010000k,nr_inodes=1002500,mode=755)
devpts on /dev/pts type devpts (rw,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,seclabel)
proc on /proc type proc (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
sysfs on /sys type sysfs (rw,relatime,seclabel)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
/dev/sdd1 on /mnt/gentoo type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
Code:
parted /dev/sdb print:
Model: ATA Micron C400 Real (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 211MB 210MB fat16 EFI System Partition boot
2 211MB 1285MB 1074MB xfs
3 1285MB 32.0GB 30.7GB
Does anyone know how to fix this so I can create a bootable entry for CentOS?