ZFS: Move /home to another pool

This is my first foray into ZFS and I thought I’d give Antergos a try as it works with it out the box (My go-to distro: Solus, does not / will not ).

During install you only get the option to build a single ZFS pool, the one you are installing to and even if you check: “create /home on another partition” it seemingly does nothing for the ZFS install route :frowning:

So now I’ve got my root pool set up, booted in and set up my data pool… But I want to move /home onto my 4TB data pool (as I’m just feeling out ZFS at the moment and my root is a tiny 64GB SSD)

The basic process will be something like this (i don’t have ZFS running on any box handy at the moment, but this is from memory).

  • create a home dataset on the other pool
  • copy/move your data to that location
  • turn the ZFS option off on the root dataset home folder to be mounted under home (i.e., alter/remove the mountpoint option)
  • turn on the ZFS option on the other dataset to mount under /home

You may need to read the manual for specifics, but that should be the basic idea.

edit:
see: man zfs and the section regarding zfs options and mountpoints

thro’s pretty much dead on. I’d :-

  1. Set the existing home directory to legacy mount: zfs set mountpoint=legacy root/home. zfsThis may unmount it automatically but if not: zfs unmount root/home. Just to be really cautious, you could also make it read-only: zfs set readonly=on root/home.

  2. Mount the old home somewhere else: mount -t zfs root/home /mnt

  3. Make the new home: zfs create data/home; zfs set mountpoint=/home data/home; zfs set compress=on data/home

  4. Use rsync to copy the stuff across (it’s kind of nice to preserve ctimes and the like): cd /mnt; rsync -arv * /home (I can never remember whether you need a trailing slash or not).

(mostly from memory)