0

At present, I'm playing around with a very small fileserver based around an Intel NUC, with the boot environment on a USB flash drive ("usbflash") and then using a large spinning disk ("HDD") for bulk storage. The HDD is entirely managed by ZFS, where the usbflash is a standard *buntu install with ext4 and a single large partition.

Is it possible/reasonable/smart to move /home, /var, and /tmp over to the ZFS partition? The write speed of the USB device is quite low and I'm also trying to minimize the writes to extend the usbflash lifespan. But at some level I'm also just messing around and trying to learn what does and doesn't work with ZFS ;-)

1
  • /boot would be the main directory to not put on strange filesystems, others should be less of an issue, keeping in mind that if /var fails to mount you could be in trouble more so than with the others. You can always try mounting the directories, non need to remove data from the USB right away, if it doesn't boot then you could edit the fstab on the USB from another computer.
    – fooot
    Nov 20, 2017 at 21:20

1 Answer 1

1

Is it possible/reasonable/smart to move /home, /var, and /tmp over to the ZFS partition?

Yes, but you need to be careful about what you move. Specifically, unless the ZFS modules are part of the boot RAMdisk, you probably want to leave /var and /tmp where they are.

First, create a pool (the zpool create command). Then, create file-systems (the zfs create command) within the pool, setting them to mount to a temporary location (the -o mountpoint=XXX option).

I would suggest that you move the data in single-user mode.

After the files have been moved, unmounts the source (USB) file-systems and the ZFS file-systems, and change the mount points of the ZFS file-systems (the zfs set command with the mountpoint=XXX option).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .