Growing Linux Disk Volumes - growpart

Growing Linux Disk Volumes - growpart

This procedure demonstrates online growing volume using growpart. The following environment is used as an example.

  • Test OS: RHEL 8.9

  • BSR version: 1.7.6.0

 

  1. Check node configuration before growing

  • Primary/Secondary Connected

  • volume size : 5241372(5GB)

  • [root@bsr0 bsr]# bsrsetup status --v --s r0 r0 node-id:1 role:Primary suspended:no write-ordering:drain req-pending:0 volume:0 minor:0 disk:UpToDate size:5241372 read:14984 written:0 al-writes:0 bm-writes:0 upper-pending:0 lower-pending:0 al-suspended:no al-pending-changes:0 al-used:0 accelbuf-used:0 blocked:no bsr1 node-id:0 connection:Connected role:Secondary congested:no volume:0 replication:Established peer-disk:UpToDate resync-suspended:no received:0 sent:14984 out-of-sync:0 pending:0 unacked:0

 

  1. Check disk capacity

  • Disk (nvme0n2) is 6 GB, partition (nvme0n2p1) is 5 GB

    • [root@bsr0 bsr]# lsblk # nvme0n2 6G disk # └─nvme0n2p1 5G part
  • Mounted as bsr0 5GB

    • [root@bsr0 bsr]# df -h # /dev/bsr0 5.0G 73M 5.0G 2% /root/mount

       

  1. Install growpart (if necessary, both nodes)

  • [root@bsr0 bsr]# yum install -y cloud-utils-growpart

     

  1. Extend partition (both nodes)

  • [root@bsr0 bsr]# growpart /dev/nvme0n2 1 # CHANGED: partition=1 start=2048 old: size=10483712 end=10485759 \ # new: size=12580831 end=12582878
  • Check if the partition size is set to 6GB

    • [root@bsr0 bsr]# lsblk # nvme0n2 6G disk # └─nvme0n2p1 6G part

       

  1. Resizing a BSR device (performed on the primary node)

  • Apply BSR meta/bitmap/device size to cluster

    • [root@bsr0 bsr]# sradm resize r0
  • Check the increased volume size and synchronization status

    • After executing the resize command, partial synchronization is performed on the expanded area.

      • sent(Primary)/read(Secondary) : 1063508

    • Confirm that the size value has increased from 5241372 to 6289896

    • [root@bsr0 bsr]# bsrsetup status --s --v r0 r0 node-id:1 role:Primary suspended:no write-ordering:drain req-pending:0 volume:0 minor:0 disk:UpToDate size:6289896 read:803772 written:0 al-writes:80 bm-writes:0 upper-pending:0 lower-pending:0 al-suspended:no al-pending-changes:0 al-used:0 accelbuf-used:0 blocked:no bsr1 node-id:0 connection:Connected role:Secondary congested:yes volume:0 replication:SyncSource peer-disk:Inconsistent done:95.70 resync-suspended:no received:0 sent:797496 out-of-sync:269980 pending:8 unacked:7 speed:88754 want:0 eta:0:00:03 [root@bsr0 bsr]# bsrsetup status --s --v r0 r0 node-id:1 role:Primary suspended:no write-ordering:drain req-pending:0 volume:0 minor:0 disk:UpToDate size:6289896 read:1063508 written:0 al-writes:80 bm-writes:0 upper-pending:0 lower-pending:0 al-suspended:no al-pending-changes:0 al-used:0 accelbuf-used:0 blocked:no bsr1 node-id:0 connection:Connected role:Secondary congested:no volume:0 replication:Established peer-disk:UpToDate resync-suspended:no received:0 sent:1063508 out-of-sync:0 pending:0 unacked:0

       

  1. Expanding the file system (performed on the primary node)

  • [root@bsr0 bsr]# df -h Filesystem Size Used Avail Use% Mounted on ... /dev/bsr0 5.0G 73M 5.0G 2% /root/mount [root@bsr0 bsr]# xfs_growfs/dev/bsr0 -> xfs [root@bsr0 bsr]# resize2fs /dev/bsr0 -> ext 계열 [root@bsr0 bsr]# df -h Filesystem Size Used Avail Use% Mounted on ... /dev/bsr0 6.0G 80M 6.0G 2% /root/mount