Expand the centos disk to the size you want

I built Zen Tao in the virtual centos system I created. Recently, it has been used for a long time and the content is always full. So I studied the expansion. The following steps are verified step by step, and you can directly install the screenshots to do it. Regarding the parameters when creating a new partition, you can directly use the default ones, and the author also follows the default ones.

  • Found that the centos disk memory is not enough
    insert image description here
  • Use fdisk /dev/sda, to create a new partition; then just keep pressing. (The following parameters can also be used by default)
    insert image description here
    insert image description here
  • To restart the Linux operating system, use rebootthe command
    insert image description here
  • Create a physical volume using pvcreate /dev/sda3the command
    insert image description here
  • View physical volume information using pvdisplaythe command
    insert image description here
  • Add the newly added partition /dev/sda3 to the root directory partition centos: use vgextend centos /dev/sda3the command
    insert image description here
  • To view volume group information, use vgdisplaythe command
    insert image description here
  • Increase centos size, add 100G. use lvresize -L +100G /dev/mapper/centos-rootcommand
    insert image description here
  • To re-identify the size of centos, use xfs_growfs /dev/mapper/centos-rootthe command
    insert image description here
  • Check the size after expansion, and use df -hthe command (the expansion is successful at this time. You can compare it with the first step)
    insert image description here

Guess you like

Origin blog.csdn.net/qq_31424825/article/details/127488566