lvmdiskscan

title: lvmdiskscan(8)

text:
# lvmdiskscan(8)

## NAME
lvmdiskscan — List devices that may be used as physical volumes

## SYNOPSIS
lvmdiskscan

[ option_args ]

## DESCRIPTION
lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of other block devices in the system looking for LVM PVs. The size reported is the real device size. Define a filter in lvm.conf(5) to restrict the scan to avoid a CD ROM, for example.

This command is deprecated, use pvs instead.

## USAGE
lvmdiskscan

[ -l|--lvmpartition ]

[ --readonly ]

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

-l|--lvmpartition

Only report PVs.

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

-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
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)


lvmdump

title: lvmdump(8)

text:
# lvmdump(8)

## NAME
lvmdump — create lvm2 information dumps for diagnostic purposes

## SYNOPSIS
lvmdump

[-a] [-c] [-d directory] [-h] [-l] [-m] [-p] [-s] [-u]

## DESCRIPTION
lvmdump is a tool to dump various information concerning LVM2. By default, it creates a tarball suitable for submission along with a problem report.

The content of the tarball is as follows:

•

dmsetup info

•

table of currently running processes

•

recent entries from /var/log/messages (containing system messages)

•

complete lvm configuration and cache (content of /etc/lvm)

•

list of device nodes present under /dev

•

list of files present /sys/block

•

list of files present /sys/devices/virtual/block

•

if enabled with -m, metadata dump will be also included

•

if enabled with -a, debug output of vgscan, pvscan and list of all available volume groups, physical volumes and logical volumes will be included

•

if enabled with -l, lvmetad state if running

•

if enabled with -p, lvmpolld state if running

•

if enabled with -s, system info and context

•

if enabled with -u, udev info and context

## OPTIONS
-a

Advanced collection.

WARNING: if lvm is already hung, then this script may hang as well if -a is used.

-d directory

Dump into a directory instead of tarball By default, lvmdump will produce a single compressed tarball containing all the information. Using this option, it can be instructed to only produce the raw dump tree, rooted in directory.

-h

Print help message

-l

Include lvmetad(8) daemon dump if it is running. The dump contains cached information that is currently stored in lvmetad: VG metadata, PV metadata and various mappings in between these metadata for quick access.

-m

Gather LVM metadata from the PVs This option generates a 1:1 dump of the metadata area from all PVs visible to the system, which can cause the dump to increase in size considerably. However, the metadata dump may represent a valuable diagnostic resource.

-p

Include lvmpolld(8) daemon dump if it is running. The dump contains all in-progress operation currently monitored by the daemon and partial history for all yet uncollected results of polling operations already finished including reason.

-s

Gather system info and context. Currently, this encompasses info gathered by calling lsblk command and various systemd info and context: overall state of systemd units present in the system, more detailed status of units controlling LVM functionality and the content of systemd journal for current boot.

-u

Gather udev info and context: /etc/udev/udev.conf file, udev daemon version (output of 'udevadm info --version' command), udev rules currently used in the system (content of /lib/udev/rules.d and /etc/udev/rules.d directory), list of files in /lib/udev directory and dump of current udev database content (the output of 'udevadm info --export-db' command).

## ENVIRONMENT VARIABLES
LVM_BINARY

The LVM2 binary to use. Defaults to "lvm". Sometimes you might need to set this to "/usr/bin/lvm.static", for example.

DMSETUP_BINARY

The dmsetup binary to use. Defaults to "dmsetup".

## SEE ALSO
lvm(8), lvmpolld(8), dmsetup(8),

udev(8), udevadm(8)

branch: sisyphus


lvmlockctl

title: lvmlockctl(8)

summary: Control for lvmlockd

text:
# lvmlockctl(8)

## NAME
lvmlockctl — Control for lvmlockd

## SYNOPSIS
lvmlockctl [options]

## DESCRIPTION
This command interacts with lvmlockd(8).

## OPTIONS
-h|--help

Show this help information.

-q|--quit

Tell lvmlockd to quit.

-i|--info

Print lock state information from lvmlockd.

-d|--dump

Print log buffer from lvmlockd.

-w|--wait 0|1

Wait option for other commands.

-f|--force 0|1

Force option for other commands.

-k|--kill vgname

Kill access to the VG when sanlock cannot renew lease.

-r|--drop vgname

Clear locks for the VG when it is unused after kill (-k).

-E|--gl-enable vgname

Tell lvmlockd to enable the global lock in a sanlock VG.

-D|--gl-disable vgname

Tell lvmlockd to disable the global lock in a sanlock VG.

-S|--stop-lockspaces

Stop all lockspaces.

## USAGE
--info

This collects and displays lock state from lvmlockd. The display is primitive, incomplete and may change in future versions. To print the raw info lines from lvmlockd, combine this option with --dump|-d. Each VG lockspace may include lines with prefixes: "VG" for volume group info, "LS" for lockspace info, "PR" for persistent reservation fencing info, "LK" for lock info, "LW" for waiting lock info.

--dump

This collects the circular log buffer of debug statements from lvmlockd and prints it.

--kill

This is run by sanlock when it loses access to the storage holding leases for a VG. It runs the command specified in lvm.conf lvmlockctl_kill_command to deactivate LVs in the VG. If the specified command is successful, locks will be dropped for the VG in lvmlockd (the equivalent of lvmlockctl --drop will be run.) If no command is specified, or the command fails, then the user must intervene to forcefully deactivate LVs in the VG, and if successful, run lvmlockctl --drop. For more, see lvmlockd(8).

--drop

This should only be run after a VG has been successfully deactivated following an lvmlockctl --kill command. It clears the stale lockspace from lvmlockd. When lvmlockctl_kill_command is used, the --kill command may run drop automatically. For more, see lvmlockd(8).

--gl-enable

This enables the global lock in a sanlock VG. This is necessary if the VG that previously held the global lock is removed. For more, see lvmlockd(8).

--gl-disable

This disables the global lock in a sanlock VG. This is necessary if the global lock has mistakenly been enabled in more than one VG. The global lock should be disabled in all but one sanlock VG. For more, see lvmlockd(8).

--stop-lockspaces

This tells lvmlockd to stop all lockspaces. It can be useful to stop lockspaces for VGs that the vgchange --lock-stop command can no longer see, or to stop the dlm global lockspace which is not directly stopped by the vgchange command. The wait and force options can be used with this command.

## SEE ALSO
lvm(8), lvmlockd(8)


lvmpersist

title: lvmpersist(8)

text:
# lvmpersist(8)

## NAME
lvmpersist - manage persistent reservations on a group of block devices

## DESCRIPTION
Persistent reservations (PRs) provide a mechanism to control access to shared storage devices, typically to protect the devices from being modified by hosts that should not be writing to the shared devices. This is usually a concern in SAN or clustered environments, where multiple hosts have access to the same storage devices.

If an LVM Volume Group (VG) contains PR-capable devices, then LVM commands can be used to manage PR at the VG level, applying PR to each Physical Volume (PV) in the VG. (All PVs in the VG must support PR.)

lvmpersist is a low level utility used to perform PR operations on individual block devices. LVM also provides a higher level PR management interface through a standard LVM command interface:

vgchange --setpersist, vgchange --persist

lvmpersist is a script that does not implement the common LVM command line options or capabilities. The script uses sg_persist, mpathpersist, and nvme commands to perform PR operations on block devices. Higher level LVM commands (e.g. vgchange) run the lvmpersist script.

### Device types
SCSI or SCSI-like (e.g. iSCSI, SAS, Fibre Channel), dm-multipath, and NVME devices are supported. PRs were introduced with the SCSI Primary Commands Version 3 standard (SPC-3).

When multipath devices are used, multipath.conf must be configured with "reservation_key file". (Run mpathconf --option reservation_key:file, and restart multipathd.)

### Persistent reservation types
LVM uses PR type "Write Exclusive" (WE) for devices in a local VG, and "Write Exclusive - all registrants" (WEAR) for devices in a shared VG. One exception is dm-multipath devices, for which WEAR is used in both local and shared VGs (this is needed for all paths to remain usable.)

The lvmpersist command has two options for specifying the PR type:

--access ex|sh

Set access to "ex" (exclusive) if the devices should be accessed by only one host (i.e. the devices are part of a local VG.) Set access to "sh" (shared) if the devices are meant to be accessed concurrently by multiple hosts (i.e. the devices are part of a shared VG.) lvmpersist will choose the appropriate PR type for each device (usually WE for "ex", and WEAR for "sh".)

--prtype PRTYPE

When a PRTYPE value is specified, lvmpersist will use only that type for all devices.

PR types and the abbreviations used in interfaces/messages:

WE Write Exclusive

EA Exclusive Access

WERO Write Exclusive - registrants only

EARO Exclusive Access - registrants only

WEAR Write Exclusive - all registrants

EAAR Exclusive Access - all registrants

(WERO and EARO types are not yet supported.)

### Persistent reservation keys
PR keys can be up to 8 bytes long, and are represented with up to 16 hex characters with a "0x" prefix. Leading 0s are not permitted, e.g. use 0x1234abcd, not 0x000000001234abcd. A decimal key value (without a 0x prefix) is accepted as input, but will appear as hex in output.

Each host using shared devices must use a unique PR key.

PR keys must be configured on each host in /etc/lvm/lvmlocal.conf (see Local Settings below.)

## USAGE
The basic command set and options for managing PR:

Device-level PR utility:

lvmpersist start|stop|remove|clear|read [OPTIONS] DEST

VG PR configuration:

vgchange --setpersist y|n VG

VG PR operations:

vgchange --persist start|stop|remove|clear|read|check VG

### lvmpersist commands
lvmpersist start --ourkey KEY DEST

"start" registers the local key and reserves devices. If a different key from the same host is still registered, it will be replaced with the specified key. When --access or --prtype is not specified, access "ex" is used.

lvmpersist stop --ourkey KEY DEST

"stop" unregisters the local key, which also removes a local reservation.

lvmpersist remove --ourkey KEY --removekey REMKEY DEST

"remove" removes another registered host's key. The host with the removed key loses the ability to write to the devices. (This command applies to shared VGs, where multiple hosts are started at once.)

lvmpersist start --ourkey KEY --removekey REMKEY DEST

"start" with removekey registers the local key and takes the reservation from another host (using preempt-abort). The other host loses the ability to write to the devices. (This command applies to local VGs, for which a single host can be started at once.)

lvmpersist clear --ourkey KEY DEST

"clear" removes all keys and reservations from the devices.

lvmpersist devtest|read|read-keys|read-reservation DEST

These commands are used to test if devices support PR, and display current PR keys and reservations.

lvmpersist check-key --key KEY DEST

Check if a specified key is registered.

OPTIONS:

--ourkey KEY

The local PR key, e.g. 0x123abc

--removekey REMKEY

Another host's PR key.

--key KEY

Any key to check.

--access ex|sh

Use a PR type for exclusive or shared device access.

--prtype PRTYPE

Use the specified reservation type (alternative to --access.)

--ptpl

Enable persist through power loss during start (register.)

DEST:

--device PATH ...

One or more devices to operate on.

--vg VGNAME

One VG to operate on (all PVs in the VG.)

--vg VGNAME --device PATH ...

One or more devices to operate on, and a VG name to use as an identifier for the set of devices.

lvmpersist requires either the names of specific devices, each specified as --device /dev/name, or the name of a VG, specified with --vg VGNAME. When a VG is specified, with no individual block devices, lvmpersist runs PR commands on each PV in the VG. When devices are specified, and a VG is also provided with --vg, then the VG name is simply used in log messages to identify the set of devices as a whole. When lvmpersist is run by higher level LVM commands, each device is specified with --device, and the VG name is specified with --vg.

### VG metadata commands
vgchange --setpersist is used to configure the automation and enforcement of PR in relation to the broader use of the VG. The configuration is stored in the VG metadata.

vgchange --setpersist y|n VG

Enable or disable default automation and enforcement of PR for the VG, setting or clearing both "autostart" and "require" PR settings (and potentially other future settings.)

vgchange --setpersist autostart|noautostart|require|norequire VG

Individually set or clear the autostart and require settings.

When "autostart" is set, autoactivation and auto-lockstart commands (vgchange -aay, vgchange --lockstart --lockopt auto) will first start PR on the VG. If PR start fails, these commands stop and not attempt activation or lockstart.

When "require" is set, lvm commands that write or activate a VG require PR to be started before attempting to write or activate.

vgs -o persist VG

Display the settings.

### VG PR commands
vgchange --persist is used to perform PR operations on the VG's devices.

vgchange --persist start VG

Start PR on VG devices. Registers the local key and acquires a reservation.

vgchange --persist stop VG

Stop PR on VG devices. Unregisters the local key, which releases a reservation if one is held by the key.

vgchange --persist remove --removekey remkey VG

Remove the PR key of another host from a shared VG's devices, immediately disabling the ability of the other host to write to the devices. (This command applies to shared VGs, for which multiple hosts are started at once.)

vgchange --persist start --removekey remkey VG

Start PR on VG devices, while at the same time removing another host's key and reservation from the VG devices, disabling the ability of the other host to write to the devices. (This command applies to local VGs, for which a single host can be started at once.)

vgchange --persist check VG

Check if PR is started (the local key and reservation exists on all devices.) The command exits with success if PR is started on all VG devices.

vgchange --persist read VG

Display the PR registrations and reservations on each of the VG's devices.

vgchange --persist clear VG

Clear all PR keys and reservations on the VG devices.

vgchange --persist autostart VG

Start PR on VG devices if the autostart is set. This is meant to be used by system automation, like autoactivation and auto-lockstart.

### Supplementary PR start
The --persist start option can be added to other commands so that these commands will first attempt to start PR (regardless of the autostart setting.)

vgchange -ay --persist start

vgchange -aay --persist start

vgchange --lockstart --persist start

vgchange --setpersist y|require|autostart --persist start

vgimport --persist start

vgchange --systemid <local_id> --persist start

### Local VG usage
When using a local VG, only one host is started at a time, and a WE (Write Exclusive) reservation is typically held on the devices.

Using PR with local VGs protects VG devices from being written to in error by another host with access to the same devices. It is complementary to using the VG system ID to control the intended owner of a VG, but adds enforced device-level protection, in case another host is not using the LVM system ID feature.

If one host would like to forcibly take over a local VG that is currently in use by another host, it can use vgchange --persist start --removekey remkey VG, where "remkey" is the PR key of the currently started host.

### Shared VG usage
When using a shared VG, all hosts using the VG are started, and a WEAR (Write Exclusive - all registrants) reservation is held on the devices.

PR should be started before locking is started (vgchange --persist start followed by vgchange --lockstart, or a combined vgchange --persist start --lockstart.)

If one host would like to forcibly stop another host from writing to the shared VG devices, it can use vgchange --persist remove --removekey remkey where "remkey" is the PR key of the other host.

### Local Settings
Each host using PR is required to have a PR key that is unique among all hosts using the same VG. There are two approaches to setting a key value, which are set in /etc/lvm/lvmlocal.conf:

local/pr_key

The value set in pr_key will be used directly. It is a hex string up to 16 characters long. pr_key will not be used for sanlock shared VGs.

local/host_id

For a sanlock shared VG, or if no pr_key is set, a key will be created using the host_id. This is a decimal integer between 1 and 2000.

For a local VG, or a dlm shared VG, a key using host_id has the form:

0x100000000000XXXX where XXXX are the hex digits for the host_id value.

For a sanlock shared VG, the key is based on host_id and a generation number (taken from the sanlock lease), and has the form:

0x100000YYYYYYXXXX where XXXX are the hex digits for the host_id value, and YYYYYY are the hex digits for the generation number.

The sanlock generation number increases in value each time the host starts the VG, so a host will use a new key each time it starts. In some instances, PR may be started with a key that includes the incorrect generation number, in which case the lockstart command will update the key with the correct value (the generation number is officially determined during lockstart.)

### vgcreate
PR features can be enabled when creating a new VG:

vgcreate --setpersist y VG PVs

For local VGs, --persist start can be included to also start PR on the new VG.

Creating new shared VGs with --setpersist works differently. PR is always started for a new shared VG, even without --persist start. First, an exclusive PR (typically WE mode) is acquired for the new VG devices. The devices are then initialized, and the new VG metadata is written. The exclusive PR is then removed, and a shared PR (typically WEAR mode) is acquired for normal sharing of the VG. Finally, the VG lockspace is started.

### vgextend
For local VGs, vgextend starts PR on the new devices before adding them to the VG (the require or autostart setting must be enabled.) For shared VGs, the user must use lvmpersist to start PR on the new devices, from all hosts, before running vgextend. vgextend verifies that the reservation and keys on the new devices match the existing devices.

### vgremove
The vgremove command stops PR on the VG's devices only if "require" or "autostart" settings have been set using vgchange --setpersist. If PR has been started independent of any setpersist settings, then vgremove will not automatically stop PR on the devices.

### vgexport/vgimport
vgexport --persist stop stops PR after exporting the VG, and vgimport --persist start starts PR before importing the VG. Writing VG metadata for export happens before stopping PR, and writing VG metadata for import happens after starting PR.

### vgchange --systemid
PR can be started together with taking ownership of a VG's system ID, or PR can be stopped together with giving up ownership of a VG's system ID (see lvmsystemid(7) for more information.)

vgchange --systemid local_system_id --persist start VG

This command is used to take ownership of a foreign-owned VG. PR is started, and if successful, the system ID of the VG will be set to the local system ID. (Note: the foreign system ID of the VG needs to be included in local extra_system_ids to gain access to a foreign VG.) To forcibly remove (preempt-abort) PR held by another host on the VG, --removekey remkey can be included, where remkey is the PR key of the current PR holder.

vgchange --systemid foreign_system_id --persist stop VG

This command is used to give up ownership of a locally owned VG. The system ID of the VG is updated to the new value, and then PR is stopped.

### Persist Through Power Loss
To enable the use of "persist through power loss", in which PR state is retained on a device if it is power cycled, turn on the ptpl setting:

vgchange --setpersist ptpl VG

The PTPL setting is applied during key registration (part of PR start), so it will take effect for each host on the next start. It is applied to all PVs in the VG, so each device must support PTPL. The PTPL setting is not enabled by "--setpersist y".

Either of the following will clear the PTPL setting:

vgchange --setpersist noptpl VG

vgchange --setpersist n VG

## EXAMPLES

### Local VG usage

```
host1:
$ lvmconfig local/host_id
host_id=1
$ vgcreate vg /dev/sda /dev/sdb

  Physical volume "/dev/sda" successfully created.

  Physical volume "/dev/sdb" successfully created.

  Volume group "vg" successfully created
$ vgchange --setpersist y vg

  Volume group "vg" successfully changed.
$ vgchange --persist start vg

  lvmpersist: started vg with key 0x1000000000000001.
$ vgchange --persist check vg

  key for local host is registered: 0x1000000000000001

  reservation WE for local host

  PR is started.
$ lvcreate -l1 -n lvol0 vg

  Logical volume "lvol0" created.
$ vgchange -an vg

  0 logical volume(s) in volume group "vg" now active
$ vgchange --persist stop vg

  lvmpersist: stopped vg with key 0x1000000000000001.
$ vgchange -ay vg

  persistent reservation is not started.

  Cannot access VG vg without persistent reservation.
$ lvcreate -l1 -n lvol1 vg

  persistent reservation is not started.

  Cannot access VG vg without persistent reservation.
$ vgchange --persist start vg

  lvmpersist: started vg with key 0x1000000000000001.
$ vgchange -ay vg

  1 logical volume(s) in volume group "vg" now active
$ lvcreate -l1 -n lvol1 vg

  Logical volume "lvol1" created.
host2 foricibly takes VG from host1:
$ lvmconfig local/host_id
host_id=2
$ vgchange -ay vg

  persistent reservation is not started.

  Cannot access VG vg without persistent reservation.
$ vgchange --persist start vg

  persistent reservation is started by another host
$ vgchange --persist check vg

  key for local host is not registered (host_id 2)

  key for other host is registered: 0x1000000000000001

  reservation WE for other host

  PR is not started.
$ dd if=/dev/zero of=/dev/sda
dd: error writing '/dev/sda': Input/output error
$ vgchange --persist start --removekey 0x1000000000000001 vg

  lvmpersist: started vg with key 0x1000000000000002.
$ vgchange -ay vg

  2 logical volume(s) in volume group "vg" now active
$ vgchange --persist check vg

  key for local host is registered: 0x1000000000000002

  reservation WE for local host

  PR is started.
host1 can no longer write:
$ dd if=/dev/zero of=/dev/vg/lvol0
dd: error writing '/dev/vg/lvol0': Input/output error
$ lvcreate -l1 -n lvol1 vg

  persistent reservation is not started.

  Cannot access VG vg without persistent reservation.
$ vgchange --persist check vg

  key for local host is not registered (host_id 1)

  key for other host is registered: 0x1000000000000002

  reservation WE for other host

  PR is not started.
```

### Shared VG usage

```
host1:
$ lvmconfig local/host_id
host_id=1
$ vgcreate --shared vg /dev/sda /dev/sdb

  Enabling sanlock global lock

  Physical volume "/dev/sda" successfully created.

  Physical volume "/dev/sdb" successfully created.

  Logical volume "lvmlock" created.

  Volume group "vg" successfully created

  VG vg starting sanlock lockspace

  Starting locking.  Waiting until locks are ready...
$ vgchange --setpersist y vg

  Volume group "vg" successfully changed.
$ vgchange --persist start vg

  lvmpersist: started vg with key 0x1000000000010001.
$ vgchange --persist check vg

  key for local host is registered: 0x1000000000010001

  keys for all registered hosts: 0x1000000000010001

  reservation WEAR for registered hosts

  PR is started.
$ lvcreate -l1 -n lvol0 vg

  Logical volume "lvol0" created.
host2:
$ lvmconfig local/host_id
host_id=2
$ vgchange --persist start vg

  lvmpersist: started vg with key 0x1000000000010002.
$ vgchange --lockstart vg

  VG vg starting sanlock lockspace

  Starting locking.  Waiting for sanlock...
$ vgchange --persist check vg

  key for local host is registered: 0x1000000000010002

  keys for all registered hosts: 0x1000000000010001 0x1000000000010002

  reservation WEAR for registered hosts

  PR is started.
$ lvcreate -l1 -n lvol1 vg

  Logical volume "lvol1" created.
$ lvchange -ay vg/lvol0

  LV locked by other host: vg/lvol0 (host_id 1)

  Failed to lock logical volume vg/lvol0.
$ vgchange -an vg

  0 logical volume(s) in volume group "vg" now active
$ vgchange --lockstop vg
$ vgchange --persist stop vg

  lvmpersist: stopped ee with key 0x1000000000010002.
$ vgchange --persist check vg

  key for local host is not registered (host_id 2)

  keys for all registered hosts: 0x1000000000010001

  reservation WEAR for registered hosts

  PR is not started.
$ dd if=/dev/zero of=/dev/sda
dd: error writing '/dev/sda': Input/output error
```


lvmpolld

title: lvmpolld(8)

summary: LVM poll daemon

text:
# lvmpolld(8)

## NAME
lvmpolld — LVM poll daemon

## SYNOPSIS
lvmpolld

[-B|--binary lvm_binary_path] [-f|--foreground] [-h|--help] [-l|--log all|wire|debug] [-p|--pidfile pidfile_path] [-s|--socket socket_path] [-t|--timeout timeout_value] [-V|--version]

lvmpolld

[--dump]

## DESCRIPTION
lvmpolld is polling daemon for LVM. The daemon receives requests for polling of already initialised operations originating in LVM2 command line tool. The requests for polling originate in the lvconvert, pvmove, lvchange or vgchange LVM2 commands.

The purpose of lvmpolld is to reduce the number of spawned background processes per otherwise unique polling operation. There should be only one. It also eliminates the possibility of unsolicited termination of background process by external factors.

lvmpolld is used by LVM only if it is enabled in lvm.conf(5) by specifying the global/use_lvmpolld setting. If this is not defined in the LVM configuration explicitly then default setting is used instead (see the output of lvmconfig --type default global/use_lvmpolld command).

## OPTIONS
To run the daemon in a test environment both the pidfile_path and the socket_path should be changed from the defaults.

-B|--binary lvm_binary_path

Optional path to alternative LVM binary (default: /usr/bin/lvm). Use for testing purposes only.

--dump

Contact the running lvmpolld daemon to obtain the complete state and print it out in a raw format.

-f|--foreground

Don't fork, but run in the foreground.

-h|--help

Show help information.

-l|--log all|wire|debug

Select the type of log messages to generate. Messages are logged by syslog. Additionally, when -f is given they are also sent to standard error. There are two classes of messages: wire and debug. Selecting 'all' supplies both and is equivalent to a comma-separated list -l wire,debug.

-p|--pidfile pidfile_path

Path to the pidfile. This overrides both the built-in default (/run/lvmpolld.pid) and the environment variable LVM_LVMPOLLD_PIDFILE. This file is used to prevent more than one instance of the daemon running simultaneously.

-s|--socket socket_path

Path to the socket file. This overrides both the built-in default (/run/lvm/lvmpolld.socket) and the environment variable LVM_LVMPOLLD_SOCKET.

-t|--timeout timeout_value

The daemon may shutdown after being idle for the given time (in seconds). When the option is omitted or the value given is zero the daemon never shutdowns on idle.

-V|--version

Display the version of lvmpolld daemon.

## ENVIRONMENT VARIABLES
LVM_LVMPOLLD_PIDFILE

Path for the pid file.

LVM_LVMPOLLD_SOCKET

Path for the socket file.

## SEE ALSO
lvm(8), lvm.conf(5), lvchange(8), lvconvert(8), pvmove(8), vgchange(8)


lvmsadc

title: lvmsadc(8)

summary: LVM system activity data collector

text:
# lvmsadc(8)

## NAME
lvmsadc — LVM system activity data collector

## SYNOPSIS
lvmsadc

## DESCRIPTION
lvmsadc is not supported under LVM2. The device-mapper statistics facility provides similar performance metrics using the dmstats(8) command.

## SEE ALSO
dmstats(8), lvm(8)


lvmsar

title: lvmsar(8)

summary: LVM system activity reporter

text:
# lvmsar(8)

## NAME
lvmsar — LVM system activity reporter

## SYNOPSIS
lvmsar

## DESCRIPTION
lvmsar is not supported under LVM2. The device-mapper statistics facility provides similar performance metrics using the dmstats(8) command.

## SEE ALSO
dmstats(8), lvm(8)


lvreduce

title: lvreduce(8)

summary: Reduce the size of a logical volume

text:
# lvreduce(8)

## NAME
lvreduce — Reduce the size of a logical volume

## SYNOPSIS
lvreduce option_args position_args

[ option_args ]

## DESCRIPTION
lvreduce reduces the size of an LV. The freed logical extents are returned to the VG to be used by other LVs. A copy-on-write snapshot LV can also be reduced if less space is needed to hold COW blocks. Use lvconvert(8) to change the number of data images in a RAID or mirrored LV.

Be careful when reducing an LV's size, because data in the reduced area is lost. Ensure that any file system on the LV is resized before running lvreduce so that the removed extents are not in use by the file system.

Sizes will be rounded if necessary. For example, the LV size must be an exact number of extents, and the size of a striped segment must be a multiple of the number of stripes.

In the usage section below, --size Size can be replaced with --extents Number. See both descriptions the options section.

## USAGE
lvreduce -L|--size [-]Size[m|UNIT] LV

[ -l|--extents [-]Number[PERCENT] ]

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -n|--nofsck ]

