New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu 20.04 MIRROR Root on ZFS: shouldn't bpool get cloned on restore? #55
Comments
The next step here would be to try this on a single disk system. If this is reproducible on a single disk, then it is a zsys issue. If it is not, then it is likely something to do with the HOWTO setup. |
But what is supposed to happen on restore? I see that the bpool didn't get cloned. Is that the expected behavior? If that is the case, then isn't that incompatible with the setup of GRUB on bpool? |
Not sure whether that are questions to be posted here or elsewhere. Please, let me know. |
Was your system installed after or fixed to address the “/boot/grub Not Mounted” errata?
I’m not sure. I haven’t tested zsys anywhere near as much as I should have, for a lack of time.
When you say “bpool” and “cloned”, what exactly do you mean? Are you expecting bpool/BOOT/ubuntu_ID to get clone to another dataset with a different ID?
I’m not following why you think that. Can you elaborate? |
The system was installed after, so I didn't need to fix the errata. I just followed the how to for mirror.
Sorry for my bad explanation. As I said I am new to the ZFS world, so I may even miss some basic understanding. What I think I understand is that the bpool in singe disk can be reverted to a previous state (e.g. to retrieve an old deleted kernel) by just using a saved snapshot (which is read-only), because the kernel needs only to be read, and the GRUB menu is written in the EFI partition and not in bpool. With the mirror setup, grub is on the bpool, so in that case, adding changes to the current GRUB menu, implies being able to write the bpool, hence maybe we need a clone for mirror, not a snapshot.
If that is the case, then just putting GRUB on bpool WITHOUT configuring zsys to clone it on restore (instead of just using the snapshot), would break grub, so shouldn't the how-to also add the instructions to setup zsys that way? (if it is possible and if it is not a problem of some other nature of course) I am a bit confused about who is responsible for what with zfs and zsys. If you think I should post this question somewhere else (maybe in the zsys issues?) please, could you point me to the right place? Thank you! |
@rlaager it looks like we got to the bottom of the problem thanks to @didrocks here ubuntu/zsys#163
Please @rlaager, could you comment about the reason |
quoting from ubuntu/zsys#163 (comment):
At boot, where is the old version of
Obviously the UUID (d11dfcf18e7bbf0a) and "UUID" (oy1czd) will differ between systems. But that should be what the EFI setup looks like. That will cause GRUB to look at the bpool filesystem for grub.cfg. |
Yes. Grub is looking for That ID is not immutable, it is changed (to e.g. ID2) by the restore, while the After the restore it should be pointing to Instead with the current setup, the If my explanation is not clear enough, please, let me know so I could add more details and examples. Now, I think that I am thinking to something like |
Ahh, that makes sense... So the "/boot/grub Not Mounted" fix changed this for the worse. It used to be Can you try this (most of this is double-checking for safety):
|
Thanks for the answer, and sorry for the late reply. Do you mean: |
Sorry, just the grub filesystem. |
FYI: the rename didn't mount, I had to add the mountpoint to the
|
Yes, that should be okay to do once it's confirmed working.
Well, I think you want |
OK, so should I change anything of the other flags? |
The other flags look the same already. |
It restarted in the old state. It might start from the other disk efi that I didn't change yet (which is pointing to the old state)...
I will try to change also the other file in the second disk. If it will not work I don' t know if I can change it from grup console. At worse I will restart with a live cd and switch it back. |
BTW... both |
I don't understand. Aren't they pointing to a pool/dataset path where the pool is mirrored? Which part is disk-specific? |
The reboot worked after updating also the second The UUID does not match any UUID. What is supposed to represent?
|
Using AFAIK a persistent dataset should be created outside of BOOT, so I also tried to put grub on a separate dataset in order to avoid the multiple states that get created in
manually updated both efi grub.cfg, update-grub and restored to an older state. Correctly, it does not create extra datasets, the restore does trigger the updated menu, but then at the next boot the menu is again the old one. Always the same. I am wondering where it gets the first boot menu, since - just before the reboot - I checked in the grub.cfg that the menu was the right one. (edit) I got also a grub-probe error, but it was because I was not using sudo. D'oh :/ |
So I think the conclusion is that |
@rlaager I think that meanwhile the doc should change the current suggested way to create the grub dir, suggesting instead to use the standard grub in EFI configuration. It should also add a warning that the grub.cfg will have to be updated on the second EFI somehow, either manually or with some hook. A possible temporary update solution could be appending a hardcoded cp statement at the end of |
I have an existing TODO note to investigate the new/improved GRUB support for multiple UEFI disks in 20.04. I'm really swamped right now, so I can't promise a time frame, but these things may end up being addressed together, in the manner you suggest. |
Ubuntu 20.04's GRUB supports multiple EFI disks. There is a small caveat in that it doesn't prompt in the chroot, but it works fine after the reboot. Using the stock support means that the ESPs will be kept in sync automatically. Signed-off-by: Richard Laager <rlaager@wiktel.com> Refs issue #55
I have hopefully fixed this. If not, or you have other feedback, please let me know. |
I am a ZFS newbie so my apologies if I will say some stupid thing especially trying to explain what happens.
I followed the instructions for mirror root and it went well. I installed and removed a few different packages and kernels: I could see the entries in the GRUB history menu. Then I restored on an old one that still was using a kernel that I recently removed, and everything got restored as expected. So I did some other change on the system and reboot. I was expecting to automatically reboot in the just rebooted state, but instead it rebooted in the old one.
After I retried a few times, I discovered that in order to gain the same state (originated after the first restore) the only way I have is going to the grub history and pick again the last restored point. Then it boots in the last state, the kernel is the right one, the new installed software is there... all ok, BUT it looked like I couldn't update the GRUB menu at all.
Besides I manually saved a state with success, and I was expecting to find it in the grub history menu on reboot, but it was nowhere to be found. Even with a manual update-grub (which succeeded) there was no new entry: the grub menu was frozen in the past.
It looks like while the rpool persist the changes in the new state, the bpool is read only, so the GRUB menu will never get changed.
The zsysctl history seems to confirm that: rpool got cloned on restore but bpool didn't.
I suspect that in sigle disk installations using a read only bpool is not a problem. Since grub is on the EFI partition it gets updated as usual, but since the mirror installation has GRUB on bpool, shouldn't zsys clone it on restore as it does with rpool?
Did I miss something?
The text was updated successfully, but these errors were encountered: