Solved ZFS zpool mirror labeling

semi-ambivalent

Active Member

Reaction score: 4
Messages: 128

I have been building a new box and have run across a labeling change from what I'm used to seeing in a typical ZFS on root mirror install. This is what I've come to expect:
Code:
    NAME            STATE     READ WRITE CKSUM
    zroot           ONLINE       0     0     0
       mirror-0      ONLINE    0     0     0
           ada0p3    ONLINE    0     0     0
           ada1p3    ONLINE    0     0     0
    spares
        ada2p3       AVAIL
What I have now looks like this:
Code:
    NAME        STATE     READ WRITE CKSUM
    zroot       ONLINE       0     0     0
      ada0p3    ONLINE       0     0     0
      ada1p3    ONLINE       0     0     0
    spares
      ada2p3    AVAIL
The point is that I'm missing the "mirror-0" line. I had been messing around with zpool commands to better know how to manage disks. df still shows the space of a single disk so this is a mirror, right? ada0p3, and ada1p3 mirrored for zroot, with ada2p3 as a hot spare available to zroot only, right?

My plan is to add three more disks in a similar setup (ada3, ada4, spare ada5) for a separate pool. I believe this can this be done with a mount point "under" zroot if desired (zpool create zroot/tub ada3 ada4 spare ada5). zroot is 1TB drives and the other three for 'tub' are 2TB. I'm trying to avoid the system not grabbing a spare because the one it wants is too small for the pool needing it. Perhaps I'm just placing too much importance on the indentation in the typical install's 'zpool status' output. Plus the current motherboard has only 3 SATA ports so I'm juggling disks a lot and using zpool commands to set things up until the new MB arrives.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,415
Messages: 30,001

The point is that I'm missing the "mirror-0" line.
Then it's not a mirror, it's a striped set.

I believe this can this be done with a mount point "under" zroot if desired (zpool create zroot/tub ada3 ada4 spare ada5).
No, that's not correct, zroot/tub is a dataset, not a pool. To create a secondary, new, pool you need to use a new pool name, you cannot create it "under" zroot. So zpool create mynewpool ada3 ada4 spare ada5. But note that this creates a striped set, not a mirror. To create a mirror you need to use zpool create mynewpool mirror ada3 ada4 spare ada5.
 
OP
OP
S

semi-ambivalent

Active Member

Reaction score: 4
Messages: 128

Then it's not a mirror, it's a striped set.


No, that's not correct, zroot/tub is a dataset, not a pool. To create a secondary, new, pool you need to use a new pool name, you cannot create it "under" zroot. So zpool create mynewpool ada3 ada4 spare ada5. But note that this creates a striped set, not a mirror. To create a mirror you need to use zpool create mynewpool mirror ada3 ada4 spare ada5.
OK, I get the "under" business. I was thinking of everything being under / in UNIX. I still need to learn just how logical ZFS is. I still don't get those two disks being a striped set since the size didn't double; that's what made me think it might have still been a real mirror. So I just re-installed and paid better attention to my keystrokes, and learned a bit about gpart labeling.
thx!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,415
Messages: 30,001

With ZFS is probably helps to see a pool as a single tree. A tree only has one stem (well, most trees); that's the pool, the branches are the various datasets and the leaves are your files. To create a new pool you'll have to plant a new tree.
 
Top