[ -r|--resizefs ]

[ --fs String ]

[ --fsmode String ]

[ --noudevsync ]

[ --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
-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).

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

-l|--extents [-]Number[PERCENT]

Specifies the new size of the LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix %FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORIGIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the new LV is not determined until the command has completed. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-f|--force ...

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

--fs String

Control file system resizing when resizing an LV. checksize: Check the fs size and reduce the LV if the fs is not using the reduced space (fs reduce is not needed.) If the reduced space is used by the fs, then do not resize the fs or LV, and return an error. (checksize only applies when reducing, and does nothing for extend.) resize: Resize the fs by calling the fs-specific resize command. This may also include mounting, unmounting, or running fsck. See --fsmode to control mounting behavior, and --nofsck to disable fsck. resize_fsadm: Use the old method of calling fsadm to handle the fs (deprecated.) Warning: this option does not prevent lvreduce from destroying file systems that are unmounted (or mounted if prompts are skipped.) ignore: Resize the LV without checking for or handling a file system. Warning: using ignore when reducing the LV size may destroy the file system. Note: If resizing an LV without a file system and the new LV size matches the existing size, the command returns a non-zero status code (failure). However, if a file system resize is also requested along with the LV resize, and the sizes already match, the command returns a zero status code (success). This occurs because the external commands called to resize the file system return success even if the new and old file system sizes are identical. LVM follows the command status code behavior in this scenario.

--fsmode String

Control file system mounting behavior for fs resize. manage: Mount or unmount the fs as needed to resize the fs, and attempt to restore the original mount state at the end. nochange: Do not mount or unmount the fs. If mounting or unmounting is required to resize the fs, then do not resize the fs or the LV and fail the command. offline: Unmount the fs if it is mounted, and resize the fs while it is unmounted. If mounting is required to resize the fs, then do not resize the fs or the LV and fail the command.

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

-n|--nofsck

Do not perform fsck when resizing the file system with --resizefs.

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

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

-r|--resizefs

Resize the fs using the fs-specific resize command. May include mounting, unmounting, or running fsck. See --fsmode to control mounting behavior, and --nofsck to disable fsck. See --fs for more options (--resizefs is equivalent to --fs resize.)

-L|--size [-]Size[m|UNIT]

Specifies the new size of the LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID levels. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-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
LV

Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

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
Reduce the size of an LV by 3 logical extents:

lvreduce -l -3 vg00/lvol1

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


lvremove

title: lvremove(8)

text:
# lvremove(8)

## NAME
lvremove — Remove logical volume(s) from the system

## SYNOPSIS
lvremove position_args

[ option_args ]

## DESCRIPTION
lvremove removes one or more LVs. For standard LVs, this returns the logical extents that were used by the LV to the VG for use by other LVs.

Confirmation will be requested before deactivating any active LV prior to removal. LVs cannot be deactivated or removed while they are open (e.g. if they contain a mounted filesystem). Removing an origin LV will also remove all dependent snapshots.

When a single force option is used, LVs are removed without confirmation, and the command will try to deactivate unused LVs.

To remove damaged LVs, two force options may be required (-ff).

Historical LVs

If the configuration setting metadata/record_lvs_history is enabled and the LV being removed forms part of the history of at least one LV that is still present, then a simplified representation of the LV will be retained. This includes the time of removal (lv_time_removed reporting field), creation time (lv_time), name (lv_name), LV uuid (lv_uuid) and VG name (vg_name). This allows later reporting to see the ancestry chain of thin snapshot volumes, even after some intermediate LVs have been removed. The names of such historical LVs acquire a hyphen as a prefix (e.g. '-lvol1') and cannot be reactivated. Use lvremove a second time, with the hyphen, to remove the record of the former LV completely.

## USAGE
lvremove VG|LV|Tag|Select ...

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -S|--select String ]

[ --nohistory ]

[ --noudevsync ]

[ --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
-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).

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

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

--nohistory

Do not record history of LVs being removed. This has no effect unless the configuration setting metadata/record_lvs_history is enabled.

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

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

LV

Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

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.

## EXAMPLES
Remove an active LV without asking for confirmation.

lvremove -f vg00/lvol1

Remove all LVs the specified VG.

lvremove 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)


lvrename

title: lvrename(8)

summary: Rename a logical volume

text:
# lvrename(8)

## NAME
lvrename — Rename a logical volume

## SYNOPSIS
lvrename position_args

[ option_args ]

## DESCRIPTION
lvrename renames an existing LV or a historical LV (see lvremove for historical LV information.)

## USAGE
lvrename VG LV LV_new

[ COMMON_OPTIONS ]

—

lvrename LV LV_new

[ COMMON_OPTIONS ]

—

Common options for command:

[ -A|--autobackup y|n ]

[ --noudevsync ]

[ --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|--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).

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

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

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

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

LV

Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

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
Rename "lvold" to "lvnew":

lvrename /dev/vg02/lvold vg02/lvnew

An alternate syntax to rename "lvold" to "lvnew":

lvrename vg02 lvold lvnew

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


lvresize

title: lvresize(8)

summary: Resize a logical volume

text:
# lvresize(8)

## NAME
lvresize — Resize a logical volume

## SYNOPSIS
lvresize option_args position_args

[ option_args ]

[ position_args ]

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

-A|--autobackup y|n

--commandprofile String

--config String

-d|--debug ...

--devices PV

--devicesfile String

--driverloaded y|n

-l|--extents [+|-]Number[PERCENT]

-f|--force ...

--fs String

--fsmode String

-h|--help

--journal String

--lockopt String

--longhelp

-n|--nofsck

--nohints

--nolocking

--nosync

--noudevsync

--poolmetadatasize [+]Size[m|UNIT]

--profile String

-q|--quiet ...

--reportformat basic|json|json_std

-r|--resizefs

-L|--size [+|-]Size[m|UNIT]

-i|--stripes Number

-I|--stripesize Size[k|UNIT]

-t|--test

--type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|cache|cache-pool|writecache

-v|--verbose ...

--version

-y|--yes

## DESCRIPTION
lvresize resizes an LV in the same way as lvextend and lvreduce. See lvextend(8) and lvreduce(8) for more information.

In the usage section below, --size Size can be replaced with --extents Number. See both descriptions the options section.

## USAGE
Resize an LV by a specified size.

lvresize -L|--size [+|-]Size[m|UNIT] LV

[ -l|--extents [+|-]Number[PERCENT] ]

[ -r|--resizefs ]

[ --fs String ]

[ --fsmode String ]

[ --poolmetadatasize [+]Size[m|UNIT] ]

[ COMMON_OPTIONS ]

[ PV ... ]

—

Resize an LV by specified PV extents.

lvresize LV PV ...

[ -r|--resizefs ]

[ --fs String ]

[ --fsmode String ]

[ COMMON_OPTIONS ]

—

Resize a pool metadata SubLV by a specified size.

lvresize --poolmetadatasize [+]Size[m|UNIT] LV1

[ COMMON_OPTIONS ]

[ PV ... ] LV1 types: thinpool

—

Common options for command:

[ -A|--autobackup y|n ]

[ -f|--force ... ]

[ -n|--nofsck ]

[ -i|--stripes Number ]

[ -I|--stripesize Size[k|UNIT] ]

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

[ --nosync ]

[ --noudevsync ]

[ --reportformat basic|json|json_std ]

[ --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|cache|cache-pool|writecache ]

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

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

-l|--extents [+|-]Number[PERCENT]

Specifies the new size of the LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix %FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORIGIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the new LV is not determined until the command has completed. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-f|--force ...

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

--fs String

Control file system resizing when resizing an LV. checksize: Check the fs size and reduce the LV if the fs is not using the reduced space (fs reduce is not needed.) If the reduced space is used by the fs, then do not resize the fs or LV, and return an error. (checksize only applies when reducing, and does nothing for extend.) resize: Resize the fs by calling the fs-specific resize command. This may also include mounting, unmounting, or running fsck. See --fsmode to control mounting behavior, and --nofsck to disable fsck. resize_fsadm: Use the old method of calling fsadm to handle the fs (deprecated.) Warning: this option does not prevent lvreduce from destroying file systems that are unmounted (or mounted if prompts are skipped.) ignore: Resize the LV without checking for or handling a file system. Warning: using ignore when reducing the LV size may destroy the file system. Note: If resizing an LV without a file system and the new LV size matches the existing size, the command returns a non-zero status code (failure). However, if a file system resize is also requested along with the LV resize, and the sizes already match, the command returns a zero status code (success). This occurs because the external commands called to resize the file system return success even if the new and old file system sizes are identical. LVM follows the command status code behavior in this scenario.

--fsmode String

Control file system mounting behavior for fs resize. manage: Mount or unmount the fs as needed to resize the fs, and attempt to restore the original mount state at the end. nochange: Do not mount or unmount the fs. If mounting or unmounting is required to resize the fs, then do not resize the fs or the LV and fail the command. offline: Unmount the fs if it is mounted, and resize the fs while it is unmounted. If mounting is required to resize the fs, then do not resize the fs or the LV and fail the command.

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

-n|--nofsck

Do not perform fsck when resizing the file system with --resizefs.

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

--nosync

Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the initial synchronization. In case of mirror, raid1 and raid10, any data written afterwards will be mirrored, but the original contents will not be copied. In case of raid4 and raid5, no parity blocks will be written, though any data written afterwards will cause parity blocks to be stored. This is useful for skipping a potentially long and resource intensive initial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV. This option is not valid for raid6, because raid6 relies on proper parity (P and Q Syndromes) being created during initial synchronization in order to reconstruct proper user data in case of device failures. raid0 and raid0_meta do not provide any data copies or parity support and thus do not support initial synchronization.

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

--poolmetadatasize [+]Size[m|UNIT]

Specifies the new size of the pool metadata LV. The plus prefix + can be used, in which case the value is added to the current size.

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

-r|--resizefs

Resize the fs using the fs-specific resize command. May include mounting, unmounting, or running fsck. See --fsmode to control mounting behavior, and --nofsck to disable fsck. See --fs for more options (--resizefs is equivalent to --fs resize.)

-L|--size [+|-]Size[m|UNIT]

Specifies the new size of the LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID levels. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-i|--stripes Number

