Lanyiyun: About lvm disk management-single disk partition PV expansion

When we use LVM (Logical Volume Manager) for disk management, if we need to expand the physical volume (PV) of a single disk partition, we can follow the following steps:

  1. Check the current disk partition situation : First, use  pvdisplaythe command or  pvscommand to view the physical volume information in the current system and confirm the name of the disk partition to be expanded (for example  /dev/sdb1).
  2. Expand disk partition : Use appropriate tools (such as  fdisk) to expand the partition size of the target disk. The specific steps may vary, but generally include opening the disk partitioning tool, selecting the target disk, modifying the partition size, saving changes, etc. Make sure the partition is resized to the desired size and save the changes.
  3. Rescan disk partitions : Run  partprobea command or restart the system to rescan disk partitions and identify changes in partition size.
  4. Extend physical volume : Run  pvresizethe command to extend the size of the physical volume. For example, extend  /dev/sdb1a physical volume with the following command:

    pvresize /dev/sdb1

    This will bring the physical volume size into line with the expanded disk partition size.

  5. Verify expansion : Run  pvdisplaythe command or  pvscommand to confirm that the size of the physical volume has been expanded to the target size.

After completing the above steps, the expansion of the physical volume is completed. Next, you can continue to expand the logical volume (LV) or other operations to adapt to the larger physical volume space.

It should be noted that disk partition expansion and physical volume expansion may involve restarting the system or rescanning disk partitions, so before operating, please make sure to back up important data and proceed with caution.

In summary, to expand the physical volume of a single disk partition in LVM, first extend the size of the disk partition, then rescan the disk partition and use the command to  pvresizeextend the size of the physical volume. After completing these steps, the physical volume will be successfully expanded.

Guess you like

Origin blog.csdn.net/tiansyun/article/details/132747079