How do I add a VDEV to an existing pool with a different number of drives?

eiton

Cadet
Joined
Dec 11, 2017
Messages
9
I have a pool with three drives set as raidz1. I want to add two more drives as a mirrored pair to the pool.

It appears that I can't do this through the web UI. There's a warning saying it needs three disks to make a raid-z vdev and no option to change what I'm adding to mirror.

I know there's supposed to be a performance penalty for mixing vdev types but for my use case, performance is not a concern.

What's the correct way to go about doing this?
 

Attachments

  • Screenshot 2023-01-18 165031.png
    Screenshot 2023-01-18 165031.png
    52.9 KB · Views: 222

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The most important thing is to get a correct partition table on your new drives and strictly use the GPTIDs in the vdev setup, not the device names.

Please post the output of gpart show inside code tags and I can give you some command line statements that should achieve what you intend to set up.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
What version are you running... that was an issue that was fixed a while back... you should be seeing a Force button to ignore the warning and proceed in the GUI.
 
Last edited:

eiton

Cadet
Joined
Dec 11, 2017
Messages
9
I'm on TrueNAS-13.0-U3.1.

I wound up opening a shell and using the command: zpool add tank mirror <drive1> <drive2>

The change seems to persist between restarts so I appear to be good now. I was afraid it might not due to the appliance nature of TrueNAS.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What did you use for <drive1> and <drive2>?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Despite the fact that I explicitly told you not to use device names but create a proper partition table and use GPTIDs ...

But you do you I guess, good luck. This cannot be fixed after the fact I fear.

What you probably lost is a proper display of your disks and disk management/replacement in the UI. The UI does not work with device names in a pool.
 
Last edited:

RoyalRik

Cadet
Joined
Jan 22, 2023
Messages
2
Patrick, I just added a disk to be used as a hotspare.
I noticed all the ada# names moved up by one. The NEW disk is now ada0, and the previous ada0 is now ada1.
I can see how using the ada# names can become problematic.

Where can I find said GPTID?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
glabel status

and/or

zpool status
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Never add disks with their device names to a storage pool on the command line.

To have a GPTID in the first place you need to create a partition table on the disk. For TrueNAS this should adhere to a certain standard. The simplest way is to copy the partition table of a disk that was set up in the UI onto the new disk:
Code:
gpart backup /dev/<existing disk> | gpart restore /dev/<new disk>


Then use gpart list /dev/<new disk> to display the partition table of the new disk. The field "rawuuid" of the partition of type "freebsd-zfs" is the one you need.

If the new disk is larger than the one you copied the partition table from you can use gpart resize -i <number of partition> /dev/<new disk> to adjust the partition size to the full capacity.

Or just use the UI wich will do the right thing without all the hassle.
 
Last edited:
Top