Convert disk paths for zpool creation

This commit is contained in:
Kris Lamoureux 2022-11-28 02:07:55 -05:00
parent aaa74697a5
commit c4cf616f7b
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -96,9 +96,11 @@ function create_root_pool () {
} }
function mirror_grub () { function mirror_grub () {
DISK1=$(disk_by_id "$1")
DISK2=$(disk_by_id "$2")
umount /boot/efi umount /boot/efi
dd if="${1}-part2" of="${2}-part2" dd if="${DISK1}-part2" of="${DISK2}-part2"
efibootmgr -c -g -d "$2" -p 2 \ efibootmgr -c -g -d "$DISK2" -p 2 \
-L "debian-${3}" -l '\EFI\debian\grubx64.efi' -L "debian-${3}" -l '\EFI\debian\grubx64.efi'
mount /boot/efi mount /boot/efi
} }
@ -235,20 +237,20 @@ swapoff --all
# 3. Partition your disk(s) # 3. Partition your disk(s)
# UEFI booting + boot pool + ZFS native encryption # UEFI booting + boot pool + ZFS native encryption
disk_format "$DISK" disk_format "$DISK"
[ -n "$MIRROR" ] && disk_format "$MIRROR" DISK_BYID=$(disk_by_id "$DISK")
if [ -n "$MIRROR" ]; then
# 4. Create the boot pool disk_format "$MIRROR"
if [ -z "$MIRROR" ]; then MIRROR_BYID=$(disk_by_id "$MIRROR")
create_boot_pool "$ZFSROOT" "${DISK}3"
else
create_boot_pool "$ZFSROOT" "mirror ${DISK}3 ${MIRROR}3"
fi fi
# 4. Create the boot pool
# 5. Create the root pool # 5. Create the root pool
if [ -z "$MIRROR" ]; then if [ -z "$MIRROR" ]; then
create_root_pool "$ZFSROOT" "${DISK}4" "$RPOOLPW" create_boot_pool "$ZFSROOT" "${DISK_BYID}-part3"
create_root_pool "$ZFSROOT" "${DISK_BYID}-part4" "$RPOOLPW"
else else
create_root_pool "$ZFSROOT" "mirror ${DISK}4 ${MIRROR}4" "$RPOOLPW" create_boot_pool "$ZFSROOT" "mirror ${DISK_BYID}-part3 ${MIRROR_BYID}-part3"
create_root_pool "$ZFSROOT" "mirror ${DISK_BYID}-part4 ${MIRROR_BYID}-part4" "$RPOOLPW"
fi fi
################################### ###################################