I recently had to move my hard drive from a UEFI system to a BIOS system (strange I know). However, this caused my install to fail to boot as it was partitioned for UEFI systems. I believe I made the necessary changes using GParted and created a bios_grub
partition of size 4M at the start of my drive (sda1) and left my boot partition untouched (sda2). My actual root and home data is on sda3 in a btrfs partition with LUKS encryption. See how it looks in GParted
Using a live usb, I then updated my /etc/fstab
and reinstalled grub onto the new bios_grub
partition as below. I have also include my /etc/default/grub
so you can see my command line parameters.
Chroot in:
root@localhost-live:/home/liveuser# cryptsetup luksOpen /dev/sda3 myvolume
Enter passphrase for /dev/sda3:
root@localhost-live:/home/liveuser# mount /dev/mapper/myvolume /mnt -o subvol=root
root@localhost-live:/home/liveuser# mount /dev/sda2 /mnt/boot
root@localhost-live:/home/liveuser# mount -o bind /dev /mnt/dev
root@localhost-live:/home/liveuser# mount -o bind /proc /mnt/proc
root@localhost-live:/home/liveuser# mount -o bind /sys /mnt/sys
root@localhost-live:/home/liveuser# mount -o bind /run /mnt/run
root@localhost-live:/home/liveuser# chroot /mnt
blkid
output:
[root@localhost-live /]# blkid
/dev/ventoy: BLOCK_SIZE="2048" UUID="2024-10-24-15-04-27-00" LABEL="Fedora-WS-Live-41-1-4" TYPE="iso9660" PTUUID="7c243d72-530f-4837-9421-263adb58fd3a" PTTYPE="gpt"
/dev/mapper/myvolume: LABEL="fedora_localhost-live" UUID="51941106-0b3e-4eb1-8b02-9049aff8f2e7" UUID_SUB="003ee1cd-b94a-465e-bbfb-2b94ca9f6c37" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/sdb2: SEC_TYPE="msdos" LABEL_FATBOOT="VTOYEFI" LABEL="VTOYEFI" UUID="223C-F3F8" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="VTOYEFI" PARTUUID="d712cd63-3622-47d2-87a3-b24ed6065c68"
/dev/sdb1: LABEL="Ventoy" UUID="C4A0-F959" BLOCK_SIZE="512" TYPE="exfat" PTTYPE="dos" PARTLABEL="Ventoy" PARTUUID="8a3ad89f-f065-405c-9ea6-aaecf12d00de"
/dev/loop0: TYPE="squashfs"
/dev/sda4: PARTUUID="1bc9e030-ab8c-49db-840e-af7b75ef43d6"
/dev/sda2: UUID="a56893bd-e666-4eda-b22f-7eac41d71912" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="745a79f8-e42b-474b-a6aa-31533c830908"
/dev/sda3: UUID="1215ebbc-d2e8-425a-899d-1d876f8d6467" TYPE="crypto_LUKS" PARTUUID="3c784936-0ab9-4bb9-a9eb-c89cd7b5ef59"
/dev/sda1: PARTUUID="c8bd6d5c-4dce-4c8f-a1dd-c781489bbd04"
/dev/zram0: LABEL="zram0" UUID="469850d8-46d1-4e18-904a-df980b48105b" TYPE="swap"
fstab contents:
[root@localhost-live /]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Nov 4 01:53:21 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=51941106-0b3e-4eb1-8b02-9049aff8f2e7 / btrfs subvol=root,x-systemd.device-timeout=0 0 0
UUID=a56893bd-e666-4eda-b22f-7eac41d71912 /boot ext4 defaults 1 2
# UUID=F24D-2031 /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=51941106-0b3e-4eb1-8b02-9049aff8f2e7 /home btrfs subvol=home,x-systemd.device-timeout=0 0 0
Reinstalling grub on the new bios_grub
partition:
[root@localhost-live /]# grub2-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
[root@localhost-live /]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
/etc/default/grub
contents:
[root@localhost-live /]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-1215ebbc-d2e8-425a-899d-1d876f8d6467 quiet rhgb"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
[root@localhost-live /]#
However, I am unable to boot into my system and am just dropped at the grub command line when booting off my drive. If I manually try and boot into my drive using the grub command line as below
This works well enough for me to be prompted for my LUKS password which I enter but then I get
mount: /sysroot: unknown filesystem type 'crypto_LUKS' ... Failed to mount sysroot.mount - /sysroot
as below:So I seem to have two problems:
1 - For some reason I never see the grub menu when booting and get dropped into the grub command line where I have to manually set my linux kernel and initramfs
2 - After manually setting my linux kernel and initramfs I am unable to mount my BTRFS LUKS partition
I tried reinstalling the kernel in my chroot environment as I thought that might help but no luck.
I am quite at a loss what to do, I have been reading forum posts for weeks across here, reddit and the arch and ubuntu forums and haven’t been able to make progress past what I have done so far. Any help would be greatly appreciated
Sorry for the poor phone camera photos, I’m not sure how else to get output prior to booting