From 2c76e5de9708526e6bf345db41a2f91416bf271a Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Fri, 8 Jan 2021 16:16:35 -0600 Subject: [PATCH] Debian/Ubuntu: Try again with /run The fix for #97, 66233a11389d392094d7a17c97a9a88dbc775cc8, seems to have created yet another issue (beyond #100): "the link /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf is dangling (since /run has just been clobbered by an empty tmpfs). debootstrap seems to populate all manner of stuff in /run." https://github.com/openzfs/openzfs-docs/commit/f1721edda7ccca6fdcf397086b88c71f292073a8#commitcomment-45770519 I considered just reverting all of this, since the original issue only occurred when copying in an existing system. Ignoring it was my decision the first time this came up. But it's come up twice now. Also, this mode is mentioned in the guide. Most importantly, if we are not mounting a /tmpfs at /run in the normal case, then we could end up with cruft in /run in the root filesystem which could potentially break something or be confusing later if the /run tmpfs ever failed to mount. So in the interest of correctness, I'd like to try to handle this. I am now mounting a tmpfs at /mnt/run before the debootstrap step. Signed-off-by: Richard Laager --- docs/Getting Started/Debian/Debian Buster Root on ZFS.rst | 7 +++++-- docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.rst | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/Getting Started/Debian/Debian Buster Root on ZFS.rst b/docs/Getting Started/Debian/Debian Buster Root on ZFS.rst index f9130d7..7ebced4 100644 --- a/docs/Getting Started/Debian/Debian Buster Root on ZFS.rst +++ b/docs/Getting Started/Debian/Debian Buster Root on ZFS.rst @@ -489,6 +489,11 @@ Step 3: System Installation zfs create -o com.sun:auto-snapshot=false rpool/var/lib/nfs + Mount a tmpfs at /run:: + + mkdir /mnt/run + mount -t tmpfs tmpfs /mnt/run + A tmpfs is recommended later, but if you want a separate dataset for ``/tmp``:: @@ -1044,8 +1049,6 @@ If needed, you can chroot into your installed environment:: mount --rbind /dev /mnt/dev mount --rbind /proc /mnt/proc mount --rbind /sys /mnt/sys - mount -t tmpfs tmpfs /mnt/run - mkdir /mnt/run/lock chroot /mnt /bin/bash --login mount /boot mount -a diff --git a/docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.rst b/docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.rst index 3534a60..598f980 100644 --- a/docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.rst +++ b/docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.rst @@ -615,6 +615,11 @@ Step 3: System Installation zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub + Mount a tmpfs at /run:: + + mkdir /mnt/run + mount -t tmpfs tmpfs /mnt/run + A tmpfs is recommended later, but if you want a separate dataset for ``/tmp``:: @@ -697,8 +702,6 @@ Step 4: System Configuration mount --rbind /dev /mnt/dev mount --rbind /proc /mnt/proc mount --rbind /sys /mnt/sys - mount -t tmpfs tmpfs /mnt/run - mkdir /mnt/run/lock chroot /mnt /usr/bin/env DISK=$DISK UUID=$UUID bash --login **Note:** This is using ``--rbind``, not ``--bind``.