Lighthouse      Zap's Digital Lighthouse
   


About
Zap's Digital Lighthouse is
a Blosxom weblog for our digital outpost on the Internet

For info
info@rax.org


Useful links:
Google
Cyberpresse
The Reg
Slashdot
FreeBSD
LinkedIn
Twitter
Boursorama
RAX
zap
Soekris
xkcd
AirFrance
Wiki soekris
Wikipedia
Wiktionary
ACME
blosxom

Categories:
/FreeBSD (27)
/admin (3)
/blosxom (6)
/games (3)
/hardware (17)
/inet (4)
/misc (37)
/notwork (2)
/software (11)
/tech (1)

Archives:
 2023 (1)   
 | June (1)
 2021 (2)   
 | January (2)
 2020 (2)   
 | December (1)
 | September (1)
 2019 (2)   
 | November (1)
 | July (1)
 2018 (6)   
 | December (1)
 | November (3)
 | January (2)
 2017 (4)   
 | December (2)
 | January (2)
 2016 (3)   
 | November (1)
 | October (1)
 | January (1)
 2015 (9)   
 | December (2)
 | November (1)
 | October (1)
 | June (1)
 | May (2)
 | February (1)
 | January (1)
 2014 (9)   
 | December (1)
 | October (1)
 | September (1)
 | August (3)
 | May (2)
 | April (1)
 2013 (20)   
 | October (3)
 | June (4)
 | May (2)
 | April (7)
 | March (1)
 | January (3)
 2012 (60)   
 | December (4)
 | October (1)
 | July (5)
 | June (7)
 | May (1)
 | April (6)
 | March (3)
 | February (14)
 | January (19)
 2011 (3)   
 | December (1)
 | November (2)
 2008 (1)   
 | October (1)


Blosxom

       

home :: FreeBSD :: newNAS2018

Mon, 12 Nov 2018

Setting up my new home NAS with FreeBSD 11.2

FreeBSD's 25th anniversary

So, I've got my new HPE Proliant Microserver Gen10 last summer, but I hadn't had time to set up it yet.

I am setting it up with FreeBSD. (It's a sobering thought that FreeBSD is now 25 years old: I've been running it since the very first version, coming from 386BSD and Microport System V/AT before that.)

I've put the 4 Seagate drives in the bays and inserted a USB key with FreeBSD 11.2 on it in the internal USB port. As reported in the previous blog entry, I had to add a "/boot/loader.conf" file with

hw.pci.realloc_bars="1"

in it.

Then, I needed to:

  • Install packages with pkg: perl5, zip/unzip, zile, mutt, rsync, sudo, samba, and smartmontools

  • Copy the user accounts from my old proliant server onto the new datasink server. I haven't decided yet if I will shut down the old server or if I will just let it run on my network.

  • Install the 4 Seagate drives under ZFS... more on this below.

  • Copy the files from my old proliant server to the new one.

  • Activate NFS on the new server. With ZFS, I don't need to start the usual NFS server processes, as ZFS supports NFS sharing directly (see below).

  • Move the large external USB drive that I use for weekly rsync backups onto the new machine.

  • Configure regular backups, monitoring, etc. on the new server.

  • Exchange the names proliant and datasink on the two machines. Verify that the Windows machines and the Macs on my home network can access the new server transparently.

  • And that should be it.


Setting up the 4 Seagate disks with ZFS

Here is how I set up the four 6TB disks on that new server:

  1. Decided to use the 4 drives in a RAIS-5 configuration, which allows me to recover from a single drive failure. If the Microserver had had 5 drives, I would have used a RAID-6 configuration, but with 4 drives, it seemed like an exageration.

  2. Decided to create a single large ZFS pool with all of the drives in it.

  3. Also decided to limit the number of ZFS filesystems I create in my ZFS pool. For the limited usage I make of my little home server, I haven't found much use over the years for splitting the disk space pool into multiple logical filesystems, apart from sharing via NFS, so this time, I'm going with just a few filesystems: a large one called /data, a smaller one for user files called '/homes' that will be exported via NFS, and the usual /var and /usr.

  4. However, I've been running a ZFS snapshot script on my machine for the past few years (as explained here), and I've found it quite useful. So I decided to continue with them. So I must account for enough freespace in the ZFS pool for all of the data from the snapshots.

  5. For other uses, I'll create symbolic links into the /data zpool for /backups and others.

  6. Note: I have used the /dev/diskid/* devices to set up my ZFS pool, rather than the /dev/ada* devices. If I get a drive failure or take a drive out, I find the renumbering of ada devices to be a scary proposition. Similarly, when I use external USB drives, I give them GPT names and use these rather than /dev/da* which can change when you unplug/replug the USB connectors.

So, here are the commands that I've run to initialize the disk space on my new server, conserved here for future reference:

  • Check out which disks we have available:

    ls /dev/diskid

  • Create the ZFS pool (the ashift option specifies the drives have 4KB blocks)

    zpool create -o ashift=12 -m /zfspool zfspool raidz diskid/DISK-ZAD4QZAT diskid/DISK-ZAD4RS61 diskid/DISK-ZAD4V4N3 diskid/DISK-ZAD4V4N9
    (question: why have a mountpoint for a ZFS pool?)

  • Create the filesystems in my ZFS pool:

    zfs create zfspool/data mountpoint=/data
    zfs create zfspool/var mountpoint=legacy
    zfs create zfspool/home mountpoint=legacy
    zfs create zfspool/usr mountpoint=legacy
    zfs create zfspool/tmp mountpoint=legacy

  • Copy the existing stuff onto the new partitions and set the real mountpoints:

    foreach i ( var home usr tmp )
    mount -t zfs zfspool/$i /mnt
    ( cd /$i ; sudo rsync -aHv . /mnt/ )
    umount /mnt
    zfs set mountpoint=/$i zfspool/$i
    end

  • Share the /home dataset:

    zfs set sharenfs=on zfspool/home
    (check that this works... I am not sure)

/FreeBSD | Posted at 07:39 | permanent link