I have Mint 19 installed on a fairly old machine, where the performance isnt great. I was able to move the swap partition to a ZFS pool with these instructions. However, I want to move the /tmp and /var/temp to the ZFS pool for increased disk speed, as well. However, I cant seem to find decent instructions on how to do that. How should I go about moving those two folders into a ZFS pool?
1 Answer
Replace rpool with your ZFS pool name in the instructions below.
Move /tmp to ZFS
Move your existing
/tmpdirectory somewhere else:mv /tmp /tmp2Create a ZFS file system for
/tmp. Note that themountpointproperty should belegacydue to an outstanding race condition bug mentioned in the ZFS on Linux wiki [Archive, step 4.11].zfs create -o mountpoint=legacy rpool/tmpCopy the contents of your old
/tmpfolder to the new one:rsync -avHXShPs /tmp2/ /tmp/Verify that the contents copied over correctly before deleting the old
/tmpfolder:rm -rfv /tmp2Add the new
/tmpfolder to/etc/fstabso that it is mounted on boot:echo "rpool/tmp /tmp zfs defaults 0 0" | tee -a /etc/fstab
Move /var/tmp to ZFS
Basically the same instructions apply.
mv /var/tmp /var/tmp2zfs create -o mountpoint=none rpool/var zfs create -o mountpoint=legacy rpool/var/tmprsync -avHXShPs /var/tmp2/ /var/tmp/rm -rfv /var/tmp2echo "rpool/var/tmp /var/tmp zfs defaults 0 0" | tee -a /etc/fstab