Skip to content

Exporting and Importing a user dataset onto another machine

q5sys (JT) edited this page Feb 29, 2020 · 2 revisions

Get dataset list

zfs list

Look for the dataset for your ~ directory. In this case it is:

trident/usr/home

Take note of the size of the dataset.

#Mount the external drive you're going to use In our case were are using a USB Stick. Make sure whatever drive you select is large enough for your dataset.

Fat32: sudo mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /media/usbstick ExFat: sudo mount.exfat /dev/da0s1 /mnt/usbstick NTFS: sudo ntfs-3g /dev/da0s1 /media/usbstick -o ro,uid=1001,gid=1001

create a snapshot

zfs snapshot -r trident/usr/home/@migration

Send to file

zfs send -R trident/usr/home@migration > /mnt/USBstick/tridenthomedir.zfs

Now the USB Stick contains a replica of your main_pool as it appeared at the moment when you took the snapshot. Take this over to the computer you wish to import your pool and plug in your external drive and mount it.

Receieve from file

You cannot be logged in as the user who's home directory you are importing.

This will completely overwrite the /usr/home directory. Any changes that were made previously, will need to be reapplied after you receive the older dataset.

zfs receive -F < tridenthomedir.zfs

#Reboot

sudo reboot