Solved A reasonable partitioning scheme?

Currently the hard drive containing my FreeBSD installation is partitioned as below:

Existing_UFS_ada0.jpg


However, I'm planning on doing a fresh installation of FreeBSD using ZFS on an identical Seagate Barracuda hard drive, and I'm planning on using the below partitioning scheme:

Planned_ZFS_ada0.jpg


Additionally, I also have a second one terabyte Seagate Barracuda installed in the same PC, and I'm planning to format that drive in the below manner:

Planned_ZFS_ada1.jpg



I would like to use the second hard drive, ada1, to store back up documents, and to also store backup copies of certain system directories. I welcome any feedback regarding my above plans, and I would also like to know if I will have to make changes to my fstab file in order for the partitions on the second hard drive to be automatically mounted at startup. Also, sorry for the gigantic screenshots as I couldn't figure out how to import a table without scrambling all of information.
 
Ideally what you should do is create *one* zfs storage pool (eventually a mirror of ada0 and ada1 but you can start with one) and then create zfs filesystems you want with zfs create (man zfs-create). No need to have separate partitions - actually that will make things worse for you. Second, put all of standard system files in one zfs filesystem (/ /etc /bin /sbin /lib /libexec /usr/{bin,sbin,libexec} etc). Create a separate fs for /usr/src /home /home/<user> /var/crash /var/log /var/mail /var/tmp /tmp /var/audit /usr/ports /usr/src. I typically put /usr/local in a separate fs but I think the default setup you get (when installing from scratch) puts in the root fs. Separate /usr/obj if you decide to buildworld/kernel locally. You can create more fs for your specific needs.

Actually what I would recommend is this: if possible, swap ada0 and ada1. Then install from scratch on the new ada0 and let the installer default zfs filesystems. Once it is up and running, copy over files from your old ada0 (or the new ada1) and when you are satisfied add it as a mirror. Make sure the partition sizes match. gpart partitions should ada0p1 efi, ada0p2 freebsd-boot, ada0p3 freebsd-swap, ada0p4 freebsd-zfs. This is what I have in a VM:
Code:
gpart show
=>      40  67108784  nda0  GPT  (32G)
        40    532480     1  efi  (260M)
    532520      1024     2  freebsd-boot  (512K)
    533544       984        - free -  (492K)
    534528   4194304     3  freebsd-swap  (2G)
   4728832  62377984     4  freebsd-zfs  (30G)
  67106816      2008        - free -  (1004K)

I also recommend you first play with this using a a VM by giving it a couple of 32GB memory devices (man mdconfig) & installing from scratch to get familiar with all the steps, including adding a second disk for mirroring.

My rule of thumb for swap partition is about twice the memory size (so for example 16GB on each disk if you have 16GB RAM).
 
However, I'm planning on doing a fresh installation of FreeBSD using ZFS on an identical Seagate Barracuda hard drive, and I'm planning on using the below partitioning scheme:
Don't do this. ZFS works quite different from what you might be used to. There's NO need for separate partitions (each would need to have a zpool on it).

Just follow the default ZFS install. And you'll automatically end up with this:
Code:
dice@maelcum:~ % zfs list
NAME                 USED  AVAIL  REFER  MOUNTPOINT
zroot                135G   295G    96K  /zroot
zroot/ROOT          3.33G   295G    96K  none
zroot/ROOT/default  3.33G   295G  3.33G  /
zroot/usr            548K   295G    96K  /usr
zroot/usr/home       260K   295G   260K  /usr/home
zroot/usr/ports       96K   295G    96K  /usr/ports
zroot/usr/src         96K   295G    96K  /usr/src
zroot/var            132G   295G    96K  /var
zroot/var/audit       96K   295G    96K  /var/audit
zroot/var/crash       96K   295G    96K  /var/crash
zroot/var/log        132G   295G   132G  /var/log
zroot/var/mail      8.74M   295G  8.74M  /var/mail
zroot/var/tmp        112K   295G   112K  /var/tmp

On your second disk, just create ONE freebsd-zfs partition, create a zdata pool from that partition and create two datasets within that pool; zfs create -o mountpoint=/dcs zdata/dcs and zfs create -o mountpoint=/bkp zdata/dkp
 
I found out the hard way that it is simply better to go with the default partitioning scheme during installation process, and that there doesn't seem to be much benefit to having a divided file system.
 
Back
Top