Home / Alt manpages / lvm-fullreport(8)

  • lvm-fullreport(8)
  • Admin command
  • linux

Audit LVM Metadata Consistently with lvm fullreport

You will use lvm fullreport to inspect physical volumes (PVs), volume groups (VGs), logical volumes (LVs), and their segments in a single reporting operation. This is useful for an inventory, a support bundle, or a check before storage work. The command reports metadata; it does not create, resize, move, or remove an LVM object.

Allow about 10 minutes for a first check and a little longer if you need to turn the report into a script input. These examples target the installed lvm2 2.03.16(2) tools, dated 18 May 2022. Run inspection commands as an ordinary user first. Use elevated privileges only when your host's device permissions require them.

1. Check the command and the host

Confirm that the command is installed and see the version that supplies the local behaviour:

command -v lvm
lvm version

The second command should identify the LVM version. On the reference machine for this guide it reports 2.03.16(2). A warning about the device-mapper driver or access to /dev/mapper/control is an environment problem, not a new fullreport option.

Now read the command's own usage text:

lvm fullreport --help

Checkpoint: you should see the fullreport subcommand and options including --options, --select, --sort, --readonly, and --reportformat basic|json.

2. Produce the complete basic report

With no VG argument, the command reports the visible volume groups on the host and gathers the associated PV, LV, and segment information:

lvm fullreport

The default output is a set of human-readable columns. If your account cannot read the devices or LVM locks, retry with the privilege normally used for local storage administration:

sudo lvm fullreport

This command is read-only in the ordinary sense, but it still examines live storage metadata. Do not add --nolocking merely to silence a locking failure. The manual warns that concurrent commands can then produce incorrect results. Correct the permission, device visibility, or locking issue instead.

To limit the report to named volume groups, put them after the options:

sudo lvm fullreport vg_data vg_archive

Replace those names with VGs that exist on your host. Verify the names first with:

sudo vgs

A missing or inaccessible VG can make the result incomplete. If the host intentionally contains foreign or shared groups, --foreign and --shared change which groups are considered for reporting. Use them when you understand the system ownership and locking arrangement, not as a general recovery switch.

3. Request machine-readable JSON

For a script or an archive, ask for JSON explicitly:

sudo lvm fullreport --reportformat json > lvm-fullreport.json

Check that the file is valid JSON and that the command succeeded:

test "$?" -eq 0
jq empty lvm-fullreport.json

The shell redirection creates or replaces the destination file before the command runs. Choose a new path, or move an existing report out of the way first, if preserving the old report matters. If the command fails, do not treat a partially written file as an inventory.

JSON does not guarantee that every value is available. LVM may show an empty report when no visible VGs exist, and an error inside the report or on standard error still needs investigation. Keep the exit status and standard error in your collection process.

4. Choose fields and filters

Start by asking the installed tool for the field names rather than guessing them:

lvm fullreport --options help

Then request a small, stable set of columns. The option takes a comma-separated ordered list. For example, this asks for names and sizes where those fields are available:

sudo lvm fullreport --options vg_name,lv_name,pv_name,size

Because fullreport contains several report types, a field may only apply to some rows. Use --options help and the report documentation installed with LVM to choose fields suited to the object you are examining. To add to or remove from the defaults, repeat the option with a leading + or -, such as --options +uuid or --options -attr.

Use selection only after checking its syntax:

lvm fullreport --select help

A selection expression limits objects in reporting output. For example, after confirming that vg_name is a selectable field on this installation, a report for one group can be written as:

sudo lvm fullreport --select 'vg_name = vg_data' --reportformat json

Quote the expression so the shell does not reinterpret spaces or operators. If the expression is rejected, remove it and return to the unfiltered report. That gives you a known baseline for distinguishing a bad filter from missing metadata.

5. Make text output easier to process

Basic output is intended for people, but these options help when another command must consume it:

sudo lvm fullreport --noheadings --separator '|' --units b --nosuffix

--noheadings removes the heading row. --separator inserts the separator between columns, and --nosuffix removes size suffixes when used with an explicit unit such as --units b. Do not split this output on whitespace: names and empty fields make that fragile. JSON is usually the better interface for new automation.

Output units have a subtle distinction. Lower-case units use powers of 1024 for displayed sizes, while upper-case units use SI multiples of 1000. Input size notation and output unit notation do not follow exactly the same rule, so keep the command line explicit in scripts.

6. Use read-only metadata access deliberately

--readonly is a special inspection mode:

sudo lvm fullreport --readonly --reportformat json

It reads on-disk metadata without needing ordinary locks and does not communicate with the device-mapper kernel driver. This makes it useful for peeking into metadata associated with a virtual machine image while that machine is running. It also means the report cannot tell you whether an LV is currently in use. Treat it as a metadata view, not proof that activation or I/O is safe.

Do not confuse --readonly with --test. Fullreport itself is a reporting command, while --test is a common LVM option intended to suppress metadata updates during commands that might otherwise write. Neither option repairs damaged metadata or makes an unsafe storage operation safe.

7. Diagnose an empty or incomplete report

  1. Run lvm fullreport --help and lvm version to confirm the binary and version.
  2. Run sudo vgs and compare the visible VGs with the groups you expect.
  3. Check whether device restrictions are active. --devices deliberately hides devices not listed, and --devicesfile selects a managed file under /etc/lvm/devices/.
  4. For clustered or multi-host storage, check the locking and ownership model before using --foreign, --shared, or any locking override.
  5. Repeat the unfiltered report and capture both output streams. A successful shell pipeline can otherwise hide the reporting command's exit status.

There is no undo operation because fullreport does not change LVM metadata. If you redirected output to the wrong file, remove or restore that report using your normal file backup process; the LVM objects themselves are unaffected.

Done means

  • You confirmed the installed lvm2 version.
  • You produced an unfiltered report for the intended visible VGs.
  • You chose basic output for inspection or JSON for automation.
  • You verified any selected fields and filters with the local help text.
  • You treated device visibility, locking, foreign groups, and read-only mode as separate concerns.