ZFS: Convert a One Disk Pool in Two Disks Mirror

root's picture

The following pool is normal, not mirror, on one disk

18:02:00 root@eeny:~# zpool status
  pool: tm
 state: ONLINE
  scan: resilvered 3.11T in 16:27:30 with 0 errors on Fri Apr  1 13:07:34 2022
config:

	NAME        STATE     READ WRITE CKSUM
	tm          ONLINE       0     0     0
	  sdb1      ONLINE       0     0     0

I have another disk, same size and I would like to convert this pool into a mirror one

NOTE: For that, you need to use attach. DO NOT USE add because you will create a STRIPPED (RAID0) instead of Mirror (RAID1).

18:04:59 root@eeny:~# zpool attach -f tm /dev/sdb1 /dev/sdc1
18:05:38 root@eeny:~#

Now the pool is mirrored. Must wait for sync to be done

18:12:10 root@eeny:~# zpool status
  pool: tm
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
	continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Sat Apr  2 18:05:32 2022
	242G scanned at 620M/s, 4.15G issued at 10.6M/s, 3.16T total
	4.13G resilvered, 0.13% done, 3 days 14:28:09 to go
config:

	NAME        STATE     READ WRITE CKSUM
	tm          ONLINE       0     0     0
	  mirror-0  ONLINE       0     0     0
	    sdb1    ONLINE       0     0     0
	    sdc1    ONLINE       0     0     0  (resilvering)

errors: No known data errors

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root