Zfs dataset home folder mounting

What I usually do on my desktop Ubuntu systems (which aren’t ZFS on root) is this:

  • install system
  • boot into system, pop shell, install the ZFS stuff
  • zfs create poolname/home ; zfs create poolname/home/myname
  • rsync -ha /home/myname/ /poolname/home/myname
  • mv /home/myname /home/myname-dist
  • zfs set mountpoint=/home/myname poolname/home/myname

Now, log out and log back in, and you’ll be using your new ZFS-ified home directory. Once you’re satisfied everything works, rm -r /home/myname-dist and you’re good to go. If your pool fails to import or this specific dataset fails to mount, you’ll get an “amnesiac” login with no home directory contents at all, instead of a “whatever this looked like several years ago and I just hope I notice the change” like you’d get if you hadn’t renamed and then removed the original ext4 homedir.

1 Like