Replacing a RAIDZ disk

Walery

Active Member
Feb 11, 2021
69
1
28
43
I have installed PBS. Created Datastore (data1) ZFS (3 Hitachi disks 500 GB each).
Made a backup of the virtual machine in storage.
After that I simulated the situation if 1 disk from the pool breaks. I turned off PBS and replaced 1 Hitachi drive with a Seagate drive (500 GB).
After enabling PBS, I see an error:
Bad Request (400)
unable to open chunk store 'data1' at "/mnt/datastore/data1/.chunks" - No such file or directory (os error 2)

How do I properly replace a RAIDZ drive?

p.s.I have not formatted the drive I added (it was previously used in openmediavault.
 

Attachments

  • zfs2.jpg
    zfs2.jpg
    183.8 KB · Views: 43
  • zfs1.jpg
    zfs1.jpg
    246.8 KB · Views: 44
Last edited:
I turned off PBS again. Disconnected the Seagate drive and formatted it on another computer. Plugged in the Seagate drive and turned on PBS. Now I see the status DEGRADED.

How do I add the disk and restore the pool now?
 

Attachments

  • raidz1.jpg
    raidz1.jpg
    185.6 KB · Views: 24
  • raidz2.jpg
    raidz2.jpg
    151.1 KB · Views: 23
if you check the output of 'zpool status' you see the device that failed, use that as 'old device' and the new disk as 'new device'

e.g.
# zpool replace -f pool /dev/sdX /dev/sdY

if '/dev/sdX' is your old disk and '/dev/sdY' is your new disk
 
Thank. This will work if it is possible to connect a disk. But if all ports are busy then it may not work.
P.S. One more question. If I need to increase the size of my storage. Replace 3 500Gb drives with 3 1Tb drives. Do it the same way # zpool replace -f <pool> <old device> <new device>?
 
the most
Thank. This will work if it is possible to connect a disk. But if all ports are busy then it may not work.
P.S. One more question. If I need to increase the size of my storage. Replace 3 500Gb drives with 3 1Tb drives. Do it the same way # zpool replace -f <pool> <old device> <new device>?
the obvious way is to add another raidz vdev to the pool, i.e. adding three more disks in a new vdev
 
the most

the obvious way is to add another raidz vdev to the pool, i.e. adding three more disks in a new vdev
Need to create a new raidz vdev? But if I do not have the opportunity to connect additional drives (the board has a limited number of connectors for extending drives). How can I increase the storage size?
 
Need to create a new raidz vdev? But if I do not have the opportunity to connect additional drives (the board has a limited number of connectors for extending drives). How can I increase the storage size?
Ahh i see, well yes you can change one disk at a time to a larger disk. I assume you have a raidz1 on your three disks. It would be great if you can attatch the new disk while the three remains online, else you are taking a big risk when you replace the disks since a second disk could fail while the new disk is written. If you can add the new disk while the three are still online zfs will do the magic well. Anyway:
  • zpool replace smallerdrive biggerdrive
  • wait for zfs to do the work
  • repeat for the other disks
When all three are larger, you might need to either run autoexpand (zpool set autoexpand=on pool) or export/import the pool to see the new space.