Specifies the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV is spread across multiple devices in units of the stripe size (see --stripesize). This does not change existing allocated space, but only applies to space being allocated by the command. When creating a RAID 4/5/6 LV, this number does not include the extra devices that are required for parity. The largest number depends on the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified, the default depends on the RAID type (raid0: 2, raid10: 2, raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs by default, see lvm.conf(5) allocation/raid_stripe_all_devices.

-I|--stripesize Size[k|UNIT]

The amount of data that is written to one device before moving to the next in a striped LV.

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

--type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|cache|cache-pool|writecache

The LV type, also known as "segment type" or "segtype". See usage descriptions for the specific ways to use these types. For more information about redundancy and performance (raid<N>, mirror, striped, linear) see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see usage definitions. For VDO (vdo) see lvmvdo(7). Several commands omit an explicit type option because the type is inferred from other options or shortcuts (e.g. --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache, --vdo). Use inferred types with care because it can lead to unexpected results.

-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
LV

Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV1 indicates the LV must have a specific type, where the accepted LV types are listed. (raid represents raid<N> type).

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
Extend an LV by 16MB using specific physical extents.

lvresize -L+16M vg1/lv1 /dev/sda:0-1 /dev/sdb:0-1

Resize an LV to use 50% of the size volume group.

lvresize -l50%VG vg1/lv1

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


lvs

title: lvs(8)

text:
# lvs(8)

## NAME
lvs — Display information about logical volumes

## SYNOPSIS
lvs

[ option_args ]

[ position_args ]

## DESCRIPTION
lvs produces formatted output about LVs.

## USAGE
lvs

[ -a|--all ]

[ -H|--history ]

[ -o|--options String ]

[ -O|--sort String ]

[ -S|--select String ]

[ --aligned ]

[ --binary ]

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

[ --foreign ]

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

[ --ignorelockingfailure ]

[ --logonly ]

[ --nameprefixes ]

[ --noheadings ]

[ --nosuffix ]

[ --readonly ]

[ --reportformat basic|json|json_std ]

[ --rows ]

[ --segments ]

[ --separator String ]

[ --shared ]

[ --unbuffered ]

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

[ --unquoted ]

[ COMMON_OPTIONS ]

[ VG|LV|Tag ... ]

—

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
--aligned

Use with --separator to align the output columns.

-a|--all

Show information about internal LVs. These are components of normal LVs, such as mirrors, which are not independently accessible, e.g. not mountable.

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

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

-H|--history

Include historical LVs in the output. (This has no effect unless LVs were removed while lvm.conf(5) metadata/record_lvs_history was enabled.

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

--segments

Use default columns that emphasize segment 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.

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

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

LV

Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

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.

## NOTES
The lv_attr bits are:

1

Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin, (O)rigin with merging snapshot, inte(g)rity, (r)aid, (R)aid without initial sync, (s)napshot, merging (S)napshot, (p)vmove, (v)irtual, mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device, under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, v(d)o pool, v(D)o pool data, raid or pool m(e)tadata or pool metadata spare.

2

Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only volume

3

Allocation policy: (a)nywhere, (c)ontiguous, (i)nherited, c(l)ing, (n)ormal This is capitalised if the volume is currently locked against allocation changes, for example during pvmove(8).

4

fixed (m)inor

5

State: (a)ctive, (h)istorical, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, snapshot (m)erge failed, suspended snapshot (M)erge failed, mapped (d)evice present without tables, mapped device present with (i)nactive table, thin-pool (c)heck needed, suspended thin-pool (C)heck needed, (X) unknown

6

device (o)pen, (X) unknown

7

Target type: (C)ache, (m)irror, (r)aid, (s)napshot, (t)hin, (u)nknown, (v)irtual. This groups logical volumes related to the same kernel target together. So, for example, mirror images, mirror logs as well as mirrors themselves appear as (m) if they use the original device-mapper mirror kernel driver; whereas the raid equivalents using the md raid kernel driver all appear as (r). Snapshots using the original device-mapper driver appear as (s); whereas snapshots of thin volumes using the new thin provisioning driver appear as (t).

8

Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.

9

Volume Health, where there are currently three groups of attributes identified:

Common ones for all Logical Volumes: (p)artial, (X) unknown.

(p)artial signifies that one or more of the Physical Volumes this Logical Volume uses is missing from the system. (X) unknown signifies the status is unknown.

Related to RAID Logical Volumes: (r)efresh needed, (m)ismatches exist, (w)ritemostly.

(r)efresh signifies that one or more of the Physical Volumes this RAID Logical Volume uses had suffered a write error. The write error could be due to a temporary failure of that Physical Volume or an indication that it is failing. The device should be refreshed or replaced. (m)ismatches signifies that the RAID logical volume has portions of the array that are not coherent. Inconsistencies are detected by initiating a "check" on a RAID logical volume. (The scrubbing operations, "check" and "repair", can be performed on a RAID logical volume via the 'lvchange' command.) (w)ritemostly signifies the devices in a RAID 1 logical volume that have been marked write-mostly. Re(s)haping signifies a RAID Logical Volume is either undergoing a stripe addition/removal, a stripe size or RAID algorithm change. (R)emove after reshape signifies freed striped raid images to be removed.

Related to Thin pool Logical Volumes: (F)ailed, out of (D)ata space, (M)etadata read only.

(F)ailed is set if thin pool encounters serious failures and hence no further I/O is permitted at all. The out of (D)ata space is set if thin pool has run out of data space. (M)etadata read only signifies that thin pool encounters certain types of failures but it's still possible to do reads at least, but no metadata changes are allowed.

Related to Thin Logical Volumes: (F)ailed.

(F)ailed is set when related thin pool enters Failed state and no further I/O is permitted at all.

Related to writecache logical volumes: (E)rror.

(E)rror is set dm-writecache reports an error.

10

s(k)ip activation: this volume is flagged to be skipped during activation.

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


lvscan

title: lvscan(8)

text:
# lvscan(8)

## NAME
lvscan — List all logical volumes in all volume groups

## SYNOPSIS
lvscan

[ option_args ]

## DESCRIPTION
lvscan scans all VGs or all supported LVM block devices in the system for LVs. The output consists of one line for each LV indicating whether or not it is active, a snapshot or origin, the size of the device and its allocation policy. Use lvs(8) or lvdisplay(8) to obtain more comprehensive information about LVs.

## USAGE
lvscan

[ -a|--all ]

[ --ignorelockingfailure ]

[ --readonly ]

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

Show information about internal LVs. These are components of normal LVs, such as mirrors, which are not independently accessible, e.g. not mountable.

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

--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
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)