Skip to content

Instantly share code, notes, and snippets.

@aaiezza
Last active September 3, 2026 03:42
Show Gist options
  • Select an option

  • Save aaiezza/1d81f47a38c6124d30ab91a692e3d1b6 to your computer and use it in GitHub Desktop.

Select an option

Save aaiezza/1d81f47a38c6124d30ab91a692e3d1b6 to your computer and use it in GitHub Desktop.
Hercules NAS Worklog

Hercules NAS Worklog

Years ago (2016-ish) I build a Network-attached storage server running headless Ubuntu server OS.

Hardware Details Summary

// Fill in more details here on the hardware configuration

Worklog

2023-01-10

I realized that the upgrade to Ubuntu 22.04 (Cannot remember which version I upgraded from) which took place on 2022-12-16 ended up breaking my DNS. The way I discovered this was that I had a cron job that was failing to retreive information from GitHub. Thankfully, I found the answer here: https://unix.stackexchange.com/a/725268/126716 After modifying the /etc/network/if-up.d/resolved file, my problem was solved.

2023-02-04

The hard disk with vdev name oly_sg3T-1 was formally a spare for the zpool. However, the disk is burned out and needs to be replaced so that if a drive in the pool fails in the future, the spare can replace it maintaining the system's integrity. A 4TB Western Digital Red HDD should do fine.

Procedure

While my drives and hardware support "hot swap" of drives, the (inexpensive) case in which Hercules lives is less forgiving, so I need to get inside and unscrew the drive from its place.

Before I turn the machine off though, I have enough information to add a vdev id. Following my existing naming convention for my virtual device names, the id of the new drive will be oly_wd4T-3 and I added the following line to the /etc/zfs/vdev_id.conf file:

alias oly_wd4T-3  ata-WDC_WD40EFZX-68AWUN0_WD-WX12D5238NAC

After it's been added, I could do a hotswap with the server running and simply run sudo udevadm trigger, but like I said, not worth it.

At this point, the machine was shutdown, and I remove the broken Seagate drive with serial ata-ST3000DM001-9YN166_Z1F1F6ZZ and properly discard of it.

While I'm in here, I also removed and discarded of another drive that has been broken for a while as well: oly_sg3T-2, aka ata-ST3000DM001-9YN166_S1F0MZET.

The new WD is put in its place and the machine is closed and started.

Running the command ls -lAh /dev/disk/by-vdev indicates the harddrive was added successfully.

The next step is to add the spare to the zpool with the following command:

sudo zpool add olympus spare oly_wd4T-3

The action appeared successful after a few seconds.

To further confirm our success, I ran the following command to ensure the spare is added and available:

zpool status

Output

      NAME            STATE     READ WRITE CKSUM
      olympus         ONLINE       0     0     0
        mirror-0      ONLINE       0     0     0
          oly_wd4T-1  ONLINE       0     0     0
          oly_sg2T-1  ONLINE       0     0     0
        mirror-1      ONLINE       0     0     0
          oly_wd1T-1  ONLINE       0     0     0
          oly_wd4T-2  ONLINE       0     0     0
        mirror-2      ONLINE       0     0     0
          oly_wd1T-2  ONLINE       0     0     0
          oly_wd6T-1  ONLINE       0     0     0
      cache
        oly_int512G   ONLINE       0     0     0
      spares
        oly_wd4T-3    AVAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment