terem42 / zfs-hetzner-vm

script to install Debian 10, 11, 12 and Ubuntu 18, 20, 22 LTS with ZFS root on Hetzner VPS
160 stars 103 forks source link

chroot_execute: command not found (Debian 11 and Debian 12) #72

Open falxen opened 5 months ago

falxen commented 5 months ago

I booted into Hetzner's rescue mode, ran theopenzfs_install command (in a different iteration I tried zfs), then apt update && apt upgrade and finally ran this script. I did that for both Debian 11 and Debian 12, and I got the chroot_execute error in both cases. Unfortunately the script proceeds despite that failure, and finally goes on to reboot.

root@rescue / #
root@rescue / # chmod 755 "$c_zfs_mount_dir/usr/share/initramfs-tools/scripts/init-premount/static-route"
root@rescue / #
root@rescue / # chmod 755 "$c_zfs_mount_dir/etc/network/interfaces"
root@rescue / #
root@rescue / # echo "======= update initramfs =========="
======= update initramfs ==========
root@rescue / # chroot_execute "update-initramfs -u -k all"
bash: chroot_execute: command not found
root@rescue / #
root@rescue / # echo "======= update grub =========="
======= update grub ==========
root@rescue / # chroot_execute "update-grub"
bash: chroot_execute: command not found
root@rescue / #
root@rescue / # echo "======= setting up zed =========="
======= setting up zed ==========
root@rescue / # if [[ $v_zfs_experimental == "1" ]]; then
>   chroot_execute "zfs set canmount=noauto $v_rpool_name"
> else
>   initial_load_debian_zed_cache
> fi
bash: initial_load_debian_zed_cache: command not found
root@rescue / #
root@rescue / # echo "======= setting mountpoints =========="
======= setting mountpoints ==========
root@rescue / # chroot_execute "zfs set mountpoint=legacy $v_bpool_name/BOOT/debian"
bash: chroot_execute: command not found
root@rescue / # chroot_execute "echo $v_bpool_name/BOOT/debian /boot zfs nodev,relatime,x-systemd.requires=zfs-mount.service,x-systemd.device-timeout=10 0 0 > /etc/fstab"
bash: chroot_execute: command not found
root@rescue / #                                                                "
bash: chroot_execute: command not found mountpoint=legacy $v_rpool_name/var/log"
root@rescue / # chroot_execute "echo $v_rpool_name/var/log /var/log zfs nodev,relatime 0 0 >> /etc/fstab"
bash: chroot_execute: command not found
root@rescue / # chroot_execute "zfs set mountpoint=legacy $v_rpool_name/var/spool"
bash: chroot_execute: command not found
root@rescue / # chroot_execute "echo $v_rpool_name/var/spool /var/spool zfs nodev,relatime 0 0 >> /etc/fstab"
bash: chroot_execute: command not found                                        "
bash: chroot_execute: command not found mountpoint=legacy $v_rpool_name/var/tmp"
root@rescue / # chroot_execute "echo $v_rpool_name/var/tmp /var/tmp zfs nodev,relatime 0 0 >> /etc/fstab"
bash: chroot_execute: command not found
root@rescue / # chroot_execute "zfs set mountpoint=legacy $v_rpool_name/tmp"
bash: chroot_execute: command not found
root@rescue / # chroot_execute "echo $v_rpool_name/tmp /tmp zfs nodev,relatime 0 0 >> /etc/fstab"
bash: chroot_execute: command not found
root@rescue / #
root@rescue / # echo "========= add swap, if defined"
========= add swap, if defined
root@rescue / # if [[ $v_swap_size -gt 0 ]]; then
>   chroot_execute "echo /dev/zvol/$v_rpool_name/swap none swap discard 0 0 >> /etc/fstab"
> fi
root@rescue / #
root@rescue / # chroot_execute "echo RESUME=none > /etc/initramfs-tools/conf.d/resume"
bash: chroot_execute: command not found
root@rescue / #
root@rescue / # echo "======= unmounting filesystems and zfs pools =========="
======= unmounting filesystems and zfs pools ==========
root@rescue / # unmount_and_export_fs
bash: unmount_and_export_fs: command not found
root@rescue / #
root@rescue / # echo "======== setup complete, rebooting ==============="
======== setup complete, rebooting ===============
root@rescue / # reboot

Broadcast message from root@rescue on pts/1 (Sat 2024-03-30 22:19:34 CET):

The system will reboot now!

root@rescue / # exit
falxen commented 5 months ago

P.S. I also got the same error with Ubuntu 22.04 in Hetzner's rescue system

34code commented 1 month ago

same on hetzner rescue system

congzhangzh commented 3 weeks ago

have a look at https://github.com/congzhangzh/daily-scripts-4-us/blob/main/zfs-root-on-linux-4-debian/hetzner-debian12-zfs-setup.sh ?