Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[TrueNAS] Replacing failed disk

Yesterday I got a mail about a failed disk in my TrueNAS system.

So I logged in and checked the Alerts and also zpool status.

Luckily I had an unused disk lying around. So just did a quick look in the TrueNAS Wiki (https://www.truenas.com/docs/hub/tasks/advanced/disk-replace/) and switched the drives…

After 5 minutes everything was done and the resilvering started.

It took about 4 hours for the 3TB disk. A zool clear poolname removes the error message and the pool was back online.

[ZFS] Send unencrypted dataset to encrypted pool

I recently added some disks to my TrueNAS server and created a new encrypted pool named data2 on it. My old pool data was created years ago, before the zfs encryption feature was released, so it is an unencrypted pool. Now I wanted to move a dataset, i.e. photos, to my new pool data2. I tried to archieve this via TrueNAS Gui using the Replication Task, but always got errors that it’s not possible to send unencrypted data to an encrypted pool.

On Reddit I found a thread with a solution using the parameter -x encryption.

Because I prefer keeping all my snapshots when moving a dataset, I send my oldest snapshot first.

zfs send -v data/photos@manual-01-05-2019 | zfs recv -x encryption data2/photos

In the next step I created a new snapshot and did an incremental send with the parameter -I (send incremental snapshots).

zfs send -v -I data/photos@manual-01-05-2019 data/photos@manual-01-10-2020 | zfs recv -F -x encryption data2/photos

Compare the datasets with zfs diff (see example here) or use the classic diff command to compare the folders:

diff -qr /mnt/data/photos /mnt/data2/photos
#or in background
diff -qr /mnt/data/photos /mnt/data2/photos >> diff.output & disown
#check if process finished with "ps"
less diff.output

Check if all Snapshots were replicated with:

zfs list -t snapshot | grep data2/photos

After that I just changed the path for my NFS photo share and did a sudo mount -a on the clients. Now the whole dataset is moved and encrypted.

[NAS] OpenSource NAS-Systeme & Self-hosting Lösungen

NAS

TrueNAS Core (FreeBSD) / TrueNAS Scale (Debian)
XigmaNAS (FreeBSD/FreeNAS, ehemals NAS4FREE)
OpenMediaVault (Debian)
Xpenology (bootloader for Synology’s DSM)
OmniOS Community Edition (Illumos) mit Napp-IT
Rockstor (CentOS)

Self-hosting / Hypervisor

YunoHost (Debian)
Proxmox (Debian)
OmniOS Community Edition (Illumos)
SmartOS (Illumos)
Danube Cloud (SmartOS)
XCP-ng (XenServer / heute Citrix Hypervisor)