20141106 a home freebsd file server - plembo/onemoretech GitHub Wiki

title: A home FreeBSD file server link: https://onemoretech.wordpress.com/2014/11/06/a-home-freebsd-file-server/ author: phil2nc description: post_id: 8775 created: 2014/11/06 12:37:26 created_gmt: 2014/11/06 17:37:26 comment_status: closed post_name: a-home-freebsd-file-server status: publish post_type: post

A home FreeBSD file server

This all started when I had problems with my favorite VPS provider's CentOS 7 image. Now look what I've gotten myself into! The main file server at Casa Lembo got rebuilt with FreeBSD 10 at the beginning of this week. This project was something I'd been thinking about for awhile. Ironically I had briefly considered going back to FreeBSD when working out the details of migrating the server from Fedora 20 to CentOS 7 several months ago. In the interim I had problems with that flaky cloud image for CentOS 7 and had begun to rethink some of my prior assumptions about what I needed in a home server. After making the decision to move off RAID storage in favor of a simple one volume per disk arrangement (with nightly rsync mirroring of the "primary" disk to a second -- leveraging a symlink as the logical "mount point" for applications that could be quickly changed to point at the secondary), it was clear this was going to be a major change that I wouldn't want to repeat for at least a year. I had been re-acquainting myself with BSD as the result of a (way too long and drawn out) project to replace the house's consumer grade wireless router/firewall with a PC Engines APU1c4 running pfSense (the plan is to deploy it over this coming weekend -- we'll see). The new server runs on the same old hardware, mostly. MSI LGA 1155 H61M-P31 (W8) Motherboard Intel Celeron G1610 2.6 GHz LGA 1155 CPU Crucial 1x 8GB 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) RAM SanDisk SDSSDP-064G-G25 2.5" 64GB SATA III SSD 3 x Western Digital Blue 1 TB 7200 RPM SATA 3.5" Disk Antec VP-450 450 Watt Power Supply Antec Three Hundred Two ATX Case No links for any of the above since stock is uncertain for every vendor I use (mostly Amazon and NewEgg). Just note that I'm a big fan of Antec (the PSU in question was actually a replacement resulting from Antec's making good on their warranty) and MSI motherboards. Those WD Blues are getting pretty old now (at least one is 3 years old at this point), so they're probably going to be replaced with 2 or 3 TB models over the next year. The increaed capacity will enable me to keep more complete backups of the data on some machines, as well as provide more space for video archives. Breaking free of RAID actually makes that easier since we won't lose any storage space if larger disks are mixed in with smaller. The filesystem is UFS2 with Journaled Soft Updates (FreeBSD 10 installs using this by default, for existing disk it can be turned on with "tunefs -n -j enabled /dev/[devname]"). Here's my current /etc/fstab:

# Device	Mountpoint	FStype	Options	Dump	Pass#
/dev/ada0p2	/		ufs	rw	1	1
/dev/ada0p3	none		swap	sw	0	0
/dev/ada1p1	/data1		ufs	rw	2	2
/dev/ada2p1	/data2		ufs	rw	2	2
/dev/ada3p1	/data3		ufs	rw	2	2

The SSD acts as the boot drive, and even though FreeBSD is notoriously slow in booting (at least as compared to Linux running systemd), the SSD noticeably shrinks the time from boot to a login prompt (I followed the directions in Using a Solid State Drive with FreeBSD to enable trim on the disk: booting to Single User mode and issuing a "tunefs -t enable /dev/ada0p2"). Anectdotally, it's hard for me to tell the difference in boot times for this same server hardware on FreeBSD and its previous Linux operating environment (which, running CentOS 7, used the supposedly boot time-accelerating systemd). Services include an Apache 2.4 web server, BIND 9.9, dhpcd, nfs v3, ftpd and the same OpenDJ instance that previously ran on Linux (the ease of getting this last to work was a pleasant surprise, literally all I had to do was unzip my archive copy, change the installation and JDK paths and run "start-ds"). Over the next couple of days I'm going to install and configure Samba, although it's more likely my Windows clients are going to make more use of WebDAV (they already download most content with their web browsers). antec302 References: FreeBSD 10 Release Notes FreeBSD 10 Errata The FreeBSD Handbook

Copyright 2004-2019 Phil Lembo