[SOLVED] Issue rebuilding ZFS RAID 1 array with new disk

Aug 19, 2019
31
2
13
Greetings to all,

I have recently encountered a disk (/dev/sdb) failure. I have now replaced the disk, and while the following wiki article https://pve.proxmox.com/wiki/ZFS:_Tips_and_Tricks#Replacing_a_failed_disk_in_the_root_pool, we ran into an issue:

My new disk is slightly smaller than the old one, so when running the following, I have an issue.
Code:
sgdisk --replicate=/dev/sdb /dev/sda
Caution! Secondary header was placed beyond the disk's limits! Moving the
header, but other problems may occur!

Warning! Secondary partition table overlaps the last partition by
4688 blocks!
You will need to delete this partition or resize it in another utility.

Problem: partition 3 is too big for the disk.
Aborting write operation!
Aborting write of new partition table.

Code:
zpool status -v
  pool: rpool
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-4J
  scan: scrub repaired 0B in 0 days 05:02:09 with 0 errors on Sun Aug 11 05:26:11 2019
config:

        NAME                     STATE     READ WRITE CKSUM
        rpool                    DEGRADED     0     0     0
          mirror-0               DEGRADED     0     0     0
            sda3                 ONLINE       0     0     0
            6945573611984207316  UNAVAIL      0     0     0  was /dev/sdb3

errors: No known data errors
Code:
lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0  1007K  0 part
├─sda2   8:2    0   512M  0 part
└─sda3   8:3    0   931G  0 part
Code:
lsblk /dev/sdb
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb    8:16   0 931.5G  0 disk
I think we need to shrink the size of sda3 slightly so that we can correctly copy the partition table so that we can safely rebuild the ZFS pool. What would be the safest way of doing this without causing any data loss?

Kindest regards
 
The partition holding the zfs-pool (sda3 and sdb3 ) need to be the same size (or rather sdb3 needs to be at least as big as sda3).
You can probably shrink the EFI-partition of sdb (i.e. create a smaller sdb2)

I hope this helps!
 
Hello,

Thank you very much for getting back to me with such haste.

Do you know whether I can use the same command but specify the size for sdb2 to be 128MB?
Code:
sgdisk --replicate=/dev/sdb /dev/sda

Kindest regards
 

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!