Find in this Blog

Tuesday, May 4, 2021

LVM EXTEND LINUX

 

1. extend hdd from vmware

 

ON LINUX VM

-------------

2. run echo 1 > /sys/block/sda/device/rescan (this is to rescan devices)

3. fdisk /dev/sda

               type p to list partitions

               it will show the new disk size ( Disk /dev/sda: new*GB )

               type d to delete the current partition which you want to increase

               type n to create new partiton ( create wih same partiton number - very iportant, starting cylinder should be same ( VERY IMPORTANT) as before mostly default value, and last cylinder will be new value usualy deafult.)

               Type N to keep the same partion file system (eg: Linux file system) or Y to select a new file system.

               Type p again to list partitions and check the size change is reflected

               Make sure everything is correct and then type w, it will write changes to disk - No turning back from here,

               (type q to exit from fdisk if not already)

4. partprobe -s ( reprobe all the partitions)

5. pvresize /dev/sda4

6. Now go to vm console or rdp open partitioner

               select the logical volume you want to expand and give the new size and finish

               this can be done from CLI but easier if can access the console :)


Primary partition extend:

Extend the volume disc and run the below command 

 xfs_growfs -d /hana


> rescan-scsi-bus.sh -a