Linux serverNETWORK ADMINISTRATIONS

How to add disk space on Linux server Virtual Machine VM

How to add expand increase disk space on Linux Virtual Machine VM VMware

Steps to add disk space on Linux Virtual Machine.

1. Use fdisk -l command find disk size and Disk NAME:/dev/sda
2. Run df -Th command, identify the partition you want to increase, as well as file system type.
3. Add space on VM, reboot. or shutdown VM, add space.
4. run fdisk -l, verify disk size changed accordingly.
5. fdisk DISK NAME (come from step #1)
6. p, to print the partition table
7. n–new partition, — p, create a primary partition
8. 3, for the partition number. (if you already have 3 partitions, then here you type 4)
9. Hit enter 2 times to accept the default value. verity disk size matches you just added.
10.t, change partition ID.press 3 to select the newly created partition.
11.8e, to change to Linux LVM.
12.w, write changes to the partition table. reboot.
13.run fdisk -l, verify changes has been saved to partition table, as well as 8e type.
write down new partition name: /dev/sda3
14.convert new partition to physical volume
#pvcreate /dev/sda3
15.use below command to determine Volume Group Name to extend.
vgdisplay —- find Volume Group name: rhel
16.use below command to extend physical volume
vgextend rhel /dev/sda3
17.use below command to confirm physical disk space available
vgdisplay rhel
18.use below command to find out Logical Volume Path you want to extend.
lvdisplay —/dev/rhel/root
19.use below command to extend Logical Volume
lvextend -L+#G LV_PATH — lvextend -L+20G /dev/rhel/root
20.expand file type (find out by step #2)

a. for non-RedHat Linux VM.
resize2fs LV PATH —- resize2fs /dev/rhel/root
b. RedHat, CentOS 7 using xfs file type
xfs_growfs LV PATH —- xfs_growfs /dev/rhel/root
c. ext3 file type
ext2online LV PATH — ext2online /dev/rhel/root

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *