Ubuntu: Go back to bpool/grub

For a mirror or raidz topology, /boot/grub is on a separate dataset.
This was originally bpool/grub, then changed on 2020-05-30 to
bpool/BOOT/ubuntu_UUID/grub to work-around zsys setting canmount=off
which would result in /boot/grub not mounting.  This work-around lead
to issues with snapshot restores. The underlying zsys issue
ubuntu/zsys#164 was fixed and backported to 20.04, so it is now back to
being bpool/grub.

This reverts commit b6fd009edd.  It
conceptually reverts the errata notes from commit
04d3c1cee4, but includes new steps for
people in the pre-2020-05-30 state.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
Fixes #55
This commit is contained in:
Richard Laager
2020-12-05 18:16:19 -06:00
parent eb05d5b190
commit 44170fdbd5

View File

@@ -15,45 +15,29 @@ applicable:
/boot/grub Not Mounted
~~~~~~~~~~~~~~~~~~~~~~
| **Severity:** Grave
| **Fixed:** 2020-05-30
| **Severity:** Normal (previously Grave)
| **Fixed:** 2020-12-05 (previously 2020-05-30)
For a mirror or raidz topology, ``/boot/grub`` is on a separate dataset. This
is now ``bpool/BOOT/ubuntu_UUID/grub``, but was previously ``bpool/grub``.
Unfortunately, zsys sets ``canmount=off`` on ``bpool/grub``, so it is not
mounted. As a result, updates the GRUB configuration will be written to the
``/boot`` filesystem and not used by GRUB (because it is still looking in
``bpool/grub``). Check for ``bpool/grub``::
was originally ``bpool/grub``, then changed on 2020-05-30 to
``bpool/BOOT/ubuntu_UUID/grub`` to work-around zsys setting ``canmount=off``
which would result in ``/boot/grub`` not mounting. This work-around lead to
`issues with snapshot restores
<https://github.com/openzfs/openzfs-docs/issues/55>`__. The underlying `zsys
issue <https://github.com/ubuntu/zsys/issues/164>`__ was fixed and backported
to 20.04, so it is now back to being ``bpool/grub``.
zfs list bpool/grub
* If you never applied the 2020-05-30 errata fix, then ``/boot/grub`` is
probably not mounting. Check that::
If this says “dataset does not exist”, you are good. If it exists, fix it.
mount | grep /boot/grub
Once you start this process, the system will be unbootable until you have
completed it. Do not reboot until you have completed all of the steps.
#. Rename the dataset::
umount /boot/grub
# Ignore any error about it not being mounted.
rm -rf /boot/grub
zfs list -r bpool
# Replace UUID below:
zfs rename bpool/grub bpool/BOOT/ubuntu_UUID/grub
zfs inherit com.ubuntu.zsys:bootfs bpool/BOOT/ubuntu_UUID/grub
zfs set canmount=on bpool/BOOT/ubuntu_UUID/grub
zfs mount bpool/BOOT/ubuntu_UUID/grub
#. Ensure that zed updated the cache to use ``bpool/BOOT/ubuntu_UUID/grub``::
grep grub /etc/zfs/zfs-list.cache/bpool
#. Rebuild the initrd and reinstall GRUB::
If it is mounted, everything is fine. Stop. Otherwise::
zfs set canmount=on bpool/boot/grub
update-initramfs -c -k all
update-grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=ubuntu --recheck --no-floppy
@@ -70,15 +54,13 @@ completed it. Do not reboot until you have completed all of the steps.
/boot/efi/EFI/ubuntu/grub.cfg \
/boot/efi2/EFI/ubuntu-2/grub.cfg
#. If using encryption, patch a dependency loop::
* If you applied the 2020-05-30 errata fix, then you should revert the dataset
rename::
sudo apt install --yes curl patch
curl https://launchpadlibrarian.net/478315221/2150-fix-systemd-dependency-loops.patch | \
sed "s|/etc|/lib|;s|\.in$||" | (cd / ; patch -p1)
#. Disable grub-initrd-fallback.service::
systemctl mask grub-initrd-fallback.service
umount /boot/grub
zfs rename bpool/BOOT/ubuntu_UUID/grub bpool/grub
zfs set com.ubuntu.zsys:bootfs=no bpool/grub
zfs mount bpool/grub
AccountsService Not Mounted
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -629,7 +611,7 @@ Step 3: System Installation
For a mirror or raidz topology, create a dataset for ``/boot/grub``::
zfs create bpool/BOOT/ubuntu_$UUID/grub
zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub
A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``::