Replacing a Disk in a Zpool

ZFS is one of my favorite file systems. I use it at home on my nas server (running FreeBSD) as well as my Fedora 32 desktop. Today, I’m going to show you (and my future self) how to replace a (faulty) disk in a Zpool. The server I’ll be working on is nas2 and the pool is tank. List the status of the current pool. Password: root@nas2:~ # zpool status tank pool: tank state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using 'zpool online'. see: http://illumos.org/msg/ZFS-8000-2Q scan: resilvered 472K in 0 days 00:00:02 with 0 errors on Sun Aug 23 16:17:21 2020 config: NAME STATE READ WRITE CKSUM tank DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 diskid/DISK-Z4Z46MXG ONLINE 0 0 0 620907994788427922 UNAVAIL 0 0 0 was /dev/diskid/DISK-Z1E4ZCM2 mirror-1 ONLINE 0 0 0 diskid/DISK-Z1E5PFCH ONLINE 0 0 0 diskid/DISK-Z4Z46XQP ONLINE 0 0 0 errors: No known data errors From the above output, we can see that one of the disk in mirro-0 vdev was missing. (In fact, it has been removed prior to the system rebooted. I also inserted a new disk to the system.) ...

September 20, 2020 · 3 min · 445 words · kenno

Upgrading Freebsd 11.2 to 12.0-RELEASE

FreeBSD 12.0-RELEASE was released today, and that means it’s time to upgrade 2 of FreeBSD 11.2 machines to this latest version. One of my FreeBSD boxes is a desktop used at work, and the upgrade went well without any issues. In this post, I’m going to document how the upgrade is done on my nas server at home. First ensure that the FreeBSD is up to date: root@nas:~ # freebsd-update fetch src component not installed, skipped Looking up update.FreeBSD.org mirrors... 2 mirrors found. Fetching metadata signature for 11.2-RELEASE from update1.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 11.2-RELEASE-p6. Begin to perform the upgrade: ...

December 12, 2018 · 4 min · 697 words · kenno

Upgrading my nas from FreeBSD 11.1-RELEASE to 11.2-RELEASE

FreeBSD 11.2-RELEASE was released a few days ago. This means it’s time to upgrade the FreeBSD running on my nas. For the most part, this was all what I did: # freebsd-update -r 11.2-RELEASE upgrade # freebsd-update install # reboot # freebsd-update install After it’s been upgraded, I also need to update the Zpool. root@nas:~ # zpool status pool: zroot state: ONLINE status: Some supported features are not enabled on the pool. The pool can still be used, but some features are unavailable. action: Enable all features using 'zpool upgrade'. Once this is done, the pool may no longer be accessible by software that does not support the features. See zpool-features(7) for details. scan: scrub repaired 0 in 0h0m with 0 errors on Tue Jan 23 23:54:42 2018 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 gpt/zfs0 ONLINE 0 0 0 errors: No known data errors Let’s upgrade the zpool zroot as suggested: ...

June 30, 2018 · 2 min · 353 words · kenno

How to extend ZFS partition

I have a FreeBSD server which used to run of a smaller SSD drive. When replaced with a larger capacity SSD by using dd command to clone the disk, there is free space allocated. I want to extend the existing zroot pool to use this space. The following describes how I achieve this with the help of a forum post. Let’s list some information about the zroot pool: root@nas:~ # zfs list zroot NAME USED AVAIL REFER MOUNTPOINT zroot 4.88G 50.8G 144K none List the partition scheme of the drive I’d like to extend my zroot zpool with: ...

March 11, 2018 · 2 min · 302 words · kenno

Zpool Not Automatically Mounted on Boot on Fedora

I love ZFS, but there is something that has annoyed me for quite sometimes – the zpool doesn’t get automatically mounted on boot. To work around this, I had to login as root and run: # zpool import tank to import tank pool before I login with my normal user account. Well, I finally found a solution. This is what’s written on zfsonlinux/zfs WIFI about Fedora specifically: Systemd Update: When upgrading to the zfs-0.6.5.8 release it’s recommended that users manually reset the zfs systemd presets. Failure to do so can result in the pool not automatically importing when the system is rebooted. ...

December 20, 2016 · 1 min · 200 words · kenno