Lighthouse      Zap's Digital Lighthouse

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

For info

Useful links:
The Reg
Wiki soekris

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

 2019 (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)



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


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

  • 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

A new HPE Proliant Microserver

Last summer, one of the disks on my Proliant Microserver started generating some errors, so I decided to replace it with a newer generation, and I bought the Gen10 of the HPE Proliant Microserver.


It's a nice piece of hardware. I bought it without any disks inside, and bought 4 Seagate 6 TB NAS drives from Amazon on Prime Day.


So the question was: should I put FreeBSD on that machine, or should I install FreeNAS given that it's mostly used as a file server for my home network?

After some back and forth, I decided to put FreeBSD onto it.

Now, a bit of a nasty surprise awaited me: the HPE Proliant Microserver Gen10 does not boot FreeBSD out of the box. A known issue prevents it from booting the GENERIC kernel as is. The bug is described here, and unfortunately it doesn't look like it's going to be fixed in 11.2, 12.0, or beyond (though it seems like this patch ought to fix the issue).

However, the problem is easy enough to fix: it just needs the FreeBSD system to have a file called /boot/loader.conf that contains the following line: hw.pci.realloc_bars="1"

and then the O/S just boots normally.

I have put the 4 Seagate drives in the enclosure, and added a small USB thumbdrive in the internal USB port to act as the boot device. I will format all the drives as a ZFS RAID-5 configuration and put all of the data and important files onto there.

The configuration of the new fileserver is the topic of the next blog entry.

Question: my experience with USB thumbdrives is so-and-so... after a while they just seem to become corrupted. I see three possibilities to alleviate that:

  1. Have 2 thumbdrives and periodically (daily?) rsync the content of the real live one onto the other. If the first one ever becomes corrupted, just discard it and use the second one, which should be fine.

  2. Use nanoBSD to produce an O/S that will seldom write onto the USB thumbdrive and therefore greatly extend its life.

  3. Ignore the problem and hope the USB thumbdrive never fails (of course, making backups of the USB thumbdrive onto another system so that if it did fail, I could create another one from the backup andi bring my fileserver back to life).

Stay tuned to see what I will decide to do next :-)

/hardware | Posted at 01:05 | permanent link

Sun, 11 Nov 2018

The 11th of November 2018


Today is the 100th anniversary of the signature of the armistice which ended World War One.

I had the opportunity to visit the beaches of Normady in 2011, including the Canadian monument at Vimy and the cemetaries where many of our fellow countrymen are buried having given their life in service to their country to fight for liberty.

On 11/11, we like to remember them and all of the brave soldiers who have given (and are still giving) time and effort to help protect us in war and peace alike.

War is always horrible and politics on a global scale is always complicated. But on this Remembrance Day, let's all find a moment to remember all of those who have fought and are fighting for us.


And on this special day, let's all remember John McCrae's poem, "In Flanders Field":

In Flanders fields the poppies blow
    Between the crosses, row on row,
  That mark our place; and in the sky
  The larks, still bravely singing, fly
Scarce heard amid the guns below.

We are the Dead. Short days ago
We lived, felt dawn, saw sunset glow,
  Loved and were loved, and now we lie
      In Flanders fields.

Take up our quarrel with the foe:
To you from failing hands we throw
  The torch; be yours to hold it high.
  If ye break faith with us who die
We shall not sleep, though poppies grow
      In Flanders fields.

Peace to all.

/misc | Posted at 17:52 | permanent link