Hey all!
I’m exploring IncusOS for use in my homelab and currently looking into disaster recovery: “what if the boot drive fails?”
The goal is to have most (if not all) services running as a Linux container, including my NAS.
The idea is to attach two ZFS volumes to the NAS: one for regular shares and one for time machine backups.
I created the pool, and volumes, like so:
# Create the pool using edit
$ incus admin os system storage edit
# Create a data volume
$ incus admin os system storage create-volume -d ‘{“pool”:“data”,“name”:“incus”,“use”:“incus”}’
# Register it with incus
$ incus storage create data zfs source=data/incus
# Create volumes
$ incus storage volume create data shares
$ incus storage volume create data timemachine
To test the disaster recovery I did a clean install of IncusOS and imported the existing encrypted data pool using the backed-up encryption key:
$ incus admin os system storage import-storage-pool \
'{"name":"data","type":"zfs","encryption_key":"my-key"}'
The import succeeds and IncusOS is able to see the data pool and its existing volume:
$ incus admin os system storage show
WARNING: The IncusOS API and configuration is subject to change
config:
scrub_schedule: 0 4 * * 0
state:
drives:
...
pools:
...
- devices:
- /dev/disk/by-id/ata-WDC_WD6005FFBX-68CASN0_WD-AM023HZT
- /dev/disk/by-id/ata-WDC_WD6005FFBX-68CASN0_WD-AM02457T
- /dev/disk/by-id/ata-WDC_WD6005FFBX-68CASN0_WD-AM02H87T
- /dev/disk/by-id/ata-WDC_WD6005FFBX-68CASN0_WD-AM02K4DT
encryption_key_status: available
name: data
pool_allocated_space_in_bytes: 9.05216e+06
raw_pool_size_in_bytes: 2.4000277250048e+13
state: ONLINE
type: zfs-raidz1
usable_pool_size_in_bytes: 1.7437701439488e+13
volumes:
- name: incus
quota_in_bytes: 0
usage_in_bytes: 3.678336e+06
use: incus
After this import, incus does not know about the pool yet:
$ incus storage list
+-------+--------+--------------------------------------+---------+---------+
| NAME | DRIVER | DESCRIPTION | USED BY | STATE |
+-------+--------+--------------------------------------+---------+---------+
| local | zfs | Local storage pool (on system drive) | 4 | CREATED |
+-------+--------+--------------------------------------+---------+---------+
Trying to register the pool using incus storage create data zfs source=data/incus fails with Provided ZFS pool (or dataset) isn't empty and incus admin recover is not available on IncusOS.
I feel like I’m missing something but I can’t seem to figure out what. What am I doing wrong? Any help in figuring this out would be greatly appreciated!