2

Already read this thread but in this case the user already had a ZFS filesystem.

I got a server where the OS is running from a single SSD. So if this SSD fails, the server is "gone". Now I got a second SSD with the same storage capacity and my goal is get a ZFS mirror without reinstalling the whole OS.

Is that possible? How would I do that? I would also be okay with a RAID-1 setup, but from what I've read online ZFS is the superior system.

Thanks in advance for any help

davesie

davesie
  • 21

1 Answers1

1

This is feasible if your disk filled for less than 45% of its space (assume it as /dev/sda).

To do so you need:

  • partitioning your second drive (/dev/sdb) to 2 partitons with equal size.
  • create second mirrored zfs pool from created partitions. E.g. zpool create tank /dev/sdb1 /dev/sdb2
  • create necessary datasets on new pool
  • copy your OS disk to new tank partition (using zfs send for instatnce)
  • reconfigure grub to boot from a new pool
  • reboot from new pool
  • now destroy your old pool
  • clear zfs data from sda disk using zpool labelclear ...
  • replace one of devices (/dev/sdb1 partition) in your new pool with /dev/sda, wait for resilvering completion
  • install grub to your sda device
  • reboot to ensure your server is bootable from /dev/sda
  • detach /dev/sdb2 partition from tank pool
  • clear /dev/sdb partition table
  • replace /dev/sdb2 partition in tank pool with /dev/sdb and wait for resilvering completion
  • install grub to your sdb device

I assume that you do not have the ability to temporary backup your system disk somewhere. So I recommend training on some local VM first. Good luck!

Andrey
  • 381