Chrismurphy (talk | contribs) No edit summary |
Chrismurphy (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
* Freshen your backups, just in case | * Freshen your backups, just in case | ||
* Backup `/boot/efi`, just in case, e.g. | * Backup `/boot/efi`, just in case, e.g. | ||
# cd /boot | |||
# sudo tar -acf bootefibackup.tar efi | |||
==Actions== | ==Actions== | ||
====Make snapshots==== | ====Make snapshots==== | ||
# Use the `df` command to find the `/dev` node | # Use the `df` command to find the `/dev` node+partition for your `/` mount point, e.g. $BTRFSPOOL = "/dev/nvme0n1p5" | ||
# `mount $BTRFSPOOL /mnt`; cd /mnt; ls -l | |||
# You should see two directories, `root` and `home`. These are Btrfs subvolumes, | # You should see two directories, `root` and `home`. These are Btrfs subvolumes, which we can snapshot. | ||
# `btrfs subvolume snapshot root root37` #any name will do | # `btrfs subvolume snapshot root root37` #any name will do | ||
# | ====Create a bootloader entry using grubby==== | ||
# | # `grubby --default-kernel` | ||
# `grubby --default-title` | |||
# Using the information above about your system, construct a command using the example below: | |||
# | `grubby --add-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --copy-default --title="Fedora Linux (5.18.16-200.fc36.x86_64) 36 (Workstation Edition) UPGRADE" --make-default` | ||
# | # There will be a message indicating an entry for this kernel exists and another is being created with `~custom` appended to the name. You can confirm the new drop-in file with `ls -l /boot/loader entries`. | ||
# `grubby --remove-args="rootflags=subvol=root" --update-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --config-file=/boot/loader/entries/64db766697e04179a6d3f7a67c2941e1-5.18.16-200.fc36.x86_64.0~custom.conf` | |||
# `grubby --args="rootflags=subvol=root37" --update-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --config-file=/boot/loader/entries/64db766697e04179a6d3f7a67c2941e1-5.18.16-200.fc36.x86_64.0~custom.conf` | |||
* Optional 1: The gist is to dup the most recent `/boot/loader/entries` snippet, giving it a $NEWFILENAME, edit it and give it a new title, e.g. add "UPGRADE" to the end, and change the options line `rootflags=subvol=root` to whatever name you used for the snapshot, e.g. `root37`. So you can either do it CLI style or use grubby; or | |||
* Optional 2: You could even just reveal the hidden GRUB menu at boot time, and manually edit the default entry. You only need to do it twice. One boot to boot the snapshot and initiate the upgrade download. And the next boot to actually run the (offline) upgrade. The upgrade will install a new kernel package and its BLS snippet will contain the proper reference to `root37` as the root subvolume to use (or whatever name you used). | |||
==One bootloader== | ==One bootloader== | ||
As each Fedora performs updates, it'll step on the bootloader in `/boot/efi`. It shouldn't be a problem unless there are bugs and then "wheee!" So you could consider adding an `exclude=grub2-*` in the test instance's `dnf.conf`. | As each Fedora performs updates, it'll step on the bootloader in `/boot/efi`. It shouldn't be a problem unless there are bugs and then "wheee!" So you could consider adding an `exclude=grub2-*` in the test instance's `dnf.conf`. |
Revision as of 23:08, 7 August 2022
Description
This test case creates a dual boot system with two Fedoras of different release versions, using btrfs snapshots, works as expected
Setup
- Install Fedora 36. Any desktop, using Automatic partitioning.
- Freshen your backups, just in case
- Backup
/boot/efi
, just in case, e.g.
- cd /boot
- sudo tar -acf bootefibackup.tar efi
Actions
Make snapshots
- Use the
df
command to find the/dev
node+partition for your/
mount point, e.g. $BTRFSPOOL = "/dev/nvme0n1p5" mount $BTRFSPOOL /mnt
; cd /mnt; ls -l- You should see two directories,
root
andhome
. These are Btrfs subvolumes, which we can snapshot. btrfs subvolume snapshot root root37
#any name will do
Create a bootloader entry using grubby
grubby --default-kernel
grubby --default-title
- Using the information above about your system, construct a command using the example below:
grubby --add-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --copy-default --title="Fedora Linux (5.18.16-200.fc36.x86_64) 36 (Workstation Edition) UPGRADE" --make-default
- There will be a message indicating an entry for this kernel exists and another is being created with
~custom
appended to the name. You can confirm the new drop-in file withls -l /boot/loader entries
. grubby --remove-args="rootflags=subvol=root" --update-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --config-file=/boot/loader/entries/64db766697e04179a6d3f7a67c2941e1-5.18.16-200.fc36.x86_64.0~custom.conf
grubby --args="rootflags=subvol=root37" --update-kernel=/boot/vmlinuz-5.18.16-200.fc36.x86_64 --config-file=/boot/loader/entries/64db766697e04179a6d3f7a67c2941e1-5.18.16-200.fc36.x86_64.0~custom.conf
- Optional 1: The gist is to dup the most recent
/boot/loader/entries
snippet, giving it a $NEWFILENAME, edit it and give it a new title, e.g. add "UPGRADE" to the end, and change the options linerootflags=subvol=root
to whatever name you used for the snapshot, e.g.root37
. So you can either do it CLI style or use grubby; or - Optional 2: You could even just reveal the hidden GRUB menu at boot time, and manually edit the default entry. You only need to do it twice. One boot to boot the snapshot and initiate the upgrade download. And the next boot to actually run the (offline) upgrade. The upgrade will install a new kernel package and its BLS snippet will contain the proper reference to
root37
as the root subvolume to use (or whatever name you used).
One bootloader
As each Fedora performs updates, it'll step on the bootloader in /boot/efi
. It shouldn't be a problem unless there are bugs and then "wheee!" So you could consider adding an exclude=grub2-*
in the test instance's dnf.conf
.
How to boot
- GRUB menu shows boot options: variant+version+kernelversion for switching between the two; or
- Use
grubby --set-default=/boot/vmlinuz-5.18.15-200.fc36.x86_64
Limitations
/boot
is only 1GiB by default, so this is the limiting factor right now, how many Fedoras you can have installed at one time. Two is safe. Three is iffy unless- configure the test Fedora instances' dnf.conf such
exclude=kernel-*
; - consider deleting the "rescue" initramfs and kernel for the test instances, also removing
dracut-config-rescue-056-1.fc36.x86_64
from them so these files aren't recreated; or - put /boot on a Btrfs subvolume.
- configure the test Fedora instances' dnf.conf such