Add disk to vdev (stripe to mirror)

johannes96

Cadet
Joined
Dec 1, 2021
Messages
2
Hi,

I'm trying to add another disk to my existing pool to convert the single stripe vdev to a mirror vdev.

My current simple pool layout looks like:

root@truenas:~# zpool status zhdd
pool: zhdd
state: ONLINE
config:

NAME STATE READ WRITE CKSUM
zhdd ONLINE 0 0 0
42238b1c-7028-4d9b-9b0d-852e9ff41811 ONLINE 0 0 0

errors: No known data errors

my disk ids:
ls -l /dev/disk/by-id
ata-ST6000VN0033-2EE110_XXXXXXXX -> ../../sdd
ata-WDC_WD60EZRZ-00RWYB1_WD-XXXXXXXXX -> ../../sdc

sdd is already part of the pool. sdc is the empty new drive. I tried to add the disk by "name" and by "id" neither did work.

zpool attach zhdd /dev/disk/by-id/ata-ST6000VN0033-2EE110_ZAD90GZJ /dev/disk/by-id/ata-WDC_WD60EZRZ-00RWYB1_WD-XXXXXXXXX
cannot attach /dev/disk/by-id/ata-WDC_WD60EZRZ-00RWYB1_WD-WX71D6589HR4 to /dev/disk/by-id/ata-ST6000VN0033-2EE110_XXXXXXXX : no such device in pool

root@truenas:~# zpool attach zhdd /dev/sdd /dev/sdc
cannot attach /dev/sdc to /dev/sdd: no such device in pool

I think I'm a little bit lost between disk names / ids and partition uuids. The output of "zpool status" looks like the vdev was create on partition level. Is this assumption corret?

Could anyone give me a hint how to fix this?

Best regards
Johannes
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to create the partition table first and then use /dev/disk/by-partuuid/<device>

Code:
root@scale[~]# zpool status           
[...]
pool: ssd
 state: ONLINE
config:

    NAME                                      STATE     READ WRITE CKSUM
    ssd                                       ONLINE       0     0     0
      mirror-0                                ONLINE       0     0     0
        7c72c6fe-a91a-41fd-b951-07f10e620cf9  ONLINE       0     0     0
        f7f488ad-27e6-4cf8-8bbf-c8c0da9b508d  ONLINE       0     0     0

errors: No known data errors
root@scale[~]# ll /dev/disk/by-partuuid
[...]
lrwxrwxrwx 1 root  15 Nov 30 11:54 7c72c6fe-a91a-41fd-b951-07f10e620cf9 -> ../../nvme1n1p2
lrwxrwxrwx 1 root  15 Nov 30 11:54 f7f488ad-27e6-4cf8-8bbf-c8c0da9b508d -> ../../nvme0n1p2
[...]


I forget what the name of the Linux partition tool is this week, again :wink: - recreate the exact same layout as is on your first disk.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
Just do it through the GUI and let the middleware partition and add gptid for you. With Core:
Storage > Pools > (gear) > Status > (…) > Extend
I assume it's the same for SCALE.
 

johannes96

Cadet
Joined
Dec 1, 2021
Messages
2
thanks for your fast responses!

I gave the gui option a try. Now I have a resilvering mirror vdev :cool:

1638393189801.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I guess that time estimate is wrong (a little over 7 years!)... Maybe it's already done?
 
Top