Modern GRUBing: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
Notes; | |||
* LVM on NVMe is the issue | |||
Rocky Linux 9 does not use the /etc/default/grub and /boot/grub2/grub.cfg Files any longer. Instead the BLS (Boot Loader Specification) 'method' is used. If one reads the documentation from RedHat, it seems like thing got really messy (and confusing). | Rocky Linux 9 does not use the /etc/default/grub and /boot/grub2/grub.cfg Files any longer. Instead the BLS (Boot Loader Specification) 'method' is used. If one reads the documentation from RedHat, it seems like thing got really messy (and confusing). | ||
| Line 16: | Line 21: | ||
**Linux LVM (and LVM2): $8E | **Linux LVM (and LVM2): $8E | ||
*LVM Stuff using Commands or BLIVET (sadly only Rocky Linux 8) | *LVM Stuff using Commands or BLIVET (sadly only Rocky Linux 8) | ||
**<code>pvcreate /dev/ | **<code>pvcreate /dev/sdXy</code> | ||
**<code>vgcreate VG.NVMe.ROOT /dev/ | **<code>vgcreate VG.NVMe.ROOT /dev/sdXy</code> | ||
***<code>vgrename WhatEverOldName WhatEverNewName</code> | ***<code>vgrename WhatEverOldName WhatEverNewName</code> | ||
**<code>lvcreate -L 64G -n LV.ROOT VG.NVMe.ROOT</code> | **<code>lvcreate -L 64G -n LV.ROOT VG.NVMe.ROOT</code> | ||
*Format Partitions | *Format Partitions | ||
**mkfs.vfat -F32 /dev/sdXy | **mkfs.vfat -F32 /dev/sdXy | ||
**<code>mkfs.ext4 -v -L ROOT.EXT4 /dev/ | **<code>mkfs.ext4 -v -L ROOT.EXT4 /dev/sdXy ( -v = Verbose, -L = Label )</code> | ||
**<code>mkswap -L SWAP /dev/ | **<code>mkswap -L SWAP /dev/sdaXy</code> | ||
*MBR Stuff if desired | *MBR Stuff if desired | ||
*UEFI Stuff | *UEFI Stuff ("make" the grubx64.efi File) --- Best done from a UEFI system! | ||
**Make sure UEFI Stuff is installed (if cloning from an MBR / BIOS based system) | **Make sure UEFI Stuff is installed (if cloning from an MBR / BIOS based system); | ||
***dnf install grub2-efi-x64 grub2-tools grub2-tools-efi grub2-tools-extra grub2-efi-x64-modules efibootmgr shim-x64 | |||
**<code>mkdir /mnt/efi</code> | **<code>mkdir /mnt/efi</code> | ||
**<code>mount /dev/nvme0n1p1 /mnt/efi</code> | **<code>mount /dev/nvme0n1p1 /mnt/efi</code> | ||
**<code>grub2-install --target=x86_64-efi --efi-directory=/mnt/efi --bootloader-id=rocky --recheck --force --no-nvram --removable</code> ( --force = Do it on a supposedly 'non-secure' system, --no-nvram = Do it even if a target drive is being prepared as a UEFI Booted system even if the current OS is an MBR / BIOS system, --removable installs the 'generic' BOOTX64.EFI | **<code>grub2-install --target=x86_64-efi --efi-directory=/mnt/efi --bootloader-id=rocky --recheck --force --verbose **--no-nvram** **--removable**</code> ( --force = Do it on a supposedly 'non-secure' system, --no-nvram = Do it even if a target drive is being prepared as a UEFI Booted system even if the current OS is an MBR / BIOS system, --removable is optional and installs the 'generic' BOOTX64.EFI File. ) | ||
**Command to show information on how a system was booted (and can boot): <code>bootctl status</code> | **Command to show information on how a system was booted (and can boot): <code>bootctl status</code> | ||
**Command for EFIBootMgr: <code>efibootmgr -v</code> | **Command for EFIBootMgr: <code>efibootmgr -v</code> | ||
*GRUB Menu stuff | |||
**Make the grub.cfg file: grub2-mkconfig -o /boot/grub2/grub.cfg | |||
**Seemingly useless command: grub2-editenv | |||
**grub2-probe: General information, simple | |||
*Edit / Register the entry in the Hardwares UEFI Storage space | |||
**efibootmgr --create --disk /dev/nvme0n1 --part 1 --loader '\EFI\rocky\grubx64.efi' --label "Custom GRUB" --bootorder 0001 | |||
*Edit the BLS (Boot Loader System) Entries, etc. | |||
**GRUBBY | |||
*Restore BOOT and ROOT File Systems | *Restore BOOT and ROOT File Systems | ||
**f | **f | ||