1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Linux / Unix Command: vgcreate
Command Library


vgcreate - create a volume group  


vgcreate [-A|--autobackup {y|n}] [-d|--debug] [-h|--help] [-l|--maxlogicalvolumes MaxLogicalVolumes] [-p|--maxphysicalvolumes MaxPhysicalVolumes] [-s|--physicalextentsize PhysicalExtentSize[kKmMgGtT]] [-v|--verbose] [--version] VolumeGroupName PhysicalVolumePath [PhysicalVolumePath...]  


vgcreate creates a new volume group called VolumeGroupName using the block special device PhysicalVolumePath previously configured for LVM with pvcreate(8).  


-A, --autobackup {y|n}
Controls automatic backup of VG metadata after the change (see vgcfgbackup(8)). Default is yes.
-d, --debug
Enables additional debugging output (if compiled with DEBUG).
-h, --help
Print a usage message on standard output and exit successfully.
-l, --maxlogicalvolumes MaxLogicalVolumes
Sets the maximum possible logical volume count. More logical volumes can't be created in this volume group. Absolute maximum is 256.
-p, --maxphysicalvolumes MaxPhysicalVolumes
Sets the maximum possible physical volume count. More physical volumes can't be included in this volume group. Absolute maximum is 256.
-s, --physicalextentsize PhysicalExtentSize[kKmMgGtT]
Sets the physical extent size on physical volumes of this volume group. A size suffix (k for kilobytes up to t for terabytes) is optional, megabytes is the default if no suffix is present. Values can be from 8 KB to 16 GB in powers of 2. The default of 4 MB causes maximum LV sizes of ~256GB because as many as ~64k extents are supported per LV. In case larger maximum LV sizes are needed (later), you need to set the PE size to a larger value as well. Later changes of the PE size in an existing VG are not supported.
-v, --verbose
Display verbose runtime information about vgcreate's activities.
Display tool and IOP version and exit successfully.


To create a volume group named test_vg using physical volumes /dev/hdk1, /dev/hdl1, and /dev/hdm1 with default physical extent size of 4MB:

	vgcreate test_vg /dev/sd[k-m]1

NOTE: If you are using devfs it is essential to use the full devfs name of the device rather than the symlinked name in /dev. so: the above could be

	vgcreate test_vg /dev/scsi/host1/bus0/target[1-3]/lun0/part1

To limit kernel memory usage, there is a limit of 65536 physical extents (PE) per logical volume, so the PE size determines the maximum logical volume size. The default PE size of 4MB limits a single logical volume to 256GB (see the -s option to raise that limit). There is also (as of Linux 2.4) a kernel limitation of 2TB per block device.  


lvm(8), pvdisplay(8), pvcreate(8), vgdisplay(8), vgextend(8), vgreduce(8), lvcreate(8), lvdisplay(8), lvextend(8), lvreduce(8)  

Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

  1. About.com
  2. Tech
  3. Linux

©2016 About.com. All rights reserved.