Audit LVM Metadata with lvm fullreport
lvm fullreport pulls every physical volume, volume group and logical volume into one report before you change anything. Use it for an inventory, a support bundle, or a pre-flight check before storage work. It only reads metadata: it never creates, resizes, moves or removes an LVM object.
The route
Jump straight to the step you need, or tick off Done means at the end.
- Time: about 10 minutes for a first look, longer if you are feeding the output into a script.
- Versions used here: lvm2 2.03.16(2), dated 18 May 2022.
- Privileges: run the inspection commands as an ordinary user first, and only add elevated privileges when your host's device permissions demand it.
1. Check the command and the host
Confirm the tool is installed and see which version supplies the local behaviour:
command -v lvm
lvm version
The second line should name your LVM version; on the reference machine for this guide it is 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.
Then 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 every visible volume group on the host and gathers the associated PV, LV and segment information:
lvm fullreport
The default output is human-readable columns. If your account cannot read the devices or the LVM locks, retry with the privilege you normally use for local storage administration:
sudo lvm fullreport
Do not add --nolocking to silence a locking failure. The command is read-only in the ordinary sense, but it still examines live storage metadata, and the manual warns that concurrent commands can then produce incorrect results. Fix 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 actually exist on your host. Verify the names first with:
sudo vgs
A missing or inaccessible VG can make the result incomplete. Only reach for --foreign and --shared when you understand the system's ownership and locking arrangement; they change which groups are considered for reporting, and they are not 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 actually succeeded, not just that a file appeared:
test "$?" -eq 0
jq empty lvm-fullreport.json
The shell redirection creates or replaces the destination file before the command even runs, so choose a new path, or move an existing report aside first, if the old one matters. If the command fails, do not treat a partially written file as an inventory.
JSON does not guarantee every value is present. LVM can produce an empty report when no visible VGs exist, and an error inside the report or on standard error still needs investigating. Keep both the exit status and standard error in your collection process.
4. Choose fields and filters
Ask the installed tool for the field names rather than guessing them:
lvm fullreport --options help
Then request a small, stable set of columns as a comma-separated ordered list. This example asks for names and sizes where those fields apply:
sudo lvm fullreport --options vg_name,lv_name,pv_name,size
- A field may only suit some rows. Fullreport contains several report types, so use
--options helpand the report documentation installed with LVM to pick fields that match the object you are examining. - Add or remove from the defaults with a prefix. Repeat the option with a leading
+or-, such as--options +uuidor--options -attr.
Check selection syntax before using it:
lvm fullreport --select help
A selection expression limits which objects appear in the output. Once you have confirmed that vg_name is selectable on this installation, a report for one group looks like this:
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, drop it and go back to the unfiltered report: that gives you a known baseline for telling a bad filter apart from genuinely missing metadata.
5. Make text output easier to process
Basic output is meant for people, but these options help when another command has to consume it:
sudo lvm fullreport --noheadings --separator '|' --units b --nosuffix
--noheadings removes the heading row, --separator inserts your chosen separator between columns, and --nosuffix drops size suffixes when paired 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.
There is a subtle distinction in output units: 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 without talking to the device-mapper kernel driver. That makes it useful for peeking at metadata belonging to a virtual machine image while that machine is still running. It also means the report cannot tell you whether an LV is currently in use, so treat it as a metadata view, not proof that activation or I/O is safe.
Tip
Do not confuse --readonly with --test. Fullreport is a reporting command; --test is a common LVM option meant 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
- Confirm the binary and version. Run
lvm fullreport --helpandlvm version. - Compare visible groups against what you expect. Run
sudo vgsand check the list. - Check for device restrictions.
--devicesdeliberately hides devices not listed, and--devicesfileselects a managed file under/etc/lvm/devices/. - For clustered or multi-host storage, check the locking and ownership model before reaching for
--foreign,--shared, or any locking override. - Repeat the unfiltered report and capture both output streams. A successful shell pipeline can otherwise hide the reporting command's own exit status.
There is no undo here, because fullreport never changes LVM metadata. If you redirected output to the wrong file, remove or restore that report through your normal file backup process; the LVM objects themselves were never touched.
Done means
- Confirmed the installed lvm2 version on the host.
- Produced an unfiltered report covering the visible VGs you intended.
- Chose basic output for inspection or JSON for automation.
- Verified any selected fields and filters against the local help text.
- Kept device visibility, locking, foreign groups and read-only mode as separate concerns.