Since [Eoan Ermine (Ubuntu 19.10)](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction), Ubuntu installer (for desktop) can use [ZFS](https://github.com/openzfs/zfs) as root file-system.
The current LTS, [Focal Fossa (Ubuntu 20.04)](https://ubuntu.com/blog/zfs-focus-on-ubuntu-20-04-lts-whats-new) provides only a mono-disk installation, here's how to enhance a mono-disk installation into a mirrored-disk installation to use data resilience provided by ZFS.
🚧 _ZFS on root is still experimental_ 🚧
🔧 Howto
--------
*`sda` is the disk used by installer
*`sdb` is the disk we're going to add to create a mirror
1.`rpool`: containing root _pool_, with all file-system
```bash
user@focal:~$ zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
bpool 1,88G 91,2M 1,79G - - 0% 4% 1.00x ONLINE -
rpool 920G 3,19G 917G - - 0% 0% 1.00x ONLINE -
```
```bash
user@focal:~$ zpool status
pool: bpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
f0771fca-06 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
f0771fca-07 ONLINE 0 0 0
```
Run `fdisk` to copy `sda` partition table to `sdb` using sfdisk compatible script files ([_see manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/fdisk.8.html#script%20files)).
```bash
user@focal:~$ fdisk /dev/sda #copy to file with O
user@focal:~$ fdisk /dev/sdb #import from file with I
```
```bash
user@focal:~$ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 513M 0 part
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 2G 0 part [SWAP]
├─sda6 8:6 0 2G 0 part
└─sda7 8:7 0 927G 0 part
sdb 8:16 0 931,5G 0 disk
├─sdb1 8:17 0 513M 0 part
├─sdb2 8:18 0 1K 0 part
├─sdb5 8:21 0 2G 0 part
├─sdb6 8:22 0 2G 0 part
└─sdb7 8:23 0 927G 0 part
```
[Attach](https://www.freebsd.org/doc/handbook/zfs-zpool.html#zfs-zpool-attach) the twin partitions on pools :
1. [_Enhancing our ZFS support on Ubuntu 19.10 – an introduction_](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction) - `ubuntu.com`