My NFS File Server
Hardware
My file server is an odroid-hc4 with two Seagate Ironwolf 4TB disks drives.
The odroid-hc4 has an onboard bootloader (Petitboot). Unfortunately the OS I’m using, Armbian, is not compatible with this bootloader. The recommended solution is to use the button on the bottom of the board to bypass Petitboot, boot into Armbian, and erase the onboard flash holding the bootloader.
Rather than commit to deleting the bootloader, I chose to solder a small piece of wire across the leads of the button so that it will register as permanently “pressed”. This way, if I choose to use another OS in the future, I can simply desolder the wire rather than reinstall the bootloader.
Software
The two hard disks are configured in a Btrfs RAID 1 array, and is automounted at boot by /etc/fstab
with default options plus nosuid
.
Hard Disk Power Management
Since this server acts as my secondary backup, I don’t access it very frequently.
To save on power, noise, and waste heat generation, I configured the drives with hdparm
to automatically spindown and enter standby mode after five minutes of inactivity.
# /etc/hdparm.conf
/dev/disk/by-id/ata-ST4000NE001_WS20TJSV {
spindown_time = 60
}
/dev/disk/by-id/ata-ST4000NE001_WS217FLZ {
spindown_time = 60
}
NFS Config
I am using NFS to share the Btrfs volume with my LAN.
I exported the volume, mounted at /archive
, to my LAN’s subnet with read and write permission.
# /etc/exports
/archive 192.168.22.0/24(rw)
I am using NFS v4, the most recent version. I don’t need any legacy support, so I chose to disable v3 and v2.
I configured rpc.mountd
and nfsd
to disable v2 and v3 support with the options -N 2 -N 3
.
The --manage-gids
option is part of the default config.
# /etc/default/nfs-kernel-server
RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"
RPCNFSDOPTS="-N 2 -N 3"
I also disabled rpc.statd
and enabled rpc.idmapd
.
# /etc/default/nfs-common
NEED_STATD="no"
NEED_IDMAPD="yes"