VGCREATE(8)
π¦ VGCREATE(8) β System Manager's Manual π¦
okay bestie, welcome to the vgcreate page, manual section 8 (that's the system-manager one, iykyk) π
π NAME
vgcreate β create a volume group. that's it, that's the whole vibe. making a brand new VG out here β¨
πΈ SYNOPSIS
vgcreate position_args
[ option_args ]
like, give it your position args, and optionally some options, periodt π
π DESCRIPTION
okay so vgcreate creates a brand new VG on block devices π₯ and here's the cute part: if those devices weren't already initialized as PVs with pvcreate(8) first, then vgcreate will just... do it for them. it initializes them, makes them PVs, no extra steps needed π«Ά. and the pvcreate options for initializing devices are also available with vgcreate, so you're not missing out on anything.
now, the important tea β: when vgcreate uses an existing PV, that PV's existing values for metadata size, PE start, etc., get used β even if you specified different values in the vgcreate command. so like, your flags said one thing and the PV said another and the PV wins, sorry bestie π. to actually change those values, you have to first use pvremove on the device. no shortcuts, unfortunately.
β¨ USAGE β¨
vgcreate VG_new PV ...
[ -A|--autobackup y|n ]
[ -c|--clustered y|n ]
[ -f|--force ... ]
[ -l|--maxlogicalvolumes Number ]
[ -M|--metadatatype lvm2 ]
[ -p|--maxphysicalvolumes Number ]
[ -s|--physicalextentsize Size[m|UNIT] ]
[ -Z|--zero y|n ]
[ --addtag Tag ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
]
[ --dataalignment Size[k|UNIT] ]
[ --dataalignmentoffset Size[k|UNIT] ]
[ --labelsector Number ]
[ --locktype none ]
[ --metadataprofile String ]
[ --metadatasize Size[m|UNIT] ]
[ --persist start ]
[ --pvmetadatacopies 0|1|2 ]
[ --reportformat basic|json|json_std ]
[ --setautoactivation y|n ]
[ --setlockargs String ]
[ --setpersist String ]
[ --shared ]
[ --systemid String ]
[ --[vg]metadatacopies all|unmanaged|Number ]
[ COMMON_OPTIONS ]
β
and here's the common options for lvm, the little shared starter pack every lvm command gets π§:
Common options for lvm:
[ -d|--debug ... ]
[ -h|--help ]
[ -q|--quiet ... ]
[ -t|--test ]
[ -v|--verbose ... ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --devices PV ]
[ --devicesfile String ]
[ --driverloaded y|n ]
[ --journal String ]
[ --lockopt String ]
[ --longhelp ]
[ --nohints ]
[ --nolocking ]
[ --profile String ]
[ --version ]
π OPTIONS
--addtag Tagβ slaps a tag onto a PV, VG or LV π·οΈ. you can repeat this option to add a whole bunch of tags at once. tag lore lives inlvm(8), go read it.--alloc contiguous|cling|cling_by_tags|normal|anywhere|inheritβ this decides the allocation policy when a command needs to allocate Physical Extents (PEs) out of the VG. every VG and LV has an allocation policy, and you can change it withvgchange/lvchange, or just override it right here on the command line. so:normalapplies common sense rules, like not putting parallel stripes on the same PV (as it should π )inheritapplies the VG policy to an LVcontiguousrequires new PEs to be placed adjacent to existing PEsclingplaces new PEs on the same PV as existing PEs in the same stripe of the LV- if there are enough PEs for an allocation but
normalwon't use them,anywherewill use them anyway β even if it hurts performance, e.g. by putting two stripes on the same PV π - optional positional PV args on the command line can also limit which PVs the command will use for allocation. see
lvm(8)for more allocation lore.
-A|--autobackup y|nβ says whether metadata should be backed up automatically after a change. enabling this is strongly advised! seevgcfgbackup(8)for more. fr fr, turn it on π-c|--clustered y|nβ this one was specific to clvm and is now replaced by the--sharedoption withlvmlockd(8). so like, it's giving legacy, bestie π--commandprofile Stringβ the command profile to use for command configuration.lvm.conf(5)has the profile details.--config Stringβ config settings for the command. these overridelvm.conf(5)settings. the String arg uses the same format aslvm.conf(5), or it may use section/field syntax. more config tea inlvm.conf(5).--dataalignment Size[k|UNIT]β aligns the start of a PV data area to a multiple of this number β¨. wanna see where the first Physical Extent (PE) of an existing PV lives? usepvs -o +pe_start. it may also be shifted by an alignment offset, see--dataalignmentoffset. also, specify an appropriate PE size when creating a VG, don't forget that part π«Ά--dataalignmentoffset Size[k|UNIT]β shifts the start of the PV data area by this extra offset.-d|--debug ...β sets the debug level. repeat it 1 to 6 times to crank up the detail of messages sent to the log file and/or syslog (if configured).--devices PVβ restricts which devices are visible and accessible to the command. devices not listed will appear to be missing π». you can repeat this option, or hand it a comma-separated list of devices. this overrides the devices file.--devicesfile Stringβ a file listing the devices LVM should use. it has to exist in/etc/lvm/devices/and it's managed with thelvmdevices(8)command. this one overrides thelvm.conf(5)devices/devicesfileanddevices/use_devicesfilesettings.--driverloaded y|nβ set it to no and the command won't even try to use device-mapper. for testing and debugging only, bestie π§ͺ-f|--force ...β overrides various checks, confirmations and protections. use with extreme caution. like, this is the "i know what i'm doing" button and sometimes people do NOT know what they're doing π-h|--helpβ displays help text π--journal Stringβ records information in the systemd journal. this is in addition to whatever thelvm.conflog/journalsetting already turns on. the values:command:records info about the commandoutput:records the default command outputdebug:records full command debugging
--labelsector Numberβ by default the PV gets labelled with an LVM2 identifier in its second sector (sector 1). this option lets you use a different sector near the start of the disk (between 0 and 3 inclusive β seeLABEL_SCAN_SECTORSin the source). use with care.--lockopt Stringβ used to pass options for special cases to lvmlockd.lvmlockd(8)has more.--locktype noneβ specify the VG lock type directly, in place of using--shared. more inlvmlockd(8).--longhelpβ displays long help text.-l|--maxlogicalvolumes Numberβ sets the maximum number of LVs allowed in a VG.-p|--maxphysicalvolumes Numberβ sets the maximum number of PVs that can belong to the VG. value0removes any limitation. for large numbers of PVs, also check out the--pvmetadatacopiesand--vgmetadatacopiesoptions for improving performance π₯--metadataprofile Stringβ the metadata profile to use for command configuration.lvm.conf(5)has more about profiles.--metadatasize Size[m|UNIT]β the approximate amount of space used for each VG metadata area. and yes, the size may be rounded, that's just how it is π-M|--metadatatype lvm2β specifies the type of on-disk metadata to use.lvm2(or just2) is the current, standard format π.lvm1(or just1) is no longer used, rip bozo.--nohintsβ don't use the hints file to locate devices for PVs. without hints, a command may read more devices to find PVs. it will still perform standard hint file invalidation where appropriate though, so no chaos.--nolockingβ disables locking. use with caution, concurrent commands may produce incorrect results. π--persist Stringβ the Persistent Reservation operation. the rundown:start:register local key and acquire reservationstop:unregister local key, releasing reservationremove:preempt and abort another keyclear:remove reservation and keyscheck:check if startedautostart:start if the VG autostart flag is setlvmlocal.confpr_keyorhost_idmust be configured to use PR- for local VGs, Write Exclusive (WE) is used, and for shared VGs, Write Exclusive, all registrants (WEAR) is used
- use
--setpersistto automate and/or require PR β¨
-s|--physicalextentsize Size[m|UNIT]β sets the physical extent size of PVs in the VG. the value must be either a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least128 KiB. and heads up: once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving π¬ so choose wisely bestie.--profile Stringβ an alias for--commandprofileor--metadataprofile, depending on the command.--pvmetadatacopies 0|1|2β the number of metadata areas to set aside on a PV for storing VG metadata. the deets:- when
2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end - when
1, one copy of the VG metadata is stored at the front of the PV - when
0, no copies of the VG metadata are stored on the given PV - this may be useful in VGs containing many PVs β though it places limitations on the ability to use
vgsplitlater β οΈ
- when
-q|--quiet ...β suppress output and log messages. overrides--debugand--verbose. repeat it once to also suppress any prompts with answer 'no'.--reportformat basic|json|json_stdβ overrides the current output format for reports, which is defined globally by thereport/output_formatsetting inlvm.conf(5). so:basicis the original format with columns and rows. if there's more than one report per command, each report is prefixed with the report name so you can tell them apartjsonproduces report output in JSON formatjson_stdproduces report output in JSON format which is more compliant with the JSON standard π- see
lvmreport(7)for more
--setautoactivation y|nβ turns the autoactivation property on or off for a VG or an LV π«. Wanna peek at what it's currently set to? Runvgsorlvswith-o autoactivation. When autoactivation is disabled, that VG or LV will not get activated by any command that does autoactivation β so like,vgchange,lvchange, orpvscanusing-aayπ€. And the nesting? If autoactivation is disabled on a VG, then no LVs will be autoactivated in that whole VG, and the LV's own autoactivation property justβ¦ has no effect, bestie π« . If it's enabled on the VG, you can still turn autoactivation off for individual LVs. Hierarchy, gorgeous, we love to see it.--setlockargs Stringβ adds or removeslock_argssettings for a shared VG π. Theselock_argsdecide how the lock manager behaves for that VG. Heads up: these settings are only allowed forlock_type sanlock. Here's the menu of values:persist: uses persistent reservations for lock recovery.lvmlockdwill preempt-abort the persistent reservation of a failed lock owner so the lock can actually be acquired π .notimeout: uses locks that do not time out when the owner fails. In that case, a lock owned by a failed host can only be acquired using thepersistfeature.nopersist: does not use thepersistfeature.timeout: does not use thenotimeoutfeature.nowatchdog: does not connect towdmd/watchdog when starting the VG lockspace. Requiresnotimeout. Without timeout-based recovery, the watchdog isn't needed.watchdog: when starting a VG lockspace,sanlock/wdmdconnect the lockspace to/dev/watchdog. If VG lockspace renewals fail (e.g. due to a storage outage, or asanlockdaemon failure), then the watchdog resets the host if locks are held in the VG π΅.- The default behavior with no settings configured is:
nopersist,timeout,watchdog.
--setpersist Stringβ set flags that control persistent reservation behavior π.y: setrequireandautostartflags.require: PR will be required to write or activate the VG.autostart: PR will be automatically started.ptpl: use persist through power loss on devices.- When
autostartis enabled, autoactivation and auto-lockstart commands will first start PR. lvmlocal.confpr_keyorhost_idmust be configured to use PR. And for local VGs, enablingsystem_idis also recommended.
--sharedβ makes a shared VG usinglvmlockdif LVM was compiled with lockd support π«Ά.lvmlockdwill pick lock typesanlockordlmdepending on which lock manager is running. This is the move that lets multiple hosts share a VG on shared devices β butlvmlockdand a lock manager must be configured and running. Seelvmlockd(8)for more about shared VGs.--systemid Stringβ sets the system ID that'll be given to the new VG, overriding the system ID of the host running the command πͺͺ. Normally you create a VG without this option, and the new VG just gets the system ID of whatever host created it. Using this requires caution, because the system ID of the new VG may not match the system ID of the host running the command β which leaves the VG inaccessible to that host π. Seelvmsystemid(7)for more.-t,--testβ run in test mode. Commands will not update metadata π. This works by disabling all metadata writing but nevertheless returning success to the calling function. Fair warning: this may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.-v,--verbose ...β set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent tostdoutandstderrπ£οΈ.--versionβ display version information. Simple. Iconic. β¨--[vg]metadatacopies all|unmanaged|Numberβ how many copies of the VG metadata are kept π. VG metadata lives in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using themetadataignoreflags on PVs to hit that specified number. And the number can also be swapped for special string values:unmanagedβ causes LVM to not automatically manage the PVmetadataignoreflags.allβ causes LVM to first clear themetadataignoreflags on all PVs, and then to becomeunmanaged.
-y,--yesβ do not prompt for confirmation interactively, just always assume the answer is yes. Use with extreme caution β οΈ. (For automatic no, see-qq.)-Z,--zero y|nβ controls whether the first 4 sectors (2048 bytes) of the device are wiped π§Ή. The default is to wipe these sectors unless either or both of--restorefileor--uuidare specified.
πΈ VARIABLES πΈ
VGβ Volume Group name. Seelvm(8)for valid names.PVβ Physical Volume name, a device path under/dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs) π. When the first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to the end.
Start and end range (inclusive): PV[:PE-PE] ...
Start and length range (counting from 0): PV[:PE+PE] ...
Stringβ see the option description for info about the string content. (Every string is unique bestie, check its own blurb π)Size[UNIT]β Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization β sokandKboth refer to 1024, no cap π«‘. The default input unit is specified by letter, followed by|UNIT.UNITrepresents the other possible input units:b|Bis bytes,s|Sis sectors of 512 bytes,k|Kis KiB,m|Mis MiB,g|Gis GiB,t|Tis TiB,p|Pis PiB,e|Eis EiB. And do not confuse this with the output control--units, where capital letters mean a multiple of 1000. Different worlds entirely π.
π ENVIRONMENT VARIABLES π
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter π.
β¨ EXAMPLES β¨
Create a VG with two PVs, using the default physical extent size:
vgcreate myvg /dev/sdk1 /dev/sdl1
π¦ SEE ALSO π¦
lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8),
vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), lvmdbusd(8), fsadm(8),
lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)
okay that's the whole page bestie, you made it to the end and I'm so proud of you π₯Ήπ this one is LVM TOOLS 2.03.44(2), dated 2026-10-27, brought to you by Red Hat, Inc. π now go forth and vgcreate responsibly, and remember: always read the man page before you touch the metadata πΈβ¨π
π¦ where this page comes from
- arch rolling: lvm2 2.03.44-1 Β· GPL-2.0-only AND LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms