Disk partition
In Linux, just like in Windows, the disk needs to be partitioned in order to use the full disk space. If the total capacity of all partitions is less than the disk capacity, the disk has unallocated space, and the disk is wasted. A new partition needs to be added to make full use of the space.
fdisk
This command is a disk management command. Run the fdisk -l command to view the total disk capacity and partition information. Run the fdisk /dev/sda command to view information about sDA disks. The first digit indicates the disk type. For example, SCSI is represented by S, and virtual disks are represented by V. The third bit indicates the number of hard drives, starting from A to Z. You can run the fdisk -m command to view related commands, such as adding partition m and deleting partition d
The file system
After you append unallocated space to the new partition /dev/sda2, you need to create physical volumes and extend them. Pvcreate /dev/sda2 vgscan vgextend cl /dev/sda3 lvextend -l +100G Plus the name of the partition to be extended
Using dh -f, we found that the actual capacity did not change, because our system does not know the file system of the disk we just added, so we need to expand the file system. Xfs_growfs plus the name of the partition to be expanded or resize2fs -f plus the name of the partition to be expanded
Again, the file system space is larger.
This article is originally published by Websoft9. Creation is not easy, welcome to discuss, thanks for your support!