Important Note: Delete any existing snapshots before resizing the hard disk, as disk size cannot be changed with active snapshots. Take new snapshots only after extending the disk.
df -h;lsscsi;lsblk
echo 1 > /sys/class/block/sda/device/rescan
echo 1 > /sys/class/block/sdb/device/rescan
echo 1 > /sys/class/block/sdc/device/rescan
fdisk -l
Click the appropriate hyperlink below based on whether you are extending Root, SDB, or SDC.
To Extend Data Partition - SDB:
To Extend Data Partition - SDC:
Extend the root partition by following steps below:
1. Invoke partitioning tool (menu-driven interface) by running the below command.
# cfdisk /dev/sda
Note: This step is applicable only for the root partition:
2. Using arrow keys select /dev/sda4
3. Using tab key Or shift tab select [ Resize ] then enter
4. Enter the free size available
5. Using tab key select [ Write ]
6. type "yes"
7. Press tab to [ Quit ]
8. Next, you must resize the file system with "resize2fs" to use the new space:
[before resize2fs]
# df -h | grep "sda4"
/dev/sda4 8.8G 3.9G 4.5G 47% /
[run resize2fs]
# resize2fs /dev/sda4
[after resize2fs]
# df -h | grep "sda4"
/dev/sda4 12G 3.9G 7.3G 35% /
9. Run 'df -h'
command to verify the allocated space.
To resize the two data partitions which are LVMs and the steps are different here versus root partition:
Extend the sdb data partition:
1. Use "pvresize" to let LVM know that the physical disk size has changed:
[before pvresize]
# pvdisplay /dev/sdb
--- Physical volume ---
PV Name /dev/sdb
VG Name db_vg
PV Size 10.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2559
Free PE 0
Allocated PE 2559
PV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
[run pvresize]
# pvresize /dev/sdb
[after pvresize]
# pvdisplay /dev/sdb
--- Physical volume ---
PV Name /dev/sdb
VG Name db_vg
PV Size <20.00 GiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 5119
Free PE 2560
Allocated PE 2559
PV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
[before lvextend]
# lvdisplay /dev/db_vg/db
--- Logical volume ---
LV Path /dev/db_vg/db
LV Name db
VG Name db_vg
LV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
LV Write Access read/write
LV Creation host, time sc-xxx-xxx-xxx, 2019-09-12 15:55:23 +0000
LV Status available
# open 1
LV Size <10.00 GiB
Current LE 2559
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
[run lvextend]
# lvextend -l +100%FREE /dev/db_vg/db
[after lvextend]
# lvdisplay /dev/db_vg/db
--- Logical volume ---
LV Path /dev/db_vg/db
LV Name db
VG Name db_vg
LV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
LV Write Access read/write
LV Creation host, time sc-xxx-xxx-xxx, 2019-09-12 15:55:23 +0000
LV Status available
# open 1
LV Size <20.00 GiB
Current LE 5119
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
[before resize2fs]
# df -h | grep "mapper"
/dev/mapper/db_vg-db 9.8G 1014M 8.3G 11% /db
[run resize2fs]
# resize2fs /dev/db_vg/db
[after resize2fs]
# df -h | grep "mapper"
/dev/mapper/db_vg-db 20G 1019M 18G 6% /db
4. Run 'df -h'
command to verify the allocated space.
[before pvresize]
# pvdisplay /dev/sdc
--- Physical volume ---
PV Name /dev/sdc
VG Name tomcat_vg
PV Size 10.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2559
Free PE 0
Allocated PE 2559
PV UUID xxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
[run pvresize]
# pvresize /dev/sdc
[after pvresize]
# pvdisplay /dev/sdc
--- Physical volume ---
PV Name /dev/sdc
VG Name tomcat_vg
PV Size <20.00 GiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 5119
Free PE 2560
Allocated PE 2559
PV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
[before lvextend]
# lvdisplay /dev/tomcat_vg/horizon
--- Logical volume ---
LV Path /dev/tomcat_vg/horizon
LV Name horizon
VG Name tomcat_vg
LV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
LV Write Access read/write
LV Creation host, time sc-xxx-xxx-xxx, 2019-09-12 15:55:24 +0000
LV Status available
# open 1
LV Size <10.00 GiB
Current LE 2559
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
[run lvextend]
# lvextend -l +100%FREE /dev/tomcat_vg/horizon
[after lvextend]
# lvdisplay /dev/tomcat_vg/horizon
--- Logical volume ---
LV Path /dev/tomcat_vg/horizon
LV Name horizon
VG Name tomcat_vg
LV UUID xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx
LV Write Access read/write
LV Creation host, time sc-xxx-xxx-xxx, 2019-09-12 15:55:24 +0000
LV Status available
# open 1
LV Size <20.00 GiB
Current LE 5119
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
[before resize2fs]
# df -h | grep "mapper"
/dev/mapper/tomcat_vg-horizon 9.8G 7.1G 2.2G 78% /opt/vmware/horizon
[run resize2fs]
# resize2fs /dev/tomcat_vg/horizon
[after resize2fs]
# df -h | grep "mapper"
/dev/mapper/tomcat_vg-horizon 20G 7.2G 12G 39% /opt/vmware/horizon
4. Run 'df -h'
command to verify the allocated space.