how to put system and /home on separate drives?

Long term Linux user here (with stress on user). Been keeping an eye on FreeBSD for a while. With 13.0 around the corner, I think I'm finally ready to make the switch, especially since afaik 13.0 will offer fairly complete hardware support for my Thinkpad E570.

Before I get started, I have a question, though. I have a setup with 2 hard drives, one SSD and one actual "spinning disk" one. I would like to put the system install on the SSD, and the /home partitions/slices on the HD. What would be a good approach to achieving this (with a fresh install)? Also, am I correct in assuming that I probably want to be using UFS in this case, and not ZFS? I've read this, but still can't quite wrap my head around it.
 
Just do the install on the SSD first. Don't create a user during the installation. Add the other disk when the system's installed and booted. It's much easier to do. Not creating the user during the install will also make sure /home is empty, so there's nothing to move around.

Also, am I correct in assuming that I probably want to be using UFS in this case, and not ZFS?
Irrelevant. You can create two pools, one for each disk. Don't mix SSDs and HDs on the same pool though (unless you use the SSD as L2ARC or ZIL).
 
You can create a mount point for /usr/home on the HDD during the installation. It will look like this under UEFI boot.
This is VM so ignore the size information of the partitions. The actual mount point is /usr/home not visible on the picture below

1618216707752.png


After the installation it will look like this:

1618217052023.png
 
These are my quick notes on how I did it when I created a large ZFS array:

Code:
zpool create zfspool raidz2 da0 da1 da2 da3 da4 da5
zfs create zfspool/home
cp -rp /home/* /zfspool/home
rm /home
mv /usr/home /zfspool/home/backup
ln -s /zfspool/home /home
ln -s /zfspool/home /usr/home

I ran rm -rf /zfspool/home/backup when I was happy with the new home directories.
 
Hi VladiBG,

at which part of the install process do you get to that screen so that you can select a different drive?

Kindest regards,

M
 
Thanks for your advice, VladiBG and Jose. It's probably going to be a couple of weeks before I get around to setting up FreeBSD on my machine, but I'll report back here once I'm done.
One thing I'm still torn about is whether I should use UFS or ZFS. Been reading up on this here and there. The higher RAM demands of ZFS don't concern me that much, but I'm worried that ZFS will be just a bit too alien for me, considering I'm not exactly a computer wiz.
 
Try ZFS you'll never go back to the old way of dealing with disks, partitions, etc. Super clean and logical separation of concerns.
 
at which part of the install process do you get to that screen so that you can select a different drive?
During partitioning when you select between UFS, Manual, Shell, ZFS. When you select for example Auto (UFS) at the next screen you have option to add additional partitions on other hard disk, to select the partition type, and mountpoint.

 
I did something like this on my home server, and I used ZFS. I have a couple of small hard drives mirrored for the system, then a couple of large drives mirrored for /usr/home. It's been a while, and I didn't document my process (bad jardows!) but I do remember I setup the whole system on the smaller drives first, then later connected the large drives, mirrored them, and moved the /usr/home to a dedicated zpool on those drives. It wasn't that complicated, though setting it up using UFS during install (especially since you're not mirroring anything) may be much more simple.
 
Thanks for your advice, VladiBG and Jose. It's probably going to be a couple of weeks before I get around to setting up FreeBSD on my machine, but I'll report back here once I'm done.
One thing I'm still torn about is whether I should use UFS or ZFS. Been reading up on this here and there. The higher RAM demands of ZFS don't concern me that much, but I'm worried that ZFS will be just a bit too alien for me, considering I'm not exactly a computer wiz.
In my opinion, ZFS is the easier, more flexible choice. The learning curve is pretty small compared to the gain in flexibility and power. If you know what a partition is (and you surely do, if you have used Linux a while), you already know some details that are not really needed for ZFS. Yes, ZFS is uber powerful and has many, many advanced features, but for the basic setup of put a filesystem on my disk, manage it, snapshots and so on, it's drop dead easy and you gain boot environments which are useful for risk-free upgrades (although I saw Vermaden's boot environments for UFS, so that may not be as big a differentiator as it was).

If you choose ZFS on boot during the install, it's pretty much set it and forget it unless you want to add disks or make changes, then it's super easy to do those changes.
 
decuser Im kindly and most politely disagree with following part of your last statement

If you choose ZFS on boot during the install, it's pretty much set it and forget it unless you want to add disks or make changes, then it's super easy to do those changes
then it's super easy to do those changes

Every tutorial i have found including bsd handbook is focused on auto installation or manual installation while you using 1 physical hdd or sdd.
As long i make my partition on 1 physical drive it is all good. If i want to poot os on ada0 and user space on ada1 then crazy things start to occure.
God forbid to put home in a fashion of /home (linux kinda way) not /usr/home (standard bsd way) on separate drive during install.
If i only could view how the auto partitioning name and set the partitions I would even not write this post.
How on earth I can put my home or at last /usr with all what is in it on second separate drive
Let say i have 120GB ssd and 2TB HDD
When i go manual partitioning zfs during install i end up with.
after 5 days im sick of it
 

Attachments

  • syf.png
    syf.png
    32.4 KB · Views: 83
As long i make my partition on 1 physical drive it is all good. If i want to poot os on ada0 and user space on ada1 then crazy things start to occure.
God forbid to put home in a fashion of /home (linux kinda way) not /usr/home (standard bsd way) on separate drive during install.
I have all my users' home dirs in /home which is mounted via NFS and never had any issues, neither with new installs nor with upgrades.
When i go manual partitioning zfs during install i end up with.
after 5 days im sick of it
Instead of ranting and posting a screenshot that only shows it's "broken", maybe open a new thread, describe exactly what you did (including gpart output, /etc/fstab and whatever else is relevant, so people can actually help you, pointing out what exactly is wrong?
 
grafi Going by memory since it's been a long while, this is how you do it after the fact:

zfs is datasets. the installer by default create a dataset named user/home:
zroot/usr/home 24.6G 179G 24.6G /usr/home
making sure noone is logged in or using /usr/home/username, so
as root from a console you use zfs commands to rename the existing zroot/usr/home dataset something like
zfs rename zroot/usr/home zroot/usr/home.ORIG
use zfs commands to change the mountpoint, something like
zfs set mountpoint=/usr/home.ORIG zroot/usr/home.ORIG

then assuming your second device is hooked, you use gpart to set it up, set gpt scheme on it, create a partition of type freebsd-zfs, make sure you align and label it as something like "zfs1" or something meaningful
then simply use zfs commands to create a new pool on that partition
zpool create storage gpt/zfs1 or ada1p1 (of course you use your correct label and device names)
then create your new user/home dataset:
zfs create storage/home
set the mountpoint to /usr/home
zfs set mountpoint=/usr/home storage/home

Now you have your home directories on a different device. If you have data in your existing user directories, many ways to copy it over a simple way would be to use tar piping through stdout/stdin. Or rsync or cp -R /usr/home.ORIG /usr/home.
One could also use zfs send/zfs receive if desired. I find that for a home user system with a single or couple of users, cp or tar works good enough.

The installer you would need to drop to a shell at some point and do the partitioning and zpool and dataset creation by hand, pay attention to the mount points, lots of things to keep track of.
That is why people suggested do the install on a single disk, do not create a user, simply get the system up and running. Then you do what I've outlined here, since there are no user directories yet, nothing to copy.

ZFS I learned you want to get yourself copies of the following books by Michael W Lucas:
FreeBSD Mastery: Storage Essentials
FreeBSD Mastery: ZFS (with Allan Jude)
FreeBSD Mastery: Advanced ZFS (with Allan Jude)
Pretty much any "How do I do this" question on ZFS I've ever had are answered in them.
 
Do not get me wrong but mate! I love you :)
Thank You a big time. I will save your post and try to play with zfs.
I'm kinda fed up with Linux and the direction in which Linux as a whole is going.
Since I'm on Linux for very long time, the only logical option for me is FreeBSD or BSD in because it is unix and linux, is unixLIKE system.
Cannot thank you enough
Take care and have great day
 
Back
Top