I run my backups on a stack that consists of:
- md-raid mirror
- LUKS encryption
- ZFS zvol
This works nicely as it’s easy to split off an encrypted backup disk to take offsite, but since ZFS encryption hasn’t come to Linux yet, it’s still a stack of technologies to manage. My backup set gets ever larger, so to expand the backups capacity, I bought a pair of Hitachi 3TB SATA drives. Assuming:
- the old drives were sdc and sdd
- the new drives are sde and sdf
- the md mirror is md3
- the LUKS volume is called backup and presents as dm-0
- the zfs pool is called ‘backup’
to expand the stack:
- mdadm –add /dev/md3 /dev/sde
- mdadm –fail /dev/md3 /dev/sdc
- mdadm –remove /dev/md3 /dev/sdc
- wait for rebuild to finish (cat /proc/mdstat)
- mdadm –add /dev/md3 /dev/sdf
- mdadm –fail /dev/md3 /dev/sdd
- mdadm –remove /dev/md3 /dev/sdd
- wait for rebuilt to finish
- mdadm –grow –size=max /dev/md3
- cryptsetup resize backup
- zpool online -e backup dm-0
and then run ‘zfs list’ to ensure the size is updated. Conveniently, this can all be done without taking any of the filesystems offline.