[SOLVED] Resizing a mirrored boot pool?

stewlg

Member
Jul 8, 2020
6
1
8
54
When installing Proxmox VE 6.2 I deliberately omitted half the drive space of a pair of mirrored 1 TB SSDs, so that I now have only ~500 GB.


Code:
root@hydrox:~# lshw -class disk -short
H/W path                 Device     Class          Description
==============================================================
/0/100/1/0/0.0.0         /dev/sda   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.1.0         /dev/sdb   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.2.0         /dev/sdc   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.3.0         /dev/sdd   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.4.0         /dev/sde   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.5.0         /dev/sdf   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.6.0         /dev/sdg   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.7.0         /dev/sdh   disk           12TB WDC WD120EMFZ-11
/0/100/1/0/0.8.0         /dev/sdi   disk           1TB SanDisk SDSSDH3  << Boot 1
/0/100/1/0/0.9.0         /dev/sdj   disk           1TB SanDisk SDSSDH3  << Boot 2
/0/100/1a/1/1/2/0.0.0    /dev/sdk   disk           62GB Extreme
/0/100/1a/1/1/2/0.0.0/0  /dev/sdk   disk           62GB
root@hydrox:~#

Code:
errors: No known data errors

  pool: rpool
state: ONLINE
  scan: resilvered 2.30M in 0 days 00:00:00 with 0 errors on Tue Jul  7 18:50:59 2020
config:

        NAME                                             STATE     READ WRITE CKSUM
        rpool                                            ONLINE       0     0     0
          mirror-0                                       ONLINE       0     0     0
            ata-SanDisk_SDSSDH3_1T00_200723A00769-part3  ONLINE       0     0     0
            ata-SanDisk_SDSSDH3_1T00_195008A007C5-part3  ONLINE       0     0     0

Now I would like to resize these to fill the complete 1 TB.

I have tried something along these lines:
Code:
# Set autoexpand on for relevant zpool
zpool set autoexpand=on rpool
# Take one drive off line
zpool offline rpool ata-SanDisk_SDSSDH3_1T00_195008A007C5-part3
# Bring back online, with -e for expand
zpool online -e rpool ata-SanDisk_SDSSDH3_1T00_200723A00769-part3

I did that for each drive in turn, but afterwards both were still the same size. I tried booting into Gparted, but it does not have the ability to resize ZFS volumes.

I have considered detaching one at a time, deleting the partitions, and then letting ZFS resilver each drive in turn, but I'm not sure it will work and I'm hoping for something simpler and less time consuming.

Any suggestions appreciated.
 
Last edited:
Can you show the output of lsblk?

Out of the top of my head, you should have 3 partitions on the boot drive, with the last one being used for the rpool. Extending that partition on both disks should do the trick.
 
Can you show the output of lsblk?

Code:
root@hydrox:~# lsblk
NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda        8:0    0  10.9T  0 disk
├─sda1     8:1    0  10.9T  0 part
└─sda9     8:9    0     8M  0 part
sdb        8:16   0  10.9T  0 disk
├─sdb1     8:17   0  10.9T  0 part
└─sdb9     8:25   0     8M  0 part
sdc        8:32   0  10.9T  0 disk
├─sdc1     8:33   0  10.9T  0 part
└─sdc9     8:41   0     8M  0 part
sdd        8:48   0  10.9T  0 disk
├─sdd1     8:49   0  10.9T  0 part
└─sdd9     8:57   0     8M  0 part
sde        8:64   0  10.9T  0 disk
├─sde1     8:65   0  10.9T  0 part
└─sde9     8:73   0     8M  0 part
sdf        8:80   0  10.9T  0 disk
├─sdf1     8:81   0  10.9T  0 part
└─sdf9     8:89   0     8M  0 part
sdg        8:96   0  10.9T  0 disk
├─sdg1     8:97   0  10.9T  0 part
└─sdg9     8:105  0     8M  0 part
sdh        8:112  0  10.9T  0 disk
├─sdh1     8:113  0  10.9T  0 part
└─sdh9     8:121  0     8M  0 part
sdi        8:128  0 931.5G  0 disk
├─sdi1     8:129  0  1007K  0 part
├─sdi2     8:130  0   512M  0 part
└─sdi3     8:131  0 499.5G  0 part
sdj        8:144  0 931.5G  0 disk
├─sdj1     8:145  0  1007K  0 part
├─sdj2     8:146  0   512M  0 part
└─sdj3     8:147  0 499.5G  0 part
sdk        8:160  1  58.4G  0 disk
zd0      230:0    0    50G  0 disk
├─zd0p1  230:1    0   549M  0 part
└─zd0p2  230:2    0  49.5G  0 part
zd16     230:16   0   200G  0 disk
├─zd16p1 230:17   0    16M  0 part
└─zd16p2 230:18   0   200G  0 part
zd32     230:32   0    70G  0 disk
├─zd32p1 230:33   0   549M  0 part
└─zd32p2 230:34   0  69.5G  0 part
zd48     230:48   0    50G  0 disk
├─zd48p1 230:49   0     1M  0 part
├─zd48p2 230:50   0     1G  0 part
└─zd48p3 230:51   0    49G  0 part
zd64     230:64   0   9.8T  0 disk
├─zd64p1 230:65   0    16M  0 part
└─zd64p2 230:66   0   9.8T  0 part
zd80     230:80   0     5G  0 disk
├─zd80p1 230:81   0    16M  0 part
└─zd80p2 230:82   0     5G  0 part
root@hydrox:~#

