From 9b634dde32c0aacfa83d0f44b1a7ccf10d6efd83 Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Sun, 6 Jun 2021 11:57:57 +0200 Subject: [PATCH] Generalize fix filesystem mount ordering Previously, it wasn't taken into account that the root FS may not be `$v_rpool_name/ROOT`. --- install-zfs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install-zfs.sh b/install-zfs.sh index 24ca08e..ee42c54 100755 --- a/install-zfs.sh +++ b/install-zfs.sh @@ -1450,10 +1450,15 @@ function fix_filesystem_mount_ordering { local success= if [[ ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$c_bpool_name || ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$v_rpool_name ]]; then + local zfs_root_fs zfs_boot_fs + + zfs_root_fs=$(chroot_execute 'zfs list / | awk "NR==2 {print \$1}"') + zfs_boot_fs=$(chroot_execute 'zfs list /boot | awk "NR==2 {print \$1}"') + # For the rpool only, it takes around half second on a test VM. # - chroot_execute "zfs set canmount=on $c_bpool_name" - chroot_execute "zfs set canmount=on $v_rpool_name/ROOT" + chroot_execute "zfs set canmount=on $zfs_boot_fs" + chroot_execute "zfs set canmount=on $zfs_root_fs" SECONDS=0