Showing posts with label lvm. Show all posts
Showing posts with label lvm. Show all posts

Friday, May 12, 2023

Ubuntu : Extending LVM Volume

1. Check for free space by running. #cfdisk

  • see if there is free space listed, can proceed to step 2
  • if don’t see free space listed, initiate a rescan of /dev/sda
  • #echo 1>/sys/class/block/sda/device/rescan
  • once done, re-run #cfdisk 

2. Select which partition to extending. Example - /dev/sda3 partition from the list and then select “Resize

3. ENTER and it will prompt to confirm the new size. Now /dev/sda3 partition with a new larger size.

4. LVM partition backing the  /dev/sda3 Physical Volume (PV) has been extended. Then need to extend PV

  • #pvresize /dev/sda3 -> 
  • #pvdisplay - to check the new size
  • #vgdisplay - check the Volume Group (VG) free space
  • #lvdisplay - check the size of our upstream Logical Volume (LV)
  • #lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
  • #df -h - check current size of the file system
  • #resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv 
  • (centos) #xfs_growfs /dev/mapper/xxxx/xxxx

 

 Source : https://packetpushers.net/ubuntu-extend-your-default-lvm-space/ 

Thursday, October 15, 2020

Ubuntu : Increase partition

 The step:

1. Mount the live iso GParted partition editor.

2. Boot the server and access the GParted.

3. GParted display the drive status and information.

4. Delete current linux-swap partition.

5. Delete extended.

 6. The unpartition drive should unallocated status.

7. Recreate linux-swap partition.

8. Click Resize/Move under the active partition.

9. Drag the Resize bar and drag to maximum size. Then click Resize/Move button.

10.After resize the partition should increase as below.

11. The resize process on going and waiting to completed.

12. If no any errors, can quit the GParted and shutdown.

13. Remove the GParted live-image and boot the server.

14. Login to server then run the #df -h

The partition now is increase.

Thursday, April 16, 2020

Centos 7 : Extending LVM Volume



1. Check the un-partition disk under Disk GUI on Centos 7 GUI



2. Create and format disk 
#fdisk -l
#fdisk -l /dev/sda3
- to format the partition :
- n = create new partition
- p = creates primary partition
- 1 = makes partition the first on the disk
- to prepare the partition to be used by LVM :
- t = change partition type
- 8e = changes to LVM partition type
- verify and write the information to the hard drive:
- p = view partition setup so we can review before writing changes to disk
- w=write changes to disk

3. Check the LVM volume on server
#pvs - show physical volume status
#lvs - show logical volume status
#vgs - show volume group status

4. Used fdisk to create new free partition
#fdisk /dev/sda ,then enter p for print the details partition status

5. Work with  new partition create and extend LV volume
#pvcreate /dev/sda3
#vgextend "<volume group name>" /dev/sda3

6. Extend the Logical Volume
#lvextend -L +200G /dev/mapper/centos-home

* if insufficient free space status, please used this
#lvextend -l +100%FREE /dev/mapper/centos-home

7. Use xfs_growfs utility
#xfs_growfs /dev/mapper/centos-home

#resize2fs /dev/mapper/centos-home - in Centos 6

8. Recheck the disk status
#df -h

source : 
 

Wednesday, March 11, 2020

Centos 7 : Guide to increace /dev/mapper/root on Centos 7

Guide to increace /dev/mapper/root on Centos 7


1. backup all data in /home
- #tar -czvf /root/home.tgz -C /home .
- test backup : #tar -tvf /root/home.tgz
2. unmount home
- #df-h
- #umount /dev/mapper/centos-home
3. remove the home logical volume
- #lvremove /dev/mapper/centos-home
4.recreate a new (400GB) logical volume for /home, format and mount it
- #lvcreate -L 400GB -n home centos
- #mkfs.xfs /dev/centos/home
- #mount /dev/mapper/centos-home
5.extend /root volume with ALL of the remaining space and resize (-r) the file system while doing so
- #lvextend -r -l +100%FREE /dev/mapper/centos-root
- #df -h
6.restore your backup
- #tar -xzvf /root/home.tgz -C /home

Thursday, July 6, 2017

Centos : Manage LVMs With a GUI

1. Install LVM Gui
#yum install system-config-lvm 


2. Lunch LVM Gui
#system-config-lvm

3. Go to Disk Utility
Add new partition 
 
- Create and Mount new partition
- After that un-mount back the new partition

4. Go to LVM Gui back - "initialize entity" the new volume and 'Yes'


5.After "initialize entity" , Add to existing Volume Group and 'Add'



6. Use remaining free space for this Volume. Then 'Ok'

7. Can view the new total disk for lv_home