Category Archives: Unix

Articles related to the backbone structure of the machine army

Upgrading Samba 3 to 4 on FreeBSD

Since Samba 3.6 finally became end-of-life on FreeBSD, I’ve been forced to upgrade to Samba 4 on my servers. Luckily, it was a relatively painless update. # portmaster -o net/samba43 samba36-3.6.25_1 # mv /usr/local/etc/smb.conf /usr/local/etc/smb4.conf # mv /usr/local/etc/samba/* /var/db/samba4/private/ Finally, in /etc/rc.conf replace samba_enable=”YES” with samba_server_enable=”YES”. You can now restart Samba with the command: # […]

Reducing the number of disks in a ZFS pool

In the past I’ve shown how easy it is to expand a ZFS pool by adding extra disks. While this is the easiest way of expanding your storage capacity, it does come with a downside: From that moment on, you’re stuck with the larger number of disks, as ZFS does not have an easy way […]

Rebuilding world on FreeBSD

To upgrade FreeBSD between versions, I generally rebuild world with the latest sources. You can easily get the -RELEASE tarballs using fetch. I generally remove the old /usr/obj and /usr/src completely before I start. # cd /usr # rm -R obj # rm -R src # fetch “” # tar -x -C / -f src.txz […]

Growing a ZFS pool – Update

In an earlier post I described how you can grow an existing ZFS pool by replacing all the disks with bigger ones. That article was written several years ago, for FreeBSD 7.2. Currently we’re at FreeBSD 9.2, and the ZFS implementation has evolved somewhat, making that article no longer accurate. Most importantly, this concerns the […]

Using GMirror as a rollback tool.

On Thunderflare, which predates affordable solid-state drives, the OS is run from two small laptop drives in RAID 1. The RAID 1 is there so that if one of them crashes, I won’t have to do a complete reinstall. I’m lazy, sue me. Besides, a reinstall would take a lot of time, while setting up […]

SSH connections without a password

One of the basic ways of connecting to a FreeBSD server is through a secure shell, commonly referred to as ssh. The most basic usage of an ssh connection is to give you a full-fledged command prompt on the remote machine. However, the ssh connection can also be used as a tunnel for countless other […]

Expanding a ZFS pool

In an earlier post, I explained how it was possible to grow a ZFS pool by replacing all disks one-by-one. In that post, I also mentioned that if you have enough spare connectors available, you can easily expand the pool by adding another array of disks. A while back, I had replaced a bunch of […]

Growing a ZFS pool

I run several fileservers using the excellent ZFS filesystem. While originally a Solaris invention, it was successfully ported to FreeBSD for version 7. It is extremely well suited for large fileservers due to a combination of reliable software RAID (modes 1, 5, and 6), checksumming and snapshots. Combined with the option of nested filesystems and […]

Useful Unix Units: Screen (part 1)

Ok children, time to learn about screen, one of the most useful little Unix tools available today. First, let me get this straight: I don’t believe in the `one OS to rule them all’ crap. Horses for courses, and for server work, my horse rides a command line FreeBSD install. Digression: I’ve never much seen […]