From 6352af3f1f907ce006af32acc1a356cdf89a32da Mon Sep 17 00:00:00 2001 From: Michel Le Cocq Date: Wed, 23 Sep 2020 16:06:13 +0200 Subject: [PATCH] zfs uefi trouble --- full-zfs-ecrypt-uefi-boot-trouble.md | 122 +++++++++++++++++++++++++++ grub-touble.md | 0 zfs-trouble-live-boot-solution.md | 38 +++++---- 3 files changed, 144 insertions(+), 16 deletions(-) create mode 100644 full-zfs-ecrypt-uefi-boot-trouble.md create mode 100644 grub-touble.md diff --git a/full-zfs-ecrypt-uefi-boot-trouble.md b/full-zfs-ecrypt-uefi-boot-trouble.md new file mode 100644 index 0000000..61d7cb3 --- /dev/null +++ b/full-zfs-ecrypt-uefi-boot-trouble.md @@ -0,0 +1,122 @@ +## Fixing Debian/Ubuntu UEFI boot manager with Debian/Ubuntu Live + +source : [Code Bites](https://emmanuel-galindo.github.io/en/2017/04/05/fixing-debian-boot-uefi-grub/) + +Steps summary: + +- Boot Debian Live +- Verify Debian Live was loaded with UEFI +- Review devices location and current configuration +- Mount broken system (via chroot) +- Reinstall grub-efi +- Verify configuration +- Logout from chroot and reboot + +### Verify Debian Live was loaded with UEFI : + +~~~ +$ dmesg | grep -i efi +~~~ + +~~~ +$ ls -l /sys/firmware/efi | grep vars +~~~ + +### Mount broken system (via chroot) + +Mounting another system via chroot is the usual procedure to recover broken system’s. Once the chroot comand is issues, Debian Live will treat the broken system’s “/” (root) as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the Debian Live. + +#### My system is full ZFS + +You have to add *-f* to force import because zfs think he should be on an other system. +*-R* is to use an altroot path. + +~~~ +zpool import -f -R /mnt rpool +~~~ + +~~~ +zpool import bpool +~~~ + +Here system will tell you he can't mount it because /boot is in use. We don't wanted to mount it here, we will do it inside the chroot. + +~~~ +zfs mount rpool/ROOT/ubuntu_myid +~~~ + +I'm in the case where ny zpool is encrypt ! + +see : [zfs trouble encrypt zpool](zfs-trouble-live-boot-solution) + +#### My system is not ZFS + +Mount root partition (for example an lvm) + +~~~ +# mount /dev/volumegroup/logicalvolume /mnt +~~~ + +Mount boot partition (F.e. in drive sda) + +~~~ +# mount /dev/sda2 /mnt/boot +~~~ + +Mount the EFI System Partition (usually in /dev/sda1) + +~~~ +# mount /dev/sda1 /mnt/boot/efi +~~~ + +### Prepare chroot env + +Mount the critical virtual filesystems with the following single command: + +~~~ +# for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done +~~~ + +Mount all zfs file system on rpool. + +~~~ +# zfs mount -a +~~~ + +Chroot to your normal (and broken) system device + +~~~ +# chroot /mnt +~~~ + +Then here mon bpool zfs vol. + +~~~ +inside chroot # zfs mount -a +~~~ + +Mount your EFI partition: + +~~~ +inside chroot # mount -a +~~~ + +You should see : + +* all your rpool zfs vol. +* /boot from your bpool. +* Your efi partition. + +### Reinstall grub-efi + +~~~ +# apt-get install --reinstall grub-efi +~~~ + +~~~ +# grub-install /dev/sda +~~~ + +~~~ +# update-grub +~~~ diff --git a/grub-touble.md b/grub-touble.md new file mode 100644 index 0000000..e69de29 diff --git a/zfs-trouble-live-boot-solution.md b/zfs-trouble-live-boot-solution.md index 5c8cfcc..fd2a096 100644 --- a/zfs-trouble-live-boot-solution.md +++ b/zfs-trouble-live-boot-solution.md @@ -1,16 +1,22 @@ -# zfs trouble live boot solution -## zpool trouble you can mount it from live systeme - -boot on usb drive which permit zfs then : - -~~~ -zpool import -R /mnt rpool -zfs load-key rpool -zfs mount rpool/USERDATA/nomad_e8bdbt -~~~ - -## in case you wanted to change zpool passwd - -~~~{.shell} -zfs change-key rpool -~~~ +--- +format: markdown +toc: no +title: zfs trouble encrypt zpool +... + +# zfs trouble live boot solution +## zpool trouble you can mount it from live systeme + +boot on usb drive which permit zfs then : + +~~~ +zpool import -R /mnt rpool +zfs load-key rpool +zfs mount rpool/USERDATA/nomad_e8bdbt +~~~ + +## in case you wanted to change zpool passwd + +~~~{.shell} +zfs change-key rpool +~~~