Steps to expand a stuck sized static volume (disks were swapped)

This is a repost from the old forum here

========================================

I have seen this topic several times, and finally somebody has documented the steps* that QNAP support executes

WARNING: Use these at your own risk!

Commands with explanation (as far as I can make them out)

list drb devices, storage volumes will be listed (note down the one with the missing size e.g. drbd1 and vg288)

[~] # pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/drbd1 vg288  lvm2 a--  7.27t    3.60t

Find the correct md device (here it’s md1)

[~] # md_checker

Welcome to MD superblock checker (v2.0) - have a nice day~

Scanning system...

RAID metadata found!
UUID:           2287586a:dd935b28:8f1d0240:2c5627bf
Level:          raid6
Devices:        6
Name:           md1
Chunk Size:     512K
md Version:     1.0
Creation Time:  Oct 9 15:48:10 2019
Status:         ONLINE (md1) [UUUUUU]
===============================================================================================
 Enclosure | Port | Block Dev Name | # | Status |   Last Update Time   | Events | Array State
===============================================================================================
 NAS_HOST       7        /dev/sdf3   0   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
 NAS_HOST       8        /dev/sdc3   1   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
 NAS_HOST       3        /dev/sde3   2   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
 NAS_HOST       6        /dev/sdh3   3   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
 NAS_HOST       5        /dev/sdg3   4   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
 NAS_HOST       4        /dev/sdd3   5   Active   Feb 23 09:44:21 2024  1634759   AAAAAA
===============================================================================================

grow the physical device (e.g. md1)

mdadm --grow /dev/md1 --size=max

resize the drbd device (drbd1)

drbdadm -- --assume-peer-has-space resize r1
pvresize /dev/drbd1

resize vg device (vg288)

lvresize vg288/lvl -l +100%"FREE" -f

If the size has not changed after a reboot, resize the filesystem as well (see /dev/mapper/ for the correct cachedev)

resize2fs_64 /dev/mapper/cachedev1

*Original Source

1 Like