-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Ubuntu 20.04 Root on ZFS.rst #122
Conversation
Hi, I'm not sure if this is correct or not - but this change removes section 4.15, "Patch a dependency loop", as it seems that this is no longer required now that openzfs/zfs#10388 has been merged? Following the current instructions in 4.15 generates the following console output: ``` root@rescue ~ # curl https://launchpadlibrarian.net/478315221/2150-fix-systemd-dependency-loops.patch | \ > sed "s|/etc|/lib|;s|\.in$||" | (cd / ; sudo patch -p1) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1487 100 1487 0 0 4260 0 --:--:-- --:--:-- --:--:-- 4260 patching file lib/systemd/system-generators/zfs-mount-generator Hunk openzfs#1 FAILED at 42. Hunk openzfs#2 FAILED at 62. Hunk openzfs#3 succeeded at 157 with fuzz 2 (offset 80 lines). 2 out of 3 hunks FAILED -- saving rejects to file lib/systemd/system-generators/zfs-mount-generator.rej patching file lib/systemd/system/zfs-mount.service Hunk openzfs#1 FAILED at 6. 1 out of 1 hunk FAILED -- saving rejects to file lib/systemd/system/zfs-mount.service.rej ``` /lib/systemd/system/zfs-mount.service.rej contains the following: ``` root@rescue ~ # cat /lib/systemd/system-generators/zfs-mount-generator.rej --- lib/systemd/system-generators/zfs-mount-generator +++ lib/systemd/system-generators/zfs-mount-generator @@ -42,6 +42,8 @@ do_fail "zero or three arguments required" fi +pools=$(zpool list -H -o name) + # For ZFSs marked "auto", a dependency is created for local-fs.target. To # avoid regressions, this dependency is reduced to "wants" rather than # "requires". **THIS MAY CHANGE** @@ -62,6 +64,7 @@ set -f set -- $1 dataset="${1}" + pool="${dataset%%/*}" p_mountpoint="${2}" p_canmount="${3}" p_atime="${4}" ``` /lib/systemd/system-generators/zfs-mount-generator seems to already contain equivalent code to the rejected hunks, and the accepted hunk seems to generate a code block starting line 160, that seems like a partial and older version of the code block at line 121? ``` 121 # If the pool is already imported, zfs-import.target is not needed. This 122 # avoids a dependency loop on root-on-ZFS systems: 123 # systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount 124 # After zfs-import.target After zfs-import-{cache,scan}.service After 125 # cryptsetup.service After systemd-random-seed.service. 126 # 127 # Pools are newline-separated and may contain spaces in their names. 128 # There is no better portable way to set IFS to just a newline. Using 129 # $(printf '\n') doesn't work because $(...) strips trailing newlines. 130 IFS=" 131 " 132 for p in $pools ; do 133 if [ "$p" = "$pool" ] ; then 134 after="" 135 wants="" 136 break 137 fi 138 done . . . . . 160 # If the pool is already imported, zfs-import.target is not needed. This 161 # avoids a dependency loop on root-on-ZFS systems: 162 # systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount 163 # After zfs-import.target After zfs-import-{cache,scan}.service After 164 # cryptsetup.service After systemd-random-seed.service. 165 for p in $pools ; do 166 if [ "$p" = "$pool" ] ; then 167 wants="" 168 break 169 fi 170 done ``` /lib/systemd/system/zfs-mount.service.rej contains the following: ``` --- lib/systemd/system/zfs-mount.service +++ lib/systemd/system/zfs-mount.service @@ -6,7 +6,6 @@ After=zfs-import.target After=systemd-remount-fs.service Before=local-fs.target -Before=systemd-random-seed.service After=zfs-load-module.service ConditionPathExists=/sys/module/zfs ``` And /lib/systemd/system/zfs-mount.service does not contain the string "Before=systemd-random-seed.service" ...Is it therefore right to remove section 4.15 from this manual?
What version of zfsutils-linux do you have installed? On Ubuntu 20.04 (in the Live CD chroot right now), I have this:
The patch applies cleanly. |
I'm really sorry for wasting your time - I found my error: I am having to install from Debian because it's a Hetzner rental server, and I had reconnected after an ssh timeout and did not chroot again before applying the patch - it conflicted with the Debian version (of course):
Thanks for this install guide BTW, I really appreciate being able to have a mirrored ZFS root on my various production machines and there is no way I could get there without it. I'm hoping to find some time to make an bash/dialog install script based on your guide to save myself some typing in future - would you mind if I posted that to github as a "partial implementation of OpenZFS on root install instructions" in case others find it helpful? |
A number of people have made scripts of this. If you want to, go ahead. Longer term, I really wish that Ubuntu would add mirrored support to their (server) installer. |
Hi, I'm not sure if this is correct or not - but this change removes section 4.15, "Patch a dependency loop", as it seems that this is no longer required now that openzfs/zfs#10388 has been merged?
Following the current instructions in 4.15 generates the following console output:
/lib/systemd/system/zfs-mount.service.rej contains the following:
/lib/systemd/system-generators/zfs-mount-generator seems to already contain equivalent code to the rejected hunks, and the accepted hunk seems to generate a code block starting line 160, that seems like a partial and older version of the code block at line 121?
/lib/systemd/system/zfs-mount.service.rej contains the following:
And /lib/systemd/system/zfs-mount.service does not contain the string "Before=systemd-random-seed.service"
...Is it therefore right to remove section 4.15 from this manual?