From f121be16dc32f3a1973b99894a5c69b8ec8d0763 Mon Sep 17 00:00:00 2001 From: Maurice Zhou Date: Wed, 8 Sep 2021 19:01:28 +0800 Subject: [PATCH] For maximum compatibility and redudancy; mirrored vdev is now always used for boot pool Signed-off-by: Maurice Zhou --- .../Arch Linux/Root on ZFS/1-preparation.rst | 3 +++ .../Arch Linux/Root on ZFS/2-system-installation.rst | 5 ++++- .../Arch Linux/Root on ZFS/4-optional-configuration.rst | 6 +++++- docs/Getting Started/Fedora/Root on ZFS/1-preparation.rst | 3 +++ .../Fedora/Root on ZFS/2-system-installation.rst | 7 ++++++- docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst | 3 +++ .../NixOS/Root on ZFS/2-system-configuration.rst | 7 ++++++- .../NixOS/Root on ZFS/3-optional-configuration.rst | 6 +++++- .../RHEL 8-based distro Root on ZFS/1-preparation.rst | 3 +++ .../2-system-installation.rst | 7 ++++++- 10 files changed, 44 insertions(+), 6 deletions(-) diff --git a/docs/Getting Started/Arch Linux/Root on ZFS/1-preparation.rst b/docs/Getting Started/Arch Linux/Root on ZFS/1-preparation.rst index c8fe4db..56659f5 100644 --- a/docs/Getting Started/Arch Linux/Root on ZFS/1-preparation.rst +++ b/docs/Getting Started/Arch Linux/Root on ZFS/1-preparation.rst @@ -120,6 +120,9 @@ Preparation `here `__ and `here `__. + For boot pool, which must be readable by GRUB, mirrored vdev should always be used for maximum redundancy. + This guide will use mirrored bpool for multi-disk setup. + Refer to `zpoolconcepts `__ and `zpool-create `__ man pages for details. diff --git a/docs/Getting Started/Arch Linux/Root on ZFS/2-system-installation.rst b/docs/Getting Started/Arch Linux/Root on ZFS/2-system-installation.rst index 8c33a88..187ada5 100644 --- a/docs/Getting Started/Arch Linux/Root on ZFS/2-system-installation.rst +++ b/docs/Getting Started/Arch Linux/Root on ZFS/2-system-installation.rst @@ -43,6 +43,9 @@ System Installation #. Create boot pool:: + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + zpool create \ -o compatibility=grub2 \ -o ashift=12 \ @@ -57,7 +60,7 @@ System Installation -O mountpoint=/boot \ -R /mnt \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "$i-part2 "; done) diff --git a/docs/Getting Started/Arch Linux/Root on ZFS/4-optional-configuration.rst b/docs/Getting Started/Arch Linux/Root on ZFS/4-optional-configuration.rst index 50f04e7..bb66f78 100644 --- a/docs/Getting Started/Arch Linux/Root on ZFS/4-optional-configuration.rst +++ b/docs/Getting Started/Arch Linux/Root on ZFS/4-optional-configuration.rst @@ -118,6 +118,10 @@ root pool will be replaced by keyfile, embedded in initrd. #. Recreate boot pool with mappers as vdev:: + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + + zpool create \ -o compatibility=grub2 \ -o ashift=12 \ @@ -131,7 +135,7 @@ root pool will be replaced by keyfile, embedded in initrd. -O xattr=sa \ -O mountpoint=/boot \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "/dev/mapper/${i##*/}-part2-luks-bpool_$INST_UUID "; done) diff --git a/docs/Getting Started/Fedora/Root on ZFS/1-preparation.rst b/docs/Getting Started/Fedora/Root on ZFS/1-preparation.rst index 22c1873..5b889fa 100644 --- a/docs/Getting Started/Fedora/Root on ZFS/1-preparation.rst +++ b/docs/Getting Started/Fedora/Root on ZFS/1-preparation.rst @@ -117,6 +117,9 @@ Preparation `here `__ and `here `__. + For boot pool, which must be readable by GRUB, mirrored vdev should always be used for maximum redundancy. + This guide will use mirrored bpool for multi-disk setup. + Refer to `zpoolconcepts `__ and `zpool-create `__ man pages for details. diff --git a/docs/Getting Started/Fedora/Root on ZFS/2-system-installation.rst b/docs/Getting Started/Fedora/Root on ZFS/2-system-installation.rst index 7257b5e..4486da3 100644 --- a/docs/Getting Started/Fedora/Root on ZFS/2-system-installation.rst +++ b/docs/Getting Started/Fedora/Root on ZFS/2-system-installation.rst @@ -43,6 +43,11 @@ System Installation #. Create boot pool:: + + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + + zpool create \ -o compatibility=grub2 \ -o ashift=12 \ @@ -57,7 +62,7 @@ System Installation -O mountpoint=/boot \ -R /mnt \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "$i-part2 "; done) diff --git a/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst b/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst index ba5240a..b019fe1 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst +++ b/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst @@ -82,6 +82,9 @@ Preparation `here `__ and `here `__. + For boot pool, which must be readable by GRUB, mirrored vdev should always be used for maximum redundancy. + This guide will use mirrored bpool for multi-disk setup. + Refer to `zpoolconcepts `__ and `zpool-create `__ man pages for details. diff --git a/docs/Getting Started/NixOS/Root on ZFS/2-system-configuration.rst b/docs/Getting Started/NixOS/Root on ZFS/2-system-configuration.rst index c0b26c7..f5e3007 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/2-system-configuration.rst +++ b/docs/Getting Started/NixOS/Root on ZFS/2-system-configuration.rst @@ -43,6 +43,11 @@ System Configuration #. Create boot pool:: + + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + + zpool create \ -d -o feature@async_destroy=enabled \ -o feature@bookmarks=enabled \ @@ -67,7 +72,7 @@ System Configuration -O mountpoint=/boot \ -R /mnt \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "$i-part2 "; done) diff --git a/docs/Getting Started/NixOS/Root on ZFS/3-optional-configuration.rst b/docs/Getting Started/NixOS/Root on ZFS/3-optional-configuration.rst index e3c15e0..ef1dbbb 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/3-optional-configuration.rst +++ b/docs/Getting Started/NixOS/Root on ZFS/3-optional-configuration.rst @@ -114,6 +114,10 @@ root pool will be replaced by keyfile, embedded in initrd. #. Recreate boot pool with mappers as vdev:: + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + + zpool create \ -d -o feature@async_destroy=enabled \ -o feature@bookmarks=enabled \ @@ -138,7 +142,7 @@ root pool will be replaced by keyfile, embedded in initrd. -O mountpoint=/boot \ -R /mnt \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "/dev/mapper/${i##*/}-part2-luks-bpool_$INST_UUID "; done) diff --git a/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/1-preparation.rst b/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/1-preparation.rst index e08fe66..34fa88a 100644 --- a/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/1-preparation.rst +++ b/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/1-preparation.rst @@ -119,6 +119,9 @@ Preparation `here `__ and `here `__. + For boot pool, which must be readable by GRUB, mirrored vdev should always be used for maximum redundancy. + This guide will use mirrored bpool for multi-disk setup. + Refer to `zpoolconcepts `__ and `zpool-create `__ man pages for details. diff --git a/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/2-system-installation.rst b/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/2-system-installation.rst index ab5ecc1..309d8a4 100644 --- a/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/2-system-installation.rst +++ b/docs/Getting Started/RHEL-based distro/RHEL 8-based distro Root on ZFS/2-system-installation.rst @@ -43,6 +43,11 @@ System Installation #. Create boot pool:: + + disk_num=0; for i in $DISK; do disk_num=$(( $disk_num + 1 )); done + if [ $disk_num -gt 1 ]; then INST_VDEV_BPOOL=mirror; fi + + zpool create \ -d -o feature@async_destroy=enabled \ -o feature@bookmarks=enabled \ @@ -67,7 +72,7 @@ System Installation -O mountpoint=/boot \ -R /mnt \ bpool_$INST_UUID \ - $INST_VDEV \ + $INST_VDEV_BPOOL \ $(for i in ${DISK}; do printf "$i-part2 "; done)