The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

vgcreate - Create a Volume Group (VG)




The vgcreate command is a part of the Logical Volume Manager (LVM) toolset and is used to create a Volume Group (VG) by combining one or more Physical Volumes (PVs). This command should be executed as the superuser (root) because it involves configuring storage at the system level.

The basic syntax for the vgcreate command is as follows:
vgcreate [OPTIONS] VG_NAME PV_NAME1 [PV_NAME2 ...] .

Here:

Some commonly used options for the vgcreate command include:

For example, to create a volume group named "db_vg" by combining two physical volumes, "/dev/sda3" and "/dev/sda4," you can use the following command:
# vgcreate -v db_vg /dev/sda{3,4}

This command creates a volume group named "db_vg" and includes the specified physical volumes in it.

Creating volume groups is an essential part of LVM management, allowing you to organize and manage your logical volumes effectively.

For more detailed explanations and additional examples of the vgcreate command in LVM, you can refer to the provided link.