[SOLVED] Add drive to zfs pool to create RAIDZ1

Por12

Member
Mar 6, 2023
59
3
8
Hi there,

Up until now I was running a PBS pointing to a lone 12 TB drive. Following directions on the forum I have now bought and installed a second 12 TB HDD with the intent of creating a mirror and have resiliency against drive failures.

Currently I have around 2 TB used on that drive.

What would be the recommended method to add the drive to the ZFS array? Copy the 2 TB to another server, destroy and re-create the array and the datasets? Or is there anything simpler?

The pool I want to mirror is the rust-aphrodite.

Thanks!

Code:
root@aphrodite:~# zpool status
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0B in 00:00:11 with 0 errors on Sun Sep  8 00:24:12 2024
config:


        NAME                                               STATE     READ WRITE CKSUM
        rpool                                              ONLINE       0     0     0
          nvme-eui.01000000000000008ce38e04043a99c0-part3  ONLINE       0     0     0


errors: No known data errors


  pool: rust-aphrodite
 state: ONLINE
  scan: scrub repaired 0B in 05:30:10 with 0 errors on Sun Sep  8 05:54:11 2024
config:


        NAME                                 STATE     READ WRITE CKSUM
        rust-aphrodite                       ONLINE       0     0     0
          ata-HGST_HUH721212ALN600_5PHKH26D  ONLINE       0     0     0


errors: No known data errors
 
zpool attach rust-aphrodite /dev/disk/by-id/ata-HGST_HUH721212ALN600_5PHKH26D /dev/disk/by-id/... # add here the right from the new 12TB hdd
zpool status
 
zpool attach rust-aphrodite /dev/disk/by-id/ata-HGST_HUH721212ALN600_5PHKH26D /dev/disk/by-id/... # add here the right from the new 12TB hdd
zpool status
not sure about this approach. This gonna just add 12To to his stripped pool, without convert to mirror.

@Por12 , you just have 2To of used data on this pool. The best way is to snapshot the dataset and save it (on a temporary stripped pool or in a file, destroy your zpool, and re-create it mirrored :) Just have to import snapshot after
 
  • Like
Reactions: SkyZoThreaD
zpool "add" rust-aphrodite /dev/disk... /dev/disk... should "create a stripped" pool, "attach" should "create a mirrored pool" out of a single disk ... in theory, perhaps the best test with a few truncate files before :)
 
  • Like
Reactions: Por12 and Pifouney
not sure about this approach. This gonna just add 12To to his stripped pool, without convert to mirror.

@Por12 , you just have 2To of used data on this pool. The best way is to snapshot the dataset and save it (on a temporary stripped pool or in a file, destroy your zpool, and re-create it mirrored :) Just have to import snapshot after
Any guide on how to save the snapshot as a file?

Thanks!

zpool "add" rust-aphrodite /dev/disk... /dev/disk... should "create a stripped" pool, "attach" should "create a mirrored pool" out of a single disk ... in theory, perhaps the best test with a few truncate files before :)
It’s definitely simple and easy if it does what intend!

Regards
 
zpool "add" rust-aphrodite /dev/disk... /dev/disk... should "create a stripped" pool, "attach" should "create a mirrored pool" out of a single disk ... in theory, perhaps the best test with a few truncate files before :)
TY for the tips !!!!! :O
 
It did work a treat! It's currently resilvering the second drive. For further reference, to know what is the ID of the new drive use command: ls /dev/disk/by-id/

The drive does not necessarily needs to have a GPT partition if you don't intent to boot from it.

Thanks again!

Code:
root@aphrodite:~# zpool attach rust-aphrodite /dev/disk/by-id/ata-HGST_HUH721212ALN600_5PHKH26D /dev/disk/by-id/ata-ST12000NM0127_ZJV4763V
root@aphrodite:~# zpool status
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0B in 00:00:11 with 0 errors on Sun Sep  8 00:24:12 2024
config:

        NAME                                               STATE     READ WRITE CKSUM
        rpool                                              ONLINE       0     0     0
          nvme-eui.01000000000000008ce38e04043a99c0-part3  ONLINE       0     0     0

errors: No known data errors

  pool: rust-aphrodite
 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 Sun Sep 22 12:35:14 2024
        912G / 1.50T scanned at 70.1G/s, 0B / 1.50T issued
        0B resilvered, 0.00% done, no estimated completion time
config:

        NAME                                   STATE     READ WRITE CKSUM
        rust-aphrodite                         ONLINE       0     0     0
          mirror-0                             ONLINE       0     0     0
            ata-HGST_HUH721212ALN600_5PHKH26D  ONLINE       0     0     0
            ata-ST12000NM0127_ZJV4763V         ONLINE       0     0     0

errors: No known data errors
root@aphrodite:~#

zpool "add" rust-aphrodite /dev/disk... /dev/disk... should "create a stripped" pool, "attach" should "create a mirrored pool" out of a single disk ... in theory, perhaps the best test with a few truncate files before :)