sdi and sdj are the relevant drives, sdi3 and sdj3 are the specific partitions I want to resize.
 
I figured out what I was missing - I needed to use parted to actually resize the partition. So, something like this in the end - I'm reconstructing because there were a lot of experiments.

Code:
# Set autoexpand on for relevant zpool
zpool set autoexpand=on rpool
# Take one drive off line
zpool offline rpool ata-SanDisk_SDSSDH3_1T00_195008A007C5-part3
# Resize relevant partition
root@hydrox:~# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdi                                              
Using /dev/sdi
(parted) print                                                        
Model: ATA SanDisk SDSSDH3 (scsi)
Disk /dev/sdi: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
1      17.4kB  1049kB  1031kB                     bios_grub
2      1049kB  538MB   537MB   fat32              boot, esp
3      538MB   537GB   536GB   zfs

(parted) resizepart 3 100%
(parted) print                                                          
Model: ATA SanDisk SDSSDH3 (scsi)
Disk /dev/sdi: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
1      17.4kB  1049kB  1031kB                     bios_grub
2      1049kB  538MB   537MB   fat32              boot, esp
3      538MB   1000GB  1000GB  zfs
(parted) quit                        

# Bring back online, with -e for expand
zpool online -e rpool ata-SanDisk_SDSSDH3_1T00_200723A00769-part3

I did that for each side of the mirror in turn. I just guessed about the correspondence of the label (ata-SanDisk_SDSSDH3_1T00_200723A00769-part3) to the partition (/dev/sdi) - I may have gotten it right or wrong, I'm not sure. I had only one tiny problem, and it was this transient, recoverable error:
Code:
root@hydrox:~# zpool status
  pool: droxstorage
state: ONLINE
  scan: none requested
config:

        NAME         STATE     READ WRITE CKSUM
        droxstorage  ONLINE       0     0     0
          raidz2-0   ONLINE       0     0     0
            sda      ONLINE       0     0     0
            sdb      ONLINE       0     0     0
            sdc      ONLINE       0     0     0
            sdd      ONLINE       0     0     0
            sde      ONLINE       0     0     0
            sdf      ONLINE       0     0     0
            sdg      ONLINE       0     0     0
            sdh      ONLINE       0     0     0

errors: No known data errors

  pool: rpool
state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-9P
  scan: resilvered 4.46M in 0 days 00:00:00 with 0 errors on Wed Jul  8 05:54:09 2020
config:

        NAME                                             STATE     READ WRITE CKSUM
        rpool                                            ONLINE       0     0     0
          mirror-0                                       ONLINE       0     0     0
            ata-SanDisk_SDSSDH3_1T00_200723A00769-part3  ONLINE       0     0 4.64K
            ata-SanDisk_SDSSDH3_1T00_195008A007C5-part3  ONLINE       0     0     0

errors: No known data errors

I didn't clear errors or do anything about it, but when I rebooted next it was groomed away, and Proxmox now saw the new space available to it.

Code:
root@hydrox:~# zpool status
  pool: droxstorage
state: ONLINE
  scan: none requested
config:

        NAME         STATE     READ WRITE CKSUM
        droxstorage  ONLINE       0     0     0
          raidz2-0   ONLINE       0     0     0
            sda      ONLINE       0     0     0
            sdb      ONLINE       0     0     0
            sdc      ONLINE       0     0     0
            sdd      ONLINE       0     0     0
            sde      ONLINE       0     0     0
            sdf      ONLINE       0     0     0
            sdg      ONLINE       0     0     0
            sdh      ONLINE       0     0     0

errors: No known data errors

  pool: rpool
state: ONLINE
  scan: resilvered 4.46M in 0 days 00:00:00 with 0 errors on Wed Jul  8 05:54:09 2020
config:

        NAME                                             STATE     READ WRITE CKSUM
        rpool                                            ONLINE       0     0     0
          mirror-0                                       ONLINE       0     0     0
            ata-SanDisk_SDSSDH3_1T00_200723A00769-part3  ONLINE       0     0     0
            ata-SanDisk_SDSSDH3_1T00_195008A007C5-part3  ONLINE       0     0     0

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

I wonder if this error was because I resized the wrong partitions, and resized the partition that was still online while it was in use. If so, ZFS continues to impress me, able to get recover from all kinds of abuse.
 
  • Like
Reactions: aaron
Good to hear :)
Would you please mark the thread as solved? Should be in the drop-down list next to the title if you edit the first post.
 

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!