Replacing a RAIDZ disk

Walery

Member
Feb 11, 2021
67
1
13
42
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: 42
  • zfs1.jpg
    zfs1.jpg
    246.8 KB · Views: 43
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: 23
  • raidz2.jpg
    raidz2.jpg
    151.1 KB · Views: 22
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!