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
- Use
fdisk /dev/sda
, to create a new partition; then just keep pressing. (The following parameters can also be used by default)
- To restart the Linux operating system, use
reboot
the command
- Create a physical volume using
pvcreate /dev/sda3
the command
- View physical volume information using
pvdisplay
the command
- Add the newly added partition /dev/sda3 to the root directory partition centos: use
vgextend centos /dev/sda3
the command
- To view volume group information, use
vgdisplay
the command
- Increase centos size, add 100G. use
lvresize -L +100G /dev/mapper/centos-root
command
- To re-identify the size of centos, use
xfs_growfs /dev/mapper/centos-root
the command
- Check the size after expansion, and use
df -h
the command (the expansion is successful at this time. You can compare it with the first step)