aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-10-16 04:27:39 +0200
committerSven Gothel <[email protected]>2022-10-16 04:27:39 +0200
commit34302975c55a539450a7b07df4fbcc5b55675518 (patch)
tree7af87ac161d4368b5bba2c49a2d11592e2a01abd
parent49c1467cd29517bc3d06ae9122439d43b09ab589 (diff)
Add manual zfs recovery documentation20201016-zfs-2.1.6
-rw-r--r--README.md12
-rw-r--r--rescue/chroot_zfs.sh27
2 files changed, 39 insertions, 0 deletions
diff --git a/README.md b/README.md
index e3fcb0d..cc68a8f 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,18 @@ cd ..
You can find convenient removal and install scripts within `scripts` folder.
+### Manual ZFS Rescue
+
+Documented shell script `rescue/chroot_zfs.sh` shows how-to
+- auto import local zfs pools
+- chroot into the imported root filesystem
+ - bind special devices and pipes to zfs realm
+ - chroot into the zfs system
+- shows three typical recovery tasks
+ - update-initramfs -u -k all
+ - update-grub
+ - grub-install /dev/disk/by-id/your_boot_root_device
+
## ZFS Compatibility Settings
Following compatibility feature sets have been tested
diff --git a/rescue/chroot_zfs.sh b/rescue/chroot_zfs.sh
new file mode 100644
index 0000000..1a3b417
--- /dev/null
+++ b/rescue/chroot_zfs.sh
@@ -0,0 +1,27 @@
+#! /bin/sh
+#
+
+#
+# Perform zfs auto import w/ temp root on /mnt
+#
+# - without force: zfs import -a -R /mnt
+# - with force: zfs import -a -f -R /mnt
+#
+
+# bind the special devices and pipes to zfs realm
+#
+mount --bind /dev/ /mnt/dev/
+mount --bind /sys/ /mnt/sys/
+mount --bind /proc/ /mnt/proc/
+
+# chroot into it
+#
+# chroot /mnt
+#
+
+# Potentially you might need to
+#
+# - update-initramfs -u -k all
+# - update-grub
+# - grub-install /dev/disk/by-id/your_boot_root_device
+#