ZFS How to place /usr/ports and /usr/src on another disk

  • Thread starter Thread starter Deleted member 65953
  • Start date Start date
  • Tags Tags
    zfs
D

Deleted member 65953

Guest
I have two hard disks of the same size, and one 512 GB NVMe SSD. I am planning to install FreeBSD root on the two hard disks (ZFS mirror). This will create a ZFS pool with one vdev that consists of a two HDDs that mirror each other. I am thinking of using the 512 GB NVMe SSD to store /usr/ports, /usr/src, and possibly /usr/obj. How can I do this in ZFS? Should I create a new pool that consists of a vdev that contains the SSD? I was told that the loss of a vdev would cause the loss of the entire pool that contains the vdev. If the SSD fails, I want the data in the two HDDs to remain intact.
 
Just create the mirror let's say myzpool.
Or you can do nothing for /usr/ports ,/usr/src , /usr/obj and the data will be written to the two SSD's.
Or you can create separate dataset for /usr/ports , /usr/src , /usr/obj within myzpool. And the data will also be written to the two SSD's.
For a mirror if one of the SSD's should fail you can always recover the complete zpool from the good one.
 
Create datasets for /usr/ports, /usr/src, /usr/obj with mountpoints of /usr/ports, /usr/src and /usr/obj.
If the datasets are created on a vdev with redundancy the datasets have redundancy.

Now one has to think about what the purpose of those datasets are. Personally, I would not care about redundancy for any of those. Why? git is used to create the repos for /usr/ports and /usr/src, with /usr/obj being transient data (building ports or source).

Mirroring the OS is useful to make sure you can boot. Given your 2 HDD and one NVMe? I would install OS on the NVMe and use the other 2 in a mirror for say home directories and other user data. My experience has shown that making sure you can recover/keep intact user data is more important than keeping the OS intact (it become trivial to reinstall an OS vs recover user data).

Above is all my opinion
 
Given your 2 HDD and one NVMe? I would install OS on the NVMe and use the other 2 in a mirror for say home directories and other user data.
  • Is it possible to set up such a thing directly from the FreeBSD installer?
  • Should the NVMe be in a separate ZFS pool from the two HDDs?
 
My opinions only:
If you drop to a shell from the installer you can configure things exactly how you want to.
Yes, I would put the NVMe into a separate vdev/zpool from the 2 HDDs.

The way I've done it in the past:
physically unplug the the 2 HDDs, let the installer run and do it's thing on the NVMe device. Make sure it boots and you get everything configured correctly.
Then power down and plug the other 2 devices in, boot and manually configure the 2 hdds into your mirror, create data sets move mount points around etc. ZFS makes it trivial to move mountpoints. As long as you aren't "using" a location (cd to a directory or other thing like that) changing the mount point property happens instantly. /usr/home, /usr/src and /usr/ports are their own datasets by default making it even easier to move them.
/usr/obj by default is not so if you are upgrading from source you may have to explicitly import the pool its on as part of the process.
 
Back
Top