I did backup of my system with a tarball, installed windows and installed Fedora afterwards.
I got the system up after a restore, but I assume the luksUUID has changed since then and that is why my grub2 won't boot. (I had no issues prior to running grub2-mkconfig).
Some info:
==========> I ran:
grub2-mkconfig -o /boot/grub2/grub.cfg
<reboot>
--> would not boot
==========> I tried:
cryptsetup luksOpen /dev/sdb6 rescue
<mount all partitions and bind dev proc sys etc.>
chroot /mnt/root
<backup of all .img files under /boot>
dracut --force --regenerate-all
<still same>
updated UUIDs from what I see with blkid from the liveCD and I still get no further. Even after rerunning the grub2-mkconfig command.
and
------------
==========> sample entry in grub.cfg:
menuentry 'Fedora (4.11.10-100.fc24.x86_64) 24 (Workstation Edition)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.11.10-100.fc24.x86_64-advanced-23a852e6-48ac-4403-8018-fb59e8adf37b' {
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 16aa3500-11b0-433b-8faa-b04221b861fa
else
search --no-floppy --fs-uuid --set=root 16aa3500-11b0-433b-8faa-b04221b861fa
fi
linux16 /vmlinuz-4.11.10-100.fc24.x86_64 root=/dev/mapper/fedora-root ro RD.LVM.LV=fedora/root RD.LUKS.UUID=luks-f663f2d4-fccf-40ee-b886-45d42838bf87 RD.LVM.LV=fedora/swap RHGB QUIET
initrd16 /initramfs-4.11.10-100.fc24.x86_64.img
}
-------------------
==========> fstab
[root@localhost /]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Jul 20 04:04:34 2017
#
# 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
#
/dev/mapper/fedora-root / ext4 defaults,x-systemd.device-timeout=0 1 1
UUID=16aa3500-11b0-433b-8faa-b04221b861fa /boot ext4 defaults 1 2
/dev/mapper/fedora-home /home ext4 defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora-opt /opt ext4 defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora-tmp /tmp ext4 defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora-var /var ext4 defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora-var_log /var/log ext4 defaults,x-systemd.device-timeout=0 1 2
/dev/mapper/fedora-swap swap swap defaults,x-systemd.device-timeout=0 0 0
/dev/sda2 /mnt/DATA ntfs defaults 0 0
/dev/sdc2 /mnt/LNX_DATA ext4 defaults 0 0
[root@localhost /]#
----------------------------
==========> grub cfg (removed vfio as i am going to be dualbooting windows rather than have windows in a KVM vm - this is where I noticed the RD.LUKS.UUID differance, commented line is the old one)
[root@localhost /]# 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.LVM.LV=FEDORA/ROOT RD.LUKS.UUID=LUKS-BCF8E807-3C11-4FBF-89BE-0D41D0EE05FB RD.LVM.LV=FEDORA/SWAP RHGB QUIET INTEL_IOMMU=ON VFIO-PCI.IDS=10DE:1B81,10DE:10F0"
GRUB_CMDLINE_LINUX="RD.LVM.LV=fedora/root RD.LUKS.UUID=luks-f663f2d4-fccf-40ee-b886-45d42838bf87 RD.LVM.LV=fedora/swap RHGB QUIET"
GRUB_DISABLE_RECOVERY="false"
GRUB_GFXPAYLOAD_LINUX=text
[root@localhost /]#
-----------------------------------
==========> info from blkid UUIDs etc. fetched from booted LiveCD
[root@localhost liveuser]# blkid |grep crypto
/dev/sdb6: UUID="f663f2d4-fccf-40ee-b886-45d42838bf87" TYPE="crypto_LUKS" PARTUUID="5ac43570-06"
[root@localhost liveuser]# blkid |grep fedora
/dev/mapper/fedora-root: UUID="23a852e6-48ac-4403-8018-fb59e8adf37b" TYPE="ext4"
/dev/mapper/fedora-home: UUID="77342abb-5731-4684-b83b-bc67f520f284" TYPE="ext4"
/dev/mapper/fedora-swap: UUID="3e9f367d-63c8-4757-b5aa-ab61bddf4eea" TYPE="swap"
/dev/mapper/fedora-var: UUID="090c6765-abad-4f46-b7e7-130f4402af06" TYPE="ext4"
/dev/mapper/fedora-opt: UUID="78d0c62e-39b1-4020-b156-fb38ed3be900" TYPE="ext4"
/dev/mapper/fedora-tmp: UUID="64b2dae3-89ae-4578-9ddb-7a1a48611ed5" TYPE="ext4"
/dev/mapper/fedora-var_log: UUID="9842d8b2-5ad2-4dde-bcdc-e4e698fd9acc" TYPE="ext4"
[root@localhost liveuser]# cryptsetup luksUUID /dev/sdb6
f663f2d4-fccf-40ee-b886-45d42838bf87
[root@localhost liveuser]# mount |grep '/mnt/'
/dev/mapper/fedora-root on /mnt/root type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-home on /mnt/root/home type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-tmp on /mnt/root/tmp type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-var on /mnt/root/var type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-var_log on /mnt/root/var/log type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-opt on /mnt/root/opt type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sdb5 on /mnt/root/boot type ext4 (rw,relatime,seclabel,data=ordered)
[root@localhost liveuser]#
Any help/suggestions are very much appriciated I would rather not restore again as it seems this issue will likely return when I update a kernel.
A hint that dracut is giving me is that it says something like Warning: /dev/mapper/fedora-root does not exists
then it says I might want to regenerate initramfs, hence why I tried these dracut lines.