vgcreate
Create a new volume group
TLDR
Create a new volume group called vg1 using the /dev/sda1 device
Create a new volume group called vg1 using multiple devices
SYNOPSIS
vgcreate [options] VolumeGroupName PhysicalDevicePath...
PARAMETERS
-s ExtentSize
Sets the physical extent size. Defaults to 4MB. You can use suffixes like 'm' (MB), 'g' (GB), 't' (TB). This is very important to the overall LVM performance. Small extents lead to more metadata, and larger extents may waste more space, it is a complex balance.
-n
Do not execute the command. Displays the commands that would be executed. Useful for testing configurations.
-v
Verbose output. Provides more detailed information about the process.
-y
Answer yes to all prompts.
VolumeGroupName
The name of the new volume group to create. This name must be unique.
PhysicalDevicePath...
The path(s) to one or more physical volumes to be included in the new volume group. These PVs must already be initialized using 'pvcreate'.
DESCRIPTION
The vgcreate command creates a new Volume Group (VG) in Linux Logical Volume Management (LVM).
It combines one or more physical volumes (PVs) into a single storage pool.
This VG can then be subdivided into Logical Volumes (LVs), which can be formatted and mounted like regular partitions.
The VG name must be unique across the system. vgcreate allows you to specify the extent size used to create the Volume Group, to organize the use of the storage, to reduce waste and improve performance in some scenarios.
This allows you to create flexible storage management. This command is a core component of LVM and enables dynamic resizing and management of storage volumes, offering a powerful alternative to traditional partitioning.
EXAMPLE
To create a Volume Group named 'myvg' using physical volumes /dev/sda1 and /dev/sdb1, you would execute:
vgcreate myvg /dev/sda1 /dev/sdb1.
To create a Volume Group named 'data' with a physical extent size of 16MB using physical volume /dev/sdc1:
vgcreate -s 16m data /dev/sdc1