I'm on Ubuntu 16.04.1 LTS and I have a ZFS pool named unas containing two mirrored drives. I have now attached two more drives and I want to add these new drives to my unas pool as a pair of mirrored drives so that I end up with one pool, named unas, which contains 4 drives, grouped into mirrored pairs.

The results of the zpool status command, shown below, show my current configuration. What steps and commands do I use to mirror the two new drives and then add those mirrored drives to my unas pool?

Is it as simple as using the following command to add the two new drives as a mirrored pair?

$ zpool add unas mirror newDrive1 newDrive2

The results of my current zpool status are:

$ sudo zpool status
pool: unas
state: ONLINE
scan: scrub repaired 1.50M in 36h3m with 0 errors on Thu Jun  9 08:06:41 2016


NAME                                          STATE     READ WRITE CKSUM
unas                                          ONLINE       0     0     0
  mirror-0                                    ONLINE       0     0     0
    ata-WDC_WD30EFRX-68EUZN0_WD-WCC4N1VUU0LX  ONLINE       0     0     0
    ata-WDC_WD30EFRX-68EUZN0_WD-WCC4N7FSX6F9  ONLINE       0     0     0

errors: No known data errors

Yes, it is.

If you are unclear about such things in the future, just test them out with small files on your old pool first. You can create pools from regular files as long as their size is at least 64MB. The commands are the same, just give it the full paths of the files instead of the device paths.

On Solaris this would be:

# create your test files
cd /yourpool/yourfs
mkfile 100m sd0 sd1 sd2 sd3

# create pool
zpool create testpool mirror /yourpool/yourfs/sd0 /yourpool/yourfs/sd1
zpool status testpool

# expand pool
zpool add testpool mirror /yourpool/yourfs/sd2 /yourpool/yourfs/sd3
zpool status
| improve this answer | |
  • Might need -d to zpool import. – a CVn Jul 22 '16 at 12:55
  • 2
    Also, on Linux (which the question is tagged), substitute truncate -s 100m filenames for mkfile 100m filenames. – a CVn Jul 22 '16 at 12:56
  • 1
    Either truncate or dd commands can be used. Be aware that both commands have subtle differences that may or may not be important to you. See this answer for more info. – code_dredd May 10 '18 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.