vgcfgbackup

title: vgcfgbackup(8)

summary: Backup volume group configuration(s)

text:
# vgcfgbackup(8)

## NAME
vgcfgbackup — Backup volume group configuration(s)

## SYNOPSIS
vgcfgbackup

[ option_args ]

[ position_args ]

## DESCRIPTION
vgcfgbackup creates back up files containing metadata of VGs. If no VGs are named, back up files are created for all VGs. See vgcfgrestore(8) for information on using the back up files.

In a default installation, each VG is backed up into a separate file bearing the name of the VG in the directory /etc/lvm/backup.

To use an alternative back up file, use -f. In this case, when backing up multiple VGs, the file name is treated as a template, with %s replaced by the VG name.

NB. This DOES NOT back up the data content of LVs.

It may also be useful to regularly back up the files in /etc/lvm.

## USAGE
vgcfgbackup

[ -f|--file String ]

[ --foreign ]

[ --ignorelockingfailure ]

[ --readonly ]

[ --reportformat basic|json|json_std ]

[ COMMON_OPTIONS ]

[ VG ... ]

—

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
--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--file String

Write the backup to the named file. When backing up more than one VG, the file name is treated as a template, and %s is replaced by the VG name.

--foreign

Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help

Display help text.

--ignorelockingfailure

Allows a command to continue with read-only metadata operations after locking failures.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly

Prevent the command from making changes, including activation and metadata updates. (See --permission r for read only LVs.)

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgcfgrestore

title: vgcfgrestore(8)

summary: Restore volume group configuration

text:
# vgcfgrestore(8)

## NAME
vgcfgrestore — Restore volume group configuration

## SYNOPSIS
vgcfgrestore option_args position_args

[ option_args ]

[ position_args ]

--commandprofile String

--config String

-d|--debug ...

--devices PV

--devicesfile String

--driverloaded y|n

-f|--file String

--force ...

-h|--help

--journal String

-l|--list

--lockopt String

--longhelp

-M|--metadatatype lvm2

--nohints

--nolocking

--profile String

-q|--quiet ...

-t|--test

-v|--verbose ...

--version

-y|--yes

## DESCRIPTION
vgcfgrestore restores the metadata of a VG from a text back up file produced by vgcfgbackup(8). This writes VG metadata onto the devices specified in back up file.

A back up file can be specified with --file. If no backup file is specified, the most recent one is used. Use --list for a list of the available back up and archive files of a VG.

WARNING: When a VG contains thin pools, changes to thin metadata cannot be reverted, and data loss may occur if thin metadata has changed. The force option is required to restore in this case.

## USAGE
Restore VG metadata from last backup.

vgcfgrestore VG

[ COMMON_OPTIONS ]

—

Restore VG metadata from specified file.

vgcfgrestore -f|--file String VG

[ COMMON_OPTIONS ]

—

List all VG metadata backups.

vgcfgrestore -l|--list VG

[ COMMON_OPTIONS ]

—

List one VG metadata backup file.

vgcfgrestore -f|--file String -l|--list

[ COMMON_OPTIONS ]

[ VG ]

—

Common options for command:

[ -M|--metadatatype lvm2 ]

[ --force ... ]

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
--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--file String

Read metadata backup from the named file. Usually this file was created by vgcfgbackup.

--force ...

Force metadata restore even with thin pool LVs. Use with extreme caution. Most changes to thin metadata cannot be reverted. You may lose data if you restore metadata that does not match the thin pool kernel metadata precisely.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

-l|--list

List metadata backup and archive files pertaining to the VG. May be used with --file. Does not restore the VG.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

-M|--metadatatype lvm2

Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is no longer used.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## NOTES
To replace PVs, vgdisplay --partial --verbose will show the UUIDs and sizes of any PVs that are no longer present. If a PV in the VG is lost and you wish to substitute another of the same size, use pvcreate --restorefile filename --uuid uuid (plus additional arguments as appropriate) to initialise it with the same UUID as the missing PV. Repeat for all other missing PVs in the VG. Then use vgcfgrestore --file filename to restore the VG's metadata.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)

branch: sisyphus


vgchange

title: vgchange(8)

summary: Change volume group attributes

text:
# vgchange(8)

## NAME
vgchange — Change volume group attributes

## SYNOPSIS
vgchange option_args position_args

[ option_args ]

[ position_args ]

-a|--activate y|n|ay

--activationmode partial|degraded|complete

--addtag Tag

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit

--autoactivation String

-A|--autobackup y|n

--commandprofile String

--config String

-d|--debug ...

--deltag Tag

--detachprofile

--devices PV

--devicesfile String

--driverloaded y|n

-f|--force ...

-h|--help

-K|--ignoreactivationskip

--ignorelockingfailure

--ignoremonitoring

--journal String

--lockopt String

--lockstart

--lockstop

--locktype sanlock|dlm|none

-l|--logicalvolume Number

--longhelp

--majoritypvs

-p|--maxphysicalvolumes Number

--metadataprofile String

--monitor y|n

--nohints

--nolocking

--noudevsync

-P|--partial

--persist String

-s|--physicalextentsize Size[m|UNIT]

--poll y|n

--profile String

--pvmetadatacopies 0|1|2

-q|--quiet ...

--readonly

--refresh

--removekey String

--reportformat basic|json|json_std

-x|--resizeable y|n

-S|--select String

--setautoactivation y|n

--setlockargs String

--setpersist String

--sysinit

--systemid String

-t|--test

-u|--uuid

-v|--verbose ...

--version

--[vg]metadatacopies all|unmanaged|Number

-y|--yes

## DESCRIPTION
vgchange changes VG attributes, changes LV activation in the kernel, and includes other utilities for VG maintenance.

## USAGE
Change a general VG attribute. For options listed in parentheses, any one is required, after which the others are optional.

vgchange

( -l|--logicalvolume Number

-p|--maxphysicalvolumes Number

-s|--physicalextentsize Size[m|UNIT]

-u|--uuid

-x|--resizeable y|n

--addtag Tag

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit

--deltag Tag

--detachprofile

--metadataprofile String

--pvmetadatacopies 0|1|2

--setautoactivation y|n

--[vg]metadatacopies all|unmanaged|Number )

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -S|--select String ]

[ --ignoremonitoring ]

[ --noudevsync ]

[ --poll y|n ]

[ --reportformat basic|json|json_std ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Start or stop monitoring LVs from dmeventd.

vgchange --monitor y|n

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -S|--select String ]

[ --ignorelockingfailure ]

[ --ignoremonitoring ]

[ --noudevsync ]

[ --poll y|n ]

[ --reportformat basic|json|json_std ]

[ --sysinit ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Start or stop processing LV conversions.

vgchange --poll y|n

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -S|--select String ]

[ --ignorelockingfailure ]

[ --ignoremonitoring ]

[ --noudevsync ]

[ --reportformat basic|json|json_std ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Activate or deactivate LVs.

vgchange -a|--activate y|n|ay

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -K|--ignoreactivationskip ]

[ -P|--partial ]

[ -S|--select String ]

[ --activationmode partial|degraded|complete ]

[ --autoactivation String ]

[ --ignorelockingfailure ]

[ --ignoremonitoring ]

[ --monitor y|n ]

[ --noudevsync ]

[ --persist String ]

[ --poll y|n ]

[ --readonly ]

[ --reportformat basic|json|json_std ]

[ --sysinit ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Reactivate LVs using the latest metadata.

vgchange --refresh

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -S|--select String ]

[ --ignorelockingfailure ]

[ --ignoremonitoring ]

[ --noudevsync ]

[ --poll y|n ]

[ --reportformat basic|json|json_std ]

[ --sysinit ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Change the system ID of a VG.

vgchange --systemid String VG|Tag|Select

[ -S|--select String ]

[ --majoritypvs ]

[ --persist String ]

[ --removekey String ]

[ COMMON_OPTIONS ]

—

Set or clear flags to control persistent reservation behavior.

vgchange --setpersist String VG|Tag|Select

[ -S|--select String ]

[ --persist start ]

[ COMMON_OPTIONS ]

—

Perform persistent reservation commands on devices.

vgchange --persist String VG|Tag|Select

[ -f|--force ... ]

[ -S|--select String ]

[ --majoritypvs ]

[ --removekey String ]

[ COMMON_OPTIONS ]

—

Set or clear lock_args flags to control lock manager behavior.

vgchange --setlockargs String VG|Tag|Select

[ -S|--select String ]

[ COMMON_OPTIONS ]

—

Start the lockspace of a shared VG in lvmlockd.

vgchange --lockstart

[ -S|--select String ]

[ --persist start ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Stop the lockspace of a shared VG in lvmlockd.

vgchange --lockstop

[ -S|--select String ]

[ --persist stop ]

[ COMMON_OPTIONS ]

[ VG|Tag|Select ... ]

—

Change the lock type for a shared VG.

vgchange --locktype sanlock|dlm|none VG

[ --setlockargs String ]

[ COMMON_OPTIONS ]

—

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
-a|--activate y|n|ay

Change the active state of LVs. An active LV can be used through a block device, allowing data on the LV to be accessed. y makes LVs active, or available. n makes LVs inactive, or unavailable. The block device for the LV is added or removed from the system using device-mapper in the kernel. A symbolic link /dev/VGName/LVName pointing to the device node is also added/removed. All software and scripts should access the device through the symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution, configuration (e.g. udev), or release version. ay specifies autoactivation, which is used by system-generated activation commands. By default, LVs are autoactivated. An autoactivation property can be set on a VG or LV to disable autoactivation, see --setautoactivation y|n in vgchange, lvchange, vgcreate, and lvcreate. Display the property with vgs or lvs "-o autoactivation". The lvm.conf(5) auto_activation_volume_list includes names of VGs or LVs that should be autoactivated, and anything not listed is not autoactivated. When auto_activation_volume_list is undefined (the default), it has no effect. If auto_activation_volume_list is defined and empty, no LVs are autoactivated. Items included by auto_activation_volume_list will not be autoactivated if the autoactivation property has been disabled. See lvmlockd(8) for more information about activation options ey and sy for shared VGs.

--activationmode partial|degraded|complete

Determines if LV activation is allowed when PVs are missing, e.g. because of a device failure. complete only allows LVs with no missing PVs to be activated, and is the most restrictive mode. degraded allows RAID LVs with missing PVs to be activated. (This does not include the "mirror" type, see "raid1" instead.) partial allows any LV with missing PVs to be activated, and should only be used for recovery or repair. For default, see lvm.conf(5) activation_mode. See lvmraid(7) for more information.

--addtag Tag

Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit

Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overridden on the command line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs to be placed adjacent to existing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

--autoactivation String

Specify if autoactivation is being used from an event. This allows the command to apply settings that are specific to event activation, such as device scanning optimizations using pvs_online files created by event-based pvscans.

-A|--autobackup y|n

Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--deltag Tag

Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. See lvm(8) for information about tags.

--detachprofile

Detaches a metadata profile from a VG or LV. See lvm.conf(5) for more information about profiles.

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...

Override various checks, confirmations and protections. Use with extreme caution.

-h|--help

Display help text.

-K|--ignoreactivationskip

Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated.

--ignorelockingfailure

Allows a command to continue with read-only metadata operations after locking failures.

--ignoremonitoring

Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is already monitoring a device.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--lockstart

Start the lockspace of a shared VG in lvmlockd. lvmlockd locks becomes available for the VG, allowing LVM to use the VG. See lvmlockd(8) for more information.

--lockstop

Stop the lockspace of a shared VG in lvmlockd. lvmlockd locks become unavailable for the VG, preventing LVM from using the VG. See lvmlockd(8) for more information.

--locktype sanlock|dlm|none

Change the VG lock type to or from a shared lock type used with lvmlockd. See lvmlockd(8) for more information.

-l|--logicalvolume Number

Sets the maximum number of LVs allowed in a VG.

--longhelp

Display long help text.

--majoritypvs

Change the VG system ID if the majority of PVs in the VG are present (one more than half).

-p|--maxphysicalvolumes Number

Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance.

--metadataprofile String

The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--monitor y|n

Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV, and performs automated maintenance for the LV in response to specific events. See dmeventd(8) for more information.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--noudevsync

Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.

-P|--partial

Commands will do their best to activate LVs with missing PV extents. Missing extents may be replaced with error or zero segments according to the missing_stripe_filler setting. Metadata may not be changed with this option.

--persist String

Persistent Reservation operation. start: register local key and acquire reservation. stop: unregister local key, releasing reservation. remove: preempt and abort another key. clear: remove reservation and keys. check: check if started. autostart: start if the VG autostart flag is set. lvmlocal.conf pr_key or host_id must 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 --setpersist to 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 least 128 KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving. Before increasing the physical extent size, you might need to use lvresize, pvresize and/or pvmove so that everything fits. For example, every contiguous range of extents used in a LV must start and end on an extent boundary.

--poll y|n

When yes, start the background transformation of an LV. An incomplete transformation, e.g. pvmove or lvconvert interrupted by reboot or crash, can be restarted from the last checkpoint with --poll y. When no, background transformation of an LV will not occur, and the transformation will not complete. It may not be appropriate to immediately poll an LV after activation, in which case --poll n can be used to defer polling until a later --poll y command.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2

The number of metadata areas to set aside on a PV for storing VG metadata. 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 (this places limitations on the ability to use vgsplit later.)

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly

Prevent the command from making changes, including activation and metadata updates. (See --permission r for read only LVs.)

--refresh

If the LV is active, reload its metadata. In an environment where udev is used to manage the /dev content, usage of this option is highly recommended. This is because refresh also regenerates udev events for an LV based on which existing udev rules are applied to set the /dev content and permissions. Also, this operation may be useful if something has gone wrong, or if some form of manual LV sharing is being used.

--removekey String

A persistent reservation key to remove.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

-x|--resizeable y|n

Enables or disables the addition or removal of PVs to/from a VG (by vgextend/vgreduce).

-S|--select String

Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process.

--setautoactivation y|n

Set the autoactivation property on a VG or LV. Display the property with vgs or lvs "-o autoactivation". When the autoactivation property is disabled, the VG or LV will not be activated by a command doing autoactivation (vgchange, lvchange, or pvscan using -aay.) If autoactivation is disabled on a VG, no LVs will be autoactivated in that VG, and the LV autoactivation property has no effect. If autoactivation is enabled on a VG, autoactivation can be disabled for individual LVs.

--setlockargs String

Add or remove lock_args settings for a shared VG. The lock_args determine lock manager behavior for the VG. These settings are only allowed for lock_type sanlock. persist: use persistent reservations for lock recovery. lvmlockd will preempt-abort the persistent reservation of a failed lock owner so that the lock can be acquired. notimeout: use locks that do not time out when the owner fails. In this case, a lock owned by a failed host can only be acquired using the persist feature. nopersist: do not use the persist feature. timeout: do not use the notimeout feature. The default behavior with no settings configured is: nopersist and timeout.

--setpersist String

Set or clear flags to control persistent reservation behavior. y: set require and autostart flags. n: clear require and autostart flags. require: set flag, PR will be required to write or activate VG. norequire: clear require flag. autostart: set flag, PR will be automatically started. noautostart: clear autostart flag. ptpl: set flag, use persist through power loss on devices. noptpl: clear ptpl flag. When autostart is enabled, autoactivation and auto-lockstart commands will first start PR. lvmlocal.conf pr_key or host_id must be configured to use PR. For local VGs, enabling system_id is also recommended.

--sysinit

Indicates that vgchange/lvchange is being invoked from early system initialisation scripts (e.g. rc.sysinit or an initrd), before writable filesystems are available. As such, some functionality needs to be disabled and this option acts as a shortcut which selects an appropriate set of options. Currently, this is equivalent to using --ignorelockingfailure, --ignoremonitoring, --poll n, and setting env var LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES. vgchange/lvchange skip autoactivation, and defer to pvscan autoactivation.

--systemid String

Changes the system ID of the VG. Using this option requires caution because the VG may become foreign to the host running the command, leaving the host unable to access it. See lvmsystemid(7) for more information.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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.

-u|--uuid

Generate new random UUID for specified VGs.

-v|--verbose ...

Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version

Display version information.

--[vg]metadatacopies all|unmanaged|Number

Number of copies of the VG metadata that are kept. VG metadata is kept 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 the metadataignore flags on PVs to achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the metadataignore flags on all PVs, and then to become unmanaged.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

Tag

Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select

Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## NOTES
If vgchange recognizes COW snapshot LVs that were dropped because they ran out of space, it displays a message informing the administrator that the snapshots should be removed.

## EXAMPLES
Activate all LVs in all VGs on all existing devices.

vgchange -a y

Change the maximum number of LVs for an inactive VG.

vgchange -l 128 vg00

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgck

title: vgck(8)

text:
# vgck(8)

## NAME
vgck — Check the consistency of volume group(s)

## SYNOPSIS
vgck option_args position_args

[ option_args ]

[ position_args ]

## DESCRIPTION
vgck checks LVM metadata for consistency.

## USAGE
Read and display information about a VG.

vgck

[ --reportformat basic|json|json_std ]

[ COMMON_OPTIONS ]

[ VG|Tag ... ]

—

Rewrite VG metadata to correct problems.

vgck --updatemetadata VG

[ COMMON_OPTIONS ]

—

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
--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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.

--updatemetadata

Update VG metadata to correct problems. If VG metadata was updated while a PV was missing, and the PV reappears with an old version of metadata, then this option (or any other command that writes metadata) will update the metadata on the previously missing PV. If a PV was removed from a VG while it was missing, and the PV reappears, using this option will clear the outdated metadata from the previously missing PV. If metadata text is damaged on one PV, using this option will replace the damaged metadata text. For more severe damage, e.g. with headers, see pvck(8).

-v|--verbose ...

Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

Tag

Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgconvert

title: vgconvert(8)

summary: Change volume group metadata format

text:
# vgconvert(8)

## NAME
vgconvert — Change volume group metadata format

## SYNOPSIS
vgconvert position_args

[ option_args ]

## DESCRIPTION
vgconvert is no longer a part of LVM. It was removed along with support for the LVM1 format. Use an older version of LVM to convert VGs from the LVM1 format to LVM2.

## USAGE
vgconvert VG ...

[ -f|--force ... ]

[ -M|--metadatatype lvm2 ]

[ --bootloaderareasize Size[m|UNIT] ]

[ --labelsector Number ]

[ --metadatasize Size[m|UNIT] ]

[ --pvmetadatacopies 0|1|2 ]

[ --reportformat basic|json|json_std ]

[ COMMON_OPTIONS ]

— 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
--bootloaderareasize Size[m|UNIT]

Reserve space for the bootloader between the LVM metadata area and the first PE. The bootloader area is reserved for bootloaders to embed their own data or metadata; LVM will not use it. The bootloader area begins where the first PE would otherwise be located. The first PE is moved out by the size of the bootloader area, and then moved out further if necessary to match the data alignment. The start of the bootloader area is always aligned, see also --dataalignment and --dataalignmentoffset. The bootloader area may be larger than requested due to the alignment, but it's never less than the requested size. To see the bootloader area start and size of an existing PV use pvs -o +pv_ba_start,pv_ba_size.

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...

Override various checks, confirmations and protections. Use with extreme caution.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--labelsector Number

By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the source). Use with care.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

--metadatasize Size[m|UNIT]

The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2

Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is no longer used.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2

The number of metadata areas to set aside on a PV for storing VG metadata. 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 (this places limitations on the ability to use vgsplit later.)

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgcreate

title: vgcreate(8)

summary: Create a volume group

text:
# vgcreate(8)

## NAME
vgcreate — Create a volume group

## SYNOPSIS
vgcreate position_args

[ option_args ]

## DESCRIPTION
vgcreate creates a new VG on block devices. If the devices were not previously initialized as PVs with pvcreate(8), vgcreate will initialize them, making them PVs. The pvcreate options for initializing devices are also available with vgcreate.

When vgcreate uses an existing PV, that PV's existing values for metadata size, PE start, etc., are used, even if different values are specified in the vgcreate command. To change these values, first use pvremove on the device.

## 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 sanlock|dlm|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 ]

—

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

Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit

Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overridden on the command line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs to be placed adjacent to existing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n

Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-c|--clustered y|n

This option was specific to clvm and is now replaced by the --shared option with lvmlockd(8).

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

--dataalignment Size[k|UNIT]

Align the start of a PV data area with a multiple of this number. To see the location of the first Physical Extent (PE) of an existing PV, use pvs -o +pe_start. In addition, it may be shifted by an alignment offset, see --dataalignmentoffset. Also specify an appropriate PE size when creating a VG.

--dataalignmentoffset Size[k|UNIT]

Shift the start of the PV data area by this additional offset.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...

Override various checks, confirmations and protections. Use with extreme caution.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--labelsector Number

By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the source). Use with care.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--locktype sanlock|dlm|none

Specify the VG lock type directly in place of using --shared. See lvmlockd(8) for more information.

--longhelp

Display 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. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance.

--metadataprofile String

The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--metadatasize Size[m|UNIT]

The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2

Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is no longer used.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--persist String

Persistent Reservation operation. start: register local key and acquire reservation. stop: unregister local key, releasing reservation. remove: preempt and abort another key. clear: remove reservation and keys. check: check if started. autostart: start if the VG autostart flag is set. lvmlocal.conf pr_key or host_id must 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 --setpersist to 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 least 128 KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2

The number of metadata areas to set aside on a PV for storing VG metadata. 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 (this places limitations on the ability to use vgsplit later.)

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

--setautoactivation y|n

Set the autoactivation property on a VG or LV. Display the property with vgs or lvs "-o autoactivation". When the autoactivation property is disabled, the VG or LV will not be activated by a command doing autoactivation (vgchange, lvchange, or pvscan using -aay.) If autoactivation is disabled on a VG, no LVs will be autoactivated in that VG, and the LV autoactivation property has no effect. If autoactivation is enabled on a VG, autoactivation can be disabled for individual LVs.

--setlockargs String

Add or remove lock_args settings for a shared VG. The lock_args determine lock manager behavior for the VG. These settings are only allowed for lock_type sanlock. persist: use persistent reservations for lock recovery. lvmlockd will preempt-abort the persistent reservation of a failed lock owner so that the lock can be acquired. notimeout: use locks that do not time out when the owner fails. In this case, a lock owned by a failed host can only be acquired using the persist feature. nopersist: do not use the persist feature. timeout: do not use the notimeout feature. The default behavior with no settings configured is: nopersist and timeout.

--setpersist String

Set flags to control persistent reservation behavior. y: set require and autostart flags. require: PR will be required to write or activate VG. autostart: PR will be automatically started. ptpl: use persist through power loss on devices. When autostart is enabled, autoactivation and auto-lockstart commands will first start PR. lvmlocal.conf pr_key or host_id must be configured to use PR. For local VGs, enabling system_id is also recommended.

--shared

Create a shared VG using lvmlockd if LVM is compiled with lockd support. lvmlockd will select lock type sanlock or dlm depending on which lock manager is running. This allows multiple hosts to share a VG on shared devices. lvmlockd and a lock manager must be configured and running. See lvmlockd(8) for more information about shared VGs.

--systemid String

Specifies the system ID that will be given to the new VG, overriding the system ID of the host running the command. A VG is normally created without this option, in which case the new VG is given the system ID of the host creating it. Using this option requires caution because the system ID of the new VG may not match the system ID of the host running the command, leaving the VG inaccessible to the host. See lvmsystemid(7) for more information.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

--[vg]metadatacopies all|unmanaged|Number

Number of copies of the VG metadata that are kept. VG metadata is kept 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 the metadataignore flags on PVs to achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the metadataignore flags on all PVs, and then to become unmanaged.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n

Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified.

## VARIABLES
VG

Volume Group name. See lvm(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 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 information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgdisplay

title: vgdisplay(8)

summary: Display volume group information

text:
# vgdisplay(8)

## NAME
vgdisplay — Display volume group information

## SYNOPSIS
vgdisplay option_args

[ option_args ]

[ position_args ]

-A|--activevolumegroups

--aligned

-a|--all

--binary

-c|--colon

-C|--columns

--commandprofile String

--config String

--configreport log|vg|lv|pv|pvseg|seg

-d|--debug ...

--devices PV

--devicesfile String

--driverloaded y|n

--foreign

--headings none|abbrev|full|0|1|2

-h|--help

--ignorelockingfailure

--journal String

--lockopt String

--logonly

--longhelp

--nameprefixes

--noheadings

--nohints

--nolocking

--nosuffix

-o|--options String

--profile String

-q|--quiet ...

--readonly

--reportformat basic|json|json_std

--rows

-S|--select String

--separator String

--shared

-s|--short

-O|--sort String

-t|--test

--unbuffered

--units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E

--unquoted

-v|--verbose ...

--version

-y|--yes

## DESCRIPTION
vgdisplay shows the attributes of VGs, and the associated PVs and LVs.

vgs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format.

## USAGE
vgdisplay

[ -A|--activevolumegroups ]

[ -s|--short ]

[ COMMON_OPTIONS ]

[ VG|Tag ... ]

—

Display output in columns like vgs.

vgdisplay -C|--columns

[ -a|--all ]

[ -o|--options String ]

[ -O|--sort String ]

[ -S|--select String ]

[ --aligned ]

[ --binary ]

[ --configreport log|vg|lv|pv|pvseg|seg ]

[ --headings none|abbrev|full|0|1|2 ]

[ --logonly ]

[ --nameprefixes ]

[ --noheadings ]

[ --nosuffix ]

[ --rows ]

[ --separator String ]

[ --unbuffered ]

[ --unquoted ]

[ COMMON_OPTIONS ]

[ VG|Tag ... ]

—

Generate colon separated output.

vgdisplay -c|--colon

[ -A|--activevolumegroups ]

[ COMMON_OPTIONS ]

[ VG|Tag ... ]

—

Common options for command:

[ --foreign ]

[ --ignorelockingfailure ]

[ --readonly ]

[ --reportformat basic|json|json_std ]

[ --shared ]

[ --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]

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
-A|--activevolumegroups

Only select active VGs. The VG is considered active if at least one of its LVs is active.

--aligned

Use with --separator to align the output columns.

-a|--all

List all VGs. Equivalent to not specifying any VGs.

--binary

Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

-c|--colon

Generate colon separated output for easier parsing in scripts or programs. Also see vgs(8) which provides considerably more control over the output. The values are:

- Volume group name

- Volume group access

- Volume group status

- Internal volume group number

- Maximum number of logical volumes

- Current number of logical volumes

- Open count of all logical volumes in this volume group

- Maximum logical volume size

- Maximum number of physical volumes

- Current number of physical volumes

- Actual number of physical volumes

- Size of volume group in kilobytes

- Physical extent size

- Total number of physical extents for this volume group

- Allocated number of physical extents for this volume group

- Free number of physical extents for this volume group

- Uuid of volume group

-C|--columns

Display output in columns. The equivalent of vgs(8). Options listed are the same as options given in vgs(8).

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg

See lvmreport(7).

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign

Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

--headings none|abbrev|full|0|1|2

Type of headings to use in report output. none or 0: No headings. abbrev or 1: Column name abbreviations. full or 2: Full column names.

-h|--help

Display help text.

--ignorelockingfailure

Allows a command to continue with read-only metadata operations after locking failures.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--logonly

Suppress command report and display only log report.

--longhelp

Display long help text.

--nameprefixes

Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev rules).

--noheadings

Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--nosuffix

Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String

Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV fields, seg_all all LV segment fields, and pvseg_all all PV segment fields. See the lvm.conf(5) report section for more config options. See lvmreport(7) for more information about reporting.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly

Prevent the command from making changes, including activation and metadata updates. (See --permission r for read only LVs.)

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

--rows

Output columns as rows.

-S|--select String

Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process.

--separator String

String to use to separate each column. Useful if grepping the output.

--shared

Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-s|--short

Give a short listing showing the existence of VGs.

-O|--sort String

Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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.

--unbuffered

Produce output immediately without sorting or aligning the columns properly.

--units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E

All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

--unquoted

When used with --nameprefixes, output values in the field=value pairs are not quoted.

-v|--verbose ...

Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

Tag

Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgexport

title: vgexport(8)

text:
# vgexport(8)

## NAME
vgexport — Unregister volume group(s) from the system

## SYNOPSIS
vgexport option_args position_args

[ option_args ]

## DESCRIPTION
vgexport changes a VG into the exported state, which ensures that the VG and its disks are not being used, and cannot be used until the VG is imported by vgimport(8). Putting a VG into an unusable, offline state can be useful when doing things like moving a VG's disks to another system. Exporting a VG provides some protection from its LVs being accidentally used, or being used by an automated system before it's ready.

A VG cannot be exported until all of its LVs are inactive.

LVM commands will ignore an exported VG or report an error if a command tries to use it.

For an exported VG, the vgs command will display attribute, and the pvs command will display attribute. Both vgs and pvs will display report field.

vgexport clears the VG system ID, and vgimport sets the VG system ID to match the host running vgimport (if the host has a system ID).

## USAGE
Export specified VGs.

vgexport VG|Tag|Select ...

[ -S|--select String ]

[ --persist stop ]

[ COMMON_OPTIONS ]

—

Export all VGs.

vgexport -a|--all

[ COMMON_OPTIONS ]

—

Common options for command:

[ --reportformat basic|json|json_std ]

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
-a|--all

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--persist String

Persistent Reservation operation. start: register local key and acquire reservation. stop: unregister local key, releasing reservation. remove: preempt and abort another key. clear: remove reservation and keys. check: check if started. autostart: start if the VG autostart flag is set. lvmlocal.conf pr_key or host_id must 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 --setpersist to automate and/or require PR.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

-S|--select String

Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

## VARIABLES
VG

Volume Group name. See lvm(8) for valid names.

Tag

Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select

Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String

See the option description for information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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.

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)


vgextend

title: vgextend(8)

summary: Add physical volumes to a volume group

text:
# vgextend(8)

## NAME
vgextend — Add physical volumes to a volume group

## SYNOPSIS
vgextend position_args

[ option_args ]

## DESCRIPTION
vgextend adds one or more PVs to a VG. This increases the space available for LVs in the VG.

Also, PVs that have gone missing and then returned, e.g. due to a transient device failure, can be added back to the VG without re-initializing them (see --restoremissing).

If the specified PVs have not yet been initialized with pvcreate, vgextend will initialize them. In this case pvcreate options can be used, e.g. --labelsector, --metadatasize, --metadataignore, --pvmetadatacopies, --dataalignment, --dataalignmentoffset.

## USAGE
vgextend VG PV ...

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -M|--metadatatype lvm2 ]

[ -Z|--zero y|n ]

[ --dataalignment Size[k|UNIT] ]

[ --dataalignmentoffset Size[k|UNIT] ]

[ --labelsector Number ]

[ --metadataignore y|n ]

[ --metadatasize Size[m|UNIT] ]

[ --pvmetadatacopies 0|1|2 ]

[ --reportformat basic|json|json_std ]

[ --restoremissing ]

[ COMMON_OPTIONS ]

—

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
-A|--autobackup y|n

Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String

The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String

Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config.

--dataalignment Size[k|UNIT]

Align the start of a PV data area with a multiple of this number. To see the location of the first Physical Extent (PE) of an existing PV, use pvs -o +pe_start. In addition, it may be shifted by an alignment offset, see --dataalignmentoffset. Also specify an appropriate PE size when creating a VG.

--dataalignmentoffset Size[k|UNIT]

Shift the start of the PV data area by this additional offset.

-d|--debug ...

Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--devices PV

Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma separated list of devices. This overrides the devices file.

--devicesfile String

A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.

--driverloaded y|n

If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...

Override various checks, confirmations and protections. Use with extreme caution.

-h|--help

Display help text.

--journal String

Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging.

--labelsector Number

By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the source). Use with care.

--lockopt String

Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--longhelp

Display long help text.

--metadataignore y|n

Specifies the metadataignore property of a PV. If yes, metadata areas on the PV are ignored, and lvm will not store metadata in the metadata areas of the PV. If no, lvm will store metadata on the PV.

--metadatasize Size[m|UNIT]

The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2

Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is no longer used.

--nohints

Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate.

--nolocking

Disable locking. Use with caution, concurrent commands may produce incorrect results.

--profile String

An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2

The number of metadata areas to set aside on a PV for storing VG metadata. 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 (this places limitations on the ability to use vgsplit later.)

-q|--quiet ...

Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json|json_std

Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format which is more compliant with JSON standard. See lvmreport(7) for more information.

--restoremissing

Add a PV back into a VG after the PV was missing and then returned, e.g. due to a transient failure. The PV is not reinitialized.

-t|--test

Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. 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 to stdout and stderr.

--version

Display version information.

-y|--yes

Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n

Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified.

## VARIABLES
VG

Volume Group name. See lvm(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 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 information about the string content.

Size[UNIT]

Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

## 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
Add two PVs to a VG.

vgextend vg00 /dev/sda4 /dev/sdn1

## 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), cmirrord(8), lvmdbusd(8), fsadm(8),

lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7)