1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-04 05:44:18 +03:00

Compare commits

..

117 Commits

Author SHA1 Message Date
Marian Csontos
8817523c56 pre-release 2.03.32 2025-05-05 17:02:06 +02:00
Marian Csontos
338bb7e68b WHATS_NEW: update 2025-04-29 15:02:04 +02:00
Zdenek Kabelac
8acb84f5bd tests: check for resulting size
Add some extra validation check for size and slabsize.
2025-04-28 14:19:18 +02:00
Zdenek Kabelac
480bf01936 make: generate 2025-04-28 14:19:18 +02:00
Zdenek Kabelac
c1bfc8737f man: updates and typography
Manually enhance pages for thin, cache, raid, vdo.

Replace usage of .HP with .TP when it makes sense (but keep .HP
where so far we don't have replacement giving same visual results).

Use .CMS, .CME  macros in dmsetup/dmstats so it easy to switch
But keep using .HP when the rendering looks simply better in terminal
although HTML output does not looks that well - so we may eventually
switch here to .TP.

For basic command synopsis use .NSY macro that will
use .SY for graphical rendering (postscript/pdf) but keep
using .TP for ASCII terminal output, as here many HTML renderers
are emitting unreadable pages.

For options use '\ ' (non-breakable space) between option and
its argument and option are not across line.

Reformat lines to fit in 80 columns.

Use  .EX .. .EE  for example output - this improves
character alignment for poststrict/pdf rendering as
it use monospace fonts (unlike .nf .. .fi).
Also with Example section never let the line being with space
and use '\' for such line.
If the Example line should being with '.' it needs to be
prefix with \&.
Add .nf/.fi macros for cases where .EX & .EE are undefined
(this happens i.e. with man2html)

Avoid use of tables (.TS .. .TE) as HTML renderers often use
images (.png) files for such tables and this does not scale well
when user changes font size in browser.
(and the large/long table were split into 2 pieces
so it does fit to 80 columns).

Use .MT .ME for emails.

Use .UR .UE. for URL.

Use  .\|.\|.\& as sequence of 3 dots and add \& to not create end of
sentence and possibly wrong alignment.

On lines starting with .BR & .IR avoid using \fB \fI as this
can cause problem when i.e. html rendered may keep use
italic bold when just italic was really wanted.

When using series of .TP/.IP - set the size only with the
first tag - and let renderer align others to match the column.

Correct some small typographical rendering issues.

Rendering was evaluated for readable results with:
- mandoc -T html  (-O style=mandoc.css)
- groff  -Thtml -mman
- man2html
- man -Thtml
- man -Tps
- man

Unfortunatelly various g/troff troubles are with each of them,
so we need to select usage of macros in a way, that is not mangling
results for above engines.
2025-04-28 14:19:18 +02:00
Zdenek Kabelac
fe14628818 man: generator update
Improve generated output for better compliance with '-T lint' checker
(mandoc -T lint and groff --mandoc).

Try to properly place .P sections and also correctly use .TP rendering
where we need to place '.na .ad'  after the first rendered keyword,
otherwise it has not the desired impact.

Also use  .nh .na ..  .ad .hy around whole command USAGE description
so we avoid unwanted alignment,spacing,hyphenation there.

Make sure we are emitting properly order paragraphs and avoid
i.e. submit of .br after .RS/.in  that has this implicit

Also more frequently emit '\n' so there are not too long lines as
rendering engine will format line breaking according to its rules.

To keep generated page better controllable emit more empty line
and use such lines for every .SH, .TP.

Use 'short_ops' loop to avoid duplicating code.

Emit .\|.\|. for 3dot sequence for proper graphical rendering

Emit \\0\\0\\0 (3 white space of width of letter '0')
for better alignment of options with graphical rendering.

There is ATM prepare '#define TABBED' - enabling this make
initial option list nicely aligned in graphical rendering
and doesn't seem to have bad side effect on text rendering.

man: generator use macros for options

Predefine all options used by the command into list of '.de O_name'
macros that are pregenerated in the front of man page.
(interestingly usage of groff strings (.ds) seems to have some
non-trivial issues across rendering engines)

This allows to use '\t' without producing warnings with
'mandoc -T lint' - as normally tabs are allowed only within
'.nf ... .fi' section, but than there is not working line-breaking.

While we could use purely 'tab' base version, for some 'html' (ascii)
redering its producing not so well indented option list.
For this reason use tabs only with graphical renderers .ie  t / .el
and use only spaces for ascii rendering.

Ensure the ...   (3dots continuation is properly renderer with
a single space after repeatable option/argument and not adding extra
space before i.e. closing bracket.

Using .ta for graphical rendering - allows to keep option aligned
with proportional font.
2025-04-28 14:19:15 +02:00
Zdenek Kabelac
df45871754 man: minor refactor
Minor updates to generator code.
2025-04-28 14:18:45 +02:00
David Teigland
9b985f3519 libdaemon: change connect error to log_debug
The message is unnecessary noise since callers print a
more user friendly message.
2025-04-22 16:18:51 -05:00
David Teigland
dcfa77c345 lvmdevices: skip lvmlockd connection
the command doesn't use locks from lvmlockd
2025-04-22 16:12:18 -05:00
Zdenek Kabelac
11b64b0c0c lvmcmdline: still support use of profile
Couple commands (lvcreate,lvconvert,vgcreate,lvchange,vgchange)
has the 'specific' property that within them the option --profile
behaves like --metadataprofile, while for all other commands this
option should be simply an alias for --commandprofile.

We may eventually drop this rather confusing behavior in the future
version and there will be only one use as --[command]profile

It should be noted this --commandprofile can be often used
instead of --config option for preconfiguring setting
for some group of commands - we should possibly more propagate
this usage.
2025-04-04 14:48:57 +02:00
Zdenek Kabelac
6838881956 libdm: fix missed init of regex pointer
Recent patch set for select enhancement missed to initialize
ssl struct element regex to NULL and this code might have
crashed on this code path evaluation.
2025-04-04 14:48:57 +02:00
Zdenek Kabelac
5d16beee57 WHATS_NEW: update 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
26e86f9da9 make: generate 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
b8b0fcfa10 cov: remove unused header 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
6679438437 tests: check resize of snapshot with mounted origin 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
1bf3961bbe tests: resize of mounted fs missed workaround
For older kernel, we need to suspend/resume.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
dcf37af2ca tests: preserve signess 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
ebbdaccd9c tests: check unsupported vdo conversions
Validate unsupported vdo conversions are rejected.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
fafc0f76c5 tests: remove testing of old mirror with vdo
Actually mirror were never supposed to be usable with any newer
target as they are very problematic with any stacked usage.
So now it's going to be properly checked and prohibited.

Users are always supposed to use 'raid1' --type instead.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
491c6652ae command: use loop for short_opts pass
Slight refactoring of the code to take less size
as the code is used rather occasionally.

Correct some minor typographical issue.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
ea73594f07 man-generator: print LV1 also for options
We can print list of supported LV types for
options like --cachepool,--thinpool,--vdopool when
they are specifying particular LV.

TODO: while we nicely document them, the parser engine ATM
is not capable to validate and enforce these properties,
so the code needs to match them on its own.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
9ed7528d1f man-generator: add check for option overlap
Report --check error, when the option is required and optional
for the command.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
7becd29494 lvconvert: fix _lvconvert_visible_check ret code
_lvconvert_visible_check() used to validate visibility
of converted LV for changing mirrorlog, regionsize
and merging images.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
3687f7fee3 lvconvert: validate converted LV to vdopool
Although our command-line description file describes
supported types for conversion with some rules,
these are technically not yet fully implemented in
the code, thus we need explicit functionality to
validate passed LVs for conversion.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
74c178f7bf lvconvert: fix move is positional args
Properly shift args by 1 - hopefully 'argv[]' has the right size
to fit this single shift (as some option must have been there...)
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
82789f6134 lvconvert: simplify passing LV for conversion
Since command is defined to not taky any'free args',
we can actully avoid playing with positional args here
and just pass argv with a single arg.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
30fdd6b9b4 args: update name of kernel module
Use  '_' for kernel module name.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
63088e1f82 command-lines.in: matching vdopool conversion
Just use options in the same order as with --type vdo-pool
conversion.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
579054452b command-lines.in update some description
Add some explicit warning for commands that are destroying content
of converted volume.

Add thinpooldata to the list of allow LVs for caching
(as the code already support this).
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
253ef42362 command-lines.in: add info about implicity type
Short description about how the default implied type
is selected for this lvcreate command.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
54831ecabd command: update parameter from description
Parameter --profile is already 'generic' parameter,
so it's been listed twice in lvchange & vgchange.

Parameter --uuid was listed 2x in pvchange.
2025-04-01 15:37:36 +02:00
Zdenek Kabelac
a4951801fa tools: add suppport to recognize thinpooldata 2025-04-01 15:37:36 +02:00
Zdenek Kabelac
d0c9bcf6d7 validation: add check for single vdo segments
Add check for VDO LV and VDOPOOL LV having just
a single segment in LV.
Also add couple missing '.'  in error messages.
2025-04-01 15:37:36 +02:00
David Disseldorp
43a755d568 device-types: support zram
See Linux source Documentation/admin-guide/blockdev/zram.rst .
zram devices offer a good performance and efficient resource utilization
through the use of compression.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2025-04-01 15:37:36 +02:00
Bryn M. Reeves
12419e3b67 snapshot: fix lvresize when greater than max COW size
If lvresize is given a size > the maximum COW size for a given origin
the command will fail with an internal error and no error message:

  # lvresize --size 1.6g fedora/snaptest-snap
    Rounding size to boundary between physical extents: <1.59 GiB.
    Reached maximum COW size <1.01 GiB (258 extents).
    Command failed with status code 5.

  With -vvv:

  Found snapshot target v1.16.0.
  Getting target version for snapshot-origin
  dm versions   [ opencount flush ]   [2048] (*1)
  Found snapshot-origin target v1.9.0.
  Reached maximum COW size <1.01 GiB (258 extents). <<<
  Unlock: Memlock counters: prioritized:0 locked:0 critical:0 daemon:0 suspended:0
  Syncing device names
  Unlocking /run/lock/lvm/V_fedora
  _undo_flock /run/lock/lvm/V_fedora
  Freeing VG fedora at 0x55781b142890.
  Freeing VG fedora at 0x55781b136860.
  global/notify_dbus not found in config: defaulting to 1
  Destroy lvmcache content
  Completed: lvresize -vvv --debug --size 1706243072b fedora/snaptest-snap
  Internal error: Failed command did not use log_error

This happens because in this case _lvresize_adjust_extents() returns
early without setting lp->resize to either LV_EXTEND or LV_REDUCE after
capping lp->extents to the maximum COW size.

Fix this by just capping lp->extents and relying on the existing code in
_lvresize_adjust_extents() to fixup lp->resize in the case that
lp->extents == existing_logical_extents. This is consistent with the
no-op case where -l is given as the existing size:

root@localhost:~/src/git/lvm2# LD_LIBRARY_PATH="$PWD/tools" ./tools/lvm lvresize -L 1.6g fedora/snaptest-snap
  Rounding size to boundary between physical extents: 1.60 GiB.
  Reached maximum COW size <1.01 GiB (258 extents).
  New size (258 extents) matches existing size (258 extents).
  No size change.
2025-04-01 15:36:26 +02:00
Peter Rajnoha
0d17105292 libdm: report: select: remove fixme note from _create_field_selection
Let's keep the fail-safe check in for the case some combination (e.g.
after adding a new type) is not caught earlier in the _parse_selection.
2025-03-28 10:12:20 +01:00
Peter Rajnoha
1d94dd075d libdm: report: select: add support for string list regex selection
The c065b407cb77a7a14d7c7c3c94e09fcca2fcff09..872e085030ae8039f18908f6e45bad7ba99250a7
was for device_mapper/libdm-report.c. Do the same for libdm/libdm-report.c
2025-03-25 12:17:27 +01:00
Peter Rajnoha
872e085030 WHATS_NEW: update 2025-03-25 10:25:08 +01:00
Peter Rajnoha
959f775985 tests: select-report: cover string list regex selection 2025-03-25 10:25:08 +01:00
Peter Rajnoha
0c970d8ec7 man: lvmreport: update parts about string list selection 2025-03-25 10:25:08 +01:00
Peter Rajnoha
8d41afbc1f libdm: report: select: support string list selection based on a regex
Wire the field<-->selection comparison logic for regexes used for
string lists.
2025-03-25 10:25:08 +01:00
Peter Rajnoha
b4ebf69739 libdm: report: select: support parsing regex for a string list
Recognize regex in string list selection criterion, including grouping
items by using {} and [] together with && (or ",") and || (or "#")
logical operators:
  - [ <regex> && <regex> ... ]
  - [ <regex> || <regex> ... ]
  - { <regex> && <regex> ... ]
  - { <regex> || <regex> ... ]

Also recognize simple "<regex>" (without any grouping operators)
as a shortcut for "{ <regex> }".
2025-03-25 10:25:08 +01:00
Peter Rajnoha
8c696e463f libdm: report: select: lower initial size for selection mempool
The selection doesn't use that much memory, adjust the size accordingly.
2025-03-25 10:25:08 +01:00
Peter Rajnoha
91c29c318f libdm: report: selection: use separate regex mempool
Regex remembers the mempool it was given during dm_regex_create and
then it uses it for further allocation during dm_regex_match. This
could be dangerous in case we used the same mempool for any other
allocations/frees in between dm_regex_create and dm_regex_match calls
in the outer code. This patch adds separate regex mempool for the
report/select to avoid the possible issues.
2025-03-25 10:25:07 +01:00
Peter Rajnoha
d556d77363 libdm: report: select: default to subset if no grouping operator used
Previous patch made a proper difference between [...||...] and
[...&&...]. If the criterion for a string list does not use any [] or
{}, we need to make sure that proper matching function is called -
in this case not using {} or [] is the same as if {} was used
(matching subset).
2025-03-25 10:25:07 +01:00
Peter Rajnoha
649d17d221 tests: select-report: adjust test for matching [...||...] in string lists 2025-03-25 10:25:07 +01:00
Peter Rajnoha
b4a9897bd8 libdm: report: select: fix string list match for [...||...] selection
Matching a string list criterion which had [... || ... ] was not
correctly implemented - it was the same as [ ... && ... ]. This patch
makes a difference between the two:
  - [ ... || ... ] matches if all items from string list value are
    matched by ANY item from selection string list (that is, not
    all the selection string list items need to match)

  - [ ... && ... ] matches if all items from string list value are
    matched by an item from selection string list 1:1 (that is,
    all the selection string list items need to match)
2025-03-25 10:25:07 +01:00
Peter Rajnoha
523d796b15 libdm: report: select: remove superfluous struct reserved_value_wrapper param
Remove superfluous struct reserved_value_wrapper param for
_tok_value_regex function. The only thing that _tok_value did was
zeroing the reserve field within the struct. But this one is already
zero-initialied in outer _parse_selection function.
2025-03-25 10:25:07 +01:00
Peter Rajnoha
d9832565ec libdm: report: select: make internal errors related to incorrect field types clearer 2025-03-25 10:25:07 +01:00
Peter Rajnoha
6565ce22b7 libdm: report: select: also log function name for internal errors 2025-03-25 10:25:07 +01:00
Peter Rajnoha
53ccbdab1b libdm: report: select: add/edit comments for parser 2025-03-25 10:25:06 +01:00
Peter Rajnoha
c065b407cb libdm: report: select: move regex handling under common value token parsing
This is a cleanup and a preparation for adding support for regex matching
in string lists in subsequent patches.
2025-03-24 14:39:11 +01:00
David Teigland
22b628924f tests: fix metadata-old with lvmlockd_test 2025-03-17 11:49:54 -05:00
Zdenek Kabelac
06baec439e make: generate 2025-03-17 13:52:03 +01:00
Zdenek Kabelac
92493361f3 WHATS_NEW: updates 2025-03-17 13:51:24 +01:00
Zdenek Kabelac
5efa388206 man: indent with command
Avoid spaces showing as the 1st. character on the man page line.
Also start with actual text and move .IP sequence to the line end.
2025-03-17 13:51:24 +01:00
Zdenek Kabelac
fe1cf7174f makefile: rebuild man when see_also changes
Missed rebuild dependency, when see_also file changes.
2025-03-17 13:48:58 +01:00
Zdenek Kabelac
6e5e7b3193 makefile: cleanup tab 2025-03-17 13:48:58 +01:00
Zdenek Kabelac
a6264f6a44 tests: don't restart lvmdbusd
Since lvmdbusd execution of lvm2 command was fixed
stop retrying to restart lvmdbuds and abort testig
when it fails.
2025-03-17 13:48:58 +01:00
Zdenek Kabelac
b2f8e744de lvm: option description only for man generator
There is no need to include option description text
within command binary itself.

It's only used only for man generating.
2025-03-17 13:48:58 +01:00
Zdenek Kabelac
01e4764c40 man: fixes in argument description
Describe missed --segments opt for lvdisplay (matches lvs).

Describe lvm-fullreport --all option - show text for lvs,vgs,pvs.

Missed '.' for --separator.
2025-03-17 13:48:58 +01:00
Zdenek Kabelac
c9ee8d8a06 lvmdbusd: ensure readout on exit 2025-03-17 13:48:58 +01:00
Zdenek Kabelac
154befd4b8 cache: ensure UUID ends with \0
Initialization of union is somewhat tricky as it initialize only
the first member + padding, but in our case this does not clear
the whole size of union so explicitly set \0 after 2 'struct id'
and make sure DM uuid is not using random characters from stack.

Also add explicit .id designators (c99).
2025-03-17 13:48:58 +01:00
David Teigland
951fd6358b metadata: replace pv status WRONG_VG with pv bit field
Avoid any special meaning associated with the status field.
2025-03-06 10:52:50 -06:00
David Teigland
8efbffe086 lvmcache: unpair wrong PV devs and improve duplicate name warnings
After detecting that a VG has wrongly claimed a PV, unpair
the pv->dev setting.  This will cause the usual "missing PV"
message to appear for that VG.  Make this message, and some
others, clearer by using the VGID rather than the VG name
when there are multiple VGs with the same name.
2025-03-06 10:02:29 -06:00
David Teigland
cff93e4d5c lvmcache: fix check for no pvid 2025-03-05 16:03:42 -06:00
David Teigland
227d3ca507 lvmcache: add WRONG_VG PV status flag
_vg_read() calls lvmcache_update_vg_from_read() which detects
that the VG metadata is incorrectly claiming the PV.  Flag this
condition in the PV status as WRONG_VG.  Later, vg_read() can
simply check the WRONG_VG flag rather than repeating the same
PV/VG checks that were already done in lvmcache_update_vg_from_read.
2025-03-05 14:28:42 -06:00
David Teigland
cc843151b4 lvmcache: ignore incorrect PV claim from old metadata
Outdated VG metadata that appears when an old device is attached
to the system can result in PVs appearing to belong to the
old/wrong VG, and commands are allowed to use (corrupt) the PVs.

- vgcreate old /dev/sda /dev/sdb /dev/sdc
- offline /dev/sda
- vgreduce --removemissing old
- vgremove old
- vgcreate new /dev/sdb /dev/sdc
- online /dev/sda

When sda is reattached, sdb and sdc will appear to be
in VG old again.  An attempt to correct the problem,
e.g. with vgremove old or vgreduce old, would modify
sdb and sdc, removing them from the new VG.

To fix this, check that sdb and sdc contain metadata for
VG old before allowing VG old to claim ownership of them.
With the fix, sdb and sdc are not displayed as part of
VG old, and commands to change VG old will fail as long
as it references incorrect PVs.

To fix VG old (sda), remove the incorrect PVs from VG old
while limiting the command to see only the correct PVs:
vgreduce --removemissing --devices /dev/sda old
2025-03-05 14:16:46 -06:00
David Teigland
7dd2f101c7 integrity: round meta size up to minimum one extent
If VG extents are larger than the required integrity metadata size,
use one extent as the size.
2025-03-03 11:31:40 -05:00
David Teigland
381b45b5a9 lvmlockd: add helpful error message for vgremove
Print a helpful error message when the lockspace is not started.
2025-03-03 11:05:04 -05:00
David Teigland
8273a6e2e1 pvresize: accept autobackup option 2025-02-27 10:05:27 -06:00
Marian Csontos
c59a8e2d56 doc: Update metadata on 2.03.31 release notes 2025-02-27 16:53:55 +01:00
Marian Csontos
a1e449dea2 post-release 2025-02-27 16:51:29 +01:00
Marian Csontos
3a6e221c56 pre-release 2.03.31 2025-02-27 16:51:29 +01:00
Marian Csontos
d80d346f4e doc: WHATS_NEW and release note update 2025-02-27 16:49:34 +01:00
Marian Csontos
54ade3a6bb doc: Apply markdown formatting 2025-02-27 16:12:52 +01:00
Eric Blake
1dcd9fbe08 misc: Typo fix s/loose/lose/
Signed-off-by: Eric Blake <eblake@redhat.com>
2025-02-26 10:32:19 +00:00
Eric Blake
a853649565 misc: Typo fix s/more then/more than/
Also a few instances of s/less then/less than/.

Signed-off-by: Eric Blake <eblake@redhat.com>
2025-02-26 10:32:19 +00:00
Zdenek Kabelac
a512bf3c62 WHATS_NEW: update 2025-02-26 01:35:12 +01:00
Zdenek Kabelac
9197880050 make: generate 2025-02-26 01:31:50 +01:00
Zdenek Kabelac
16bc80c389 test: check LVM_SUPPRESS_FD_WARNINGS
Add test for suppression messages about leaked descriptors.
2025-02-26 01:31:49 +01:00
Zdenek Kabelac
4fa6c76181 lvmlockd: drop return from void function 2025-02-26 01:31:49 +01:00
Zdenek Kabelac
b4c9f29eb3 man: update generator code
Generate pages more complaint with 'mandoc -T lint'
Remove some generated space on EOL.
Replace .ad l with .na  macro.
Remove some .br duplicates.
2025-02-26 01:30:31 +01:00
Zdenek Kabelac
8d855ff23a man: reformat args.h to fit in 80 lines
Compliance to mandoc -T lint to fit lines into 80 chars
in generated man pages.
2025-02-26 01:29:54 +01:00
Zdenek Kabelac
ba9c4368f4 man: updates
Updates for 'mandot -T lint'
Fit lines into 80 characters.
Use  .na .ad   instead of  .ad l  .ad b
Remove some misplaced  .P  & .br
Trim spaces for EOL.
2025-02-26 01:27:15 +01:00
Jack Wilsdon
1f728f370f libdaemon: fix suppressing stray fd warnings
Restore support for LVM_SUPPRESS_FD_WARNINGS as
this was seemingly lost with refactoring to
use daemon_close_stray_fds().
2025-02-26 01:21:19 +01:00
David Teigland
80ee9e45cb uncache and splitcache should restore inactive state
If an inactive LV is being cached in writeback mode, then
removing the cache does a temporary activation to flush
the cache back to the main LV.  However, it forgot to
deactivate the LV again, so the temporary activation
was left in place.
2025-02-25 15:48:28 -06:00
David Teigland
297808c269 lvmlockd: add debug line 2025-02-25 15:48:28 -06:00
David Teigland
dfb4ed13f6 lvmlockd: expand lockopt skip options
The lockopt options for skipping locks were not being used
in many places, making it impossible to override locking to
forcibly run some commands.
2025-02-25 12:40:36 -06:00
Zdenek Kabelac
be25429ea7 test: result is some for lvmpolld
Drop 'TEST WARNING' from this case - the code works the same
were for 'pvmove -b' polling as for lvmpolld.

Just keep there 'TODO' notice we want to eventually reduce amount
of 'worked' pvmove monitoring process - ATM there will be 1 per LV.
2025-02-25 01:10:04 +01:00
Salvatore Bonaccorso
36bdffb6a4 man: clarify --stripes number of device
The current manpage is unclear in the example of a raid10 type LV RAID
with --mirrors 1 --stripes 4. The number of devices in each raid1 mirror
is NumberStripes/(NumberMirrors+1). Thus the example should read:

e.g. mirrors 1 and stripes 4 will stripe data across two raid1
mirrors, where each mirror contains two devices.

Fixes: https://gitlab.com/lvmteam/lvm2/-/issues/26
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
2025-02-25 01:10:04 +01:00
Dion Bosschieter
6f9e247285 man: fix grammar in lvmlockd.8_main
Remove redundant 'the' in 'When the another VG'.

Signed-off-by: Dion Bosschieter <dionbosschieter@gmail.com>
2025-02-25 01:10:04 +01:00
Tyler Clark
be0b2ea01a man: removing duplicate words in man pages.
This patch removes some sequentially duplicated words in a few man pages.
2025-02-25 01:10:04 +01:00
Zdenek Kabelac
d5ac344465 clang: match prototype 2025-02-25 01:10:04 +01:00
Zdenek Kabelac
4789abbcd2 cov: some missed arg_is_set changes 2025-02-25 01:10:04 +01:00
Zdenek Kabelac
a29d0c014a lvconvert: validate mirror image counting
Since _failed_mirrors_count() may eventually return -1,
add extra validation before using returned count.
2025-02-25 01:10:04 +01:00
Zdenek Kabelac
7d0acdbcb0 thin: fix checking monitor mode
Previous commit 874a8ab4d0 missed 'IGNORE' mode.
Fix it by adding rather 'explicit' test for this value,
so the code is better readable.

Also unlock memory earlier and drop unneeded <backtrace>
from return since we already logged error in this function.
2025-02-25 01:09:49 +01:00
David Teigland
5430eec2b9 lvmlockd: fix missing lvremove free_lv
Fix missing lockd_free_lv in commit
e3f0af8f1f lvmlockd: fixes for lvremove
2025-02-24 16:36:01 -06:00
Zdenek Kabelac
d83f40d25a tests: reduce Exa test size
Since kernel patch 3d9a9e9a77c5ebecda43b514f2b9659644b904d0  (6.14)
it seem device size is no limitted to <8Exa bytes (so LLONG loff_t
works across whole device).

So reduce our tested size to 8191 Peta  ~ <8 Exa.
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
c40bd459df test: wait for polling finish
Increase the used mirror size for longer processing.

Add more -vvvv traces to pvmove to better chase test error.

Add extra code to wait for finish of polling pvmove after it's
been aborted - so it doesn't break 'next' test.
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
d016158ff9 WHATS_NEW: updates 2025-02-24 18:59:58 +01:00
Zdenek Kabelac
874a8ab4d0 cov: add value check 2025-02-24 18:59:58 +01:00
Zdenek Kabelac
0fe1613c9b cov: use arg_count for unchecked usage
Reserve usage of  'arg_is_set()' to tested use case and use
arg_count() for unchecked one.
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
56398a2180 cov: explicitly ignore value 2025-02-24 18:59:58 +01:00
Bjarni Ingi Gislason
bb458e9528 man: remarks and editorial changes for dmstats
Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.
Use "mandoc -T lint  dmstats.8"
Use "test-groff -mandoc -t -ww -z dmstats.8"

-.-.

Lines containing '\c' (' \c' does not make sense):

503:.B \-\-units \c

-.-

Change '-' (\-) to '\(en' (en-dash) for a (numeric) range.
GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.

dmstats.8:470:expressed as a hyphen separated range, for example: '1\-10'.

-.-.

Add a (no-break, "\ " or "\~") space between a number and a unit,
as these are not one entity.

1114:Create a 32M region 1G into device d0

-.-.

Add a "\&" after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

511:Can also specify custom units e.g. \fB\-\-units\ 3M\fP.

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

798:extents). This currently includes \fBxfs(5)\fP and \fBext4(5)\fP.
801:group, and the group alias is set to the \fBbasename(3)\fP of the

-.-.

Use thousand markers to make large numbers easy to read

560:is equivalent to 10000000. Latency values with a precision of less than

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

1:.TH DMSTATS 8 "Jun 23 2016" "Linux" "MAINTENANCE COMMANDS"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

.-.

Additionally:

  Fix some arguments for '.TP'.  A single-font macro does not work with
'\c', so use a two-font macro.

-.-

  Use the pair ".na / .ad" to set no-adjustment (same result as '.ad l')
and '.ad' to restore previous adjustment.
[Replacing ".ad l" ... ".ad b"]

  Set singular '.ad b' to '.ad \*(AD' as the user should have the choice to
control the adjustment from the command line.

  Add an empty string to string 'AD' with '.as AD "\"' to avoid a warning
about an undefined string.

-.-

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.

Updated-by: zkabelac@redhat.com
2025-02-24 18:59:58 +01:00
Bjarni Ingi Gislason
2fae69cc4b man: remarks and editorial changes for dmsetup
Checking for defects with a new version

Use test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"
Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.
Use "mandoc -T lint  dmsetup.8":
Use "test-groff -mandoc -t -ww -z dmsetup.8":

-.-.

Add a (no-break, "\ " or "\~") space between a number and a unit,
as these are not one entity.

-.-.

Use "\e" to print the escape character instead of "\\" (which gets
interpreted in copy mode).

487:with its hex value (two digits) prefixed by \\x.

-.-.

Strings longer than 3/4 of a standard line length (80)
Use "\:" to split the string at the end of an output line, for example a
long URL (web address)

1030 <name>,<uuid>,\:<minor>,<flags>,\:<table>\:[,<table>+]\:[;<name>,<uuid>,\:<minor>,<flags>,<table>\:[,<table>+]]

-.-.

Add a "\&" after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

581:Note: Same cookie should be used for same type of operations i.e. creation of
767:Attempts to remove all device definitions i.e. reset the driver.  This also runs
946:e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

-.-.

Use \(en (en-dash) for a dash at the beginning (en) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

1:.TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

Updated-by: <zkabelac@redhat.com>
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
0d4418fe6c polldaemon: handle sigint from nanosleep
Handle interruption caught in sleep between polling and
abort() tool execution in such case.
(Although ATM we are not normally signalling the tool this way).
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
bb66753a14 polldaemon: enhance error tracking
Improve error handling in polling functions where errors
were previously ignored. These errors result from serious
failures (e.g., allocation errors) and should lead to a full
command exit, as the tool cannot function in such a state.

FIXME:

However, there is a fundamental design issue worth considering:
when a command like pvmove --abort cancels an ongoing operation,
the existing polling command continues running and only terminates
once it detects that there is nothing left to poll.

Next issue is perment reopening of a VG when 'monitoring' progress.

And the last is big trouble with '--interval 0' which is able to
wait in DM ioctl() and hold the VG lock, and there is not good way
to about such operation (other then sending a signal to such process).
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
c1bc0c9726 lvmpolld: easier alloc code
Share _free_lvmpolld_lv() function.
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
685e704373 test: skip retry only for lvconvert
Mirror creation is creating log volumes and needs occasionally
retry loop for deactivation.
2025-02-24 18:59:58 +01:00
Zdenek Kabelac
4be1c7b6ca makefile: remove old lcov files
Remove any older lcov generated files ('*.gcda|gcno') then the currently
generated 'make.file' before creating a new lcov report.

Otherwise we may hit the problem of using some older generated files
possibly with different format.
2025-02-24 18:59:58 +01:00
Jianqi Zeng
36be0778f8 libdm: restore missing symbols
Restore missing symbols to the libdevmapper.so library.

These symbols:

dm_bitset_parse_list@@DM_1_02_138
and dm_tree_node_size_changed@Base

become 'lost' with commit: 40b277ae17
which supposedly cleaned local 'symbols' from visibility,
however these missing symbols were impproperly exported.

Signed-off-by: Jianqi Zeng <zengjianqi@kylinos.cn>
2025-02-24 18:59:58 +01:00
David Teigland
6ad474385b lvmlockd: recognize error ELMERR 2025-02-20 10:18:28 -06:00
David Teigland
b02e6cd4a9 lvmlockd: disallow shared activation of LV with cow snapshot
The check for disallowing shared activation was missing
a check for this type.
2025-02-19 16:19:42 -06:00
Zdenek Kabelac
bb0bbc6d74 test: repeatedly restart lvmdbusd
It looks like occasionally supports_json() in cmdhandler.py
for some reason does not find  'fullreport' in err output
of lvm help...  let's see more traces...
2025-02-19 00:36:46 +01:00
Zdenek Kabelac
8417a6a578 revert "test: aux gives more time for lvmdbusd start"
This reverts commit 8425c1b468.

Seems we have different problem with lvmdbusd test start.
2025-02-19 00:36:46 +01:00
Zdenek Kabelac
79c022133b test: improve holding device open
Use 'exec' to open device and then just pass descriptor to sleep.
2025-02-19 00:36:46 +01:00
164 changed files with 26554 additions and 15208 deletions

View File

@@ -172,7 +172,7 @@ help:
@echo " lcov-dated Generate lcov with timedate suffix."
@echo " lcov-reset Reset lcov counters"
@echo " man Build man pages."
@echo " print-VARIABLE Resolve make variable."
@echo " print-VARIABLE Resolve make variable."
@echo " rpm Build rpm."
@echo " run-unit-test Run unit tests."
@echo " tags Generate c/etags."
@@ -194,6 +194,7 @@ ifneq ("$(GENHTML)", "")
lcov:
$(RM) -rf $(LCOV_REPORTS_DIR)
$(MKDIR_P) $(LCOV_REPORTS_DIR)
-find . -name '*.gc[dn][ao]' ! -newer make.tmpl -delete
-$(LCOV) --capture --directory $(top_builddir) --ignore-errors source,negative,gcov \
--output-file $(LCOV_REPORTS_DIR)/out.info
-test ! -s $(LCOV_REPORTS_DIR)/out.info || \

View File

@@ -1 +1 @@
2.03.31(2)-git (2025-01-14)
2.03.32(2) (2025-05-05)

View File

@@ -1 +1 @@
1.02.205-git (2025-01-14)
1.02.206 (2025-05-05)

View File

@@ -1,10 +1,31 @@
Version 2.03.31 -
==================
Version 2.03.32 - 05th May 2025
===============================
Lvconvert vdopool conversion propperly validates acceptable LVs.
Accept thin pool data LV as cachable LV.
Allow using zram block devices (likely for testing).
Fix lvresize when resizing COW snapshots already covering origin.
Fix lvmdbusd read of executed lvm commands output.
Fix construction of DM UUID for cachevol _cdata and _cmeta devices.
Ignore PV claims from old metadata when then PV belongs to a new VG.
Fix integrity metadata rounding.
Accept --autobackup option in pvresize.
Version 2.03.31 - 27th February 2025
====================================
Reduce 'mandoc -T lint' reported issues for man pages.
Restore support for LVM_SUPPRESS_FD_WARNINGS (2.03.24).
Fix uncache and split cache restoring original state of volume.
Extend use of lockopt skip to more scenarios.
Enhance error path resolving in polling code.
Disallow shared activation of LV with CoW snapshot.
Fix lvmlockd use in lvremove of CoW snapshot, VDO pool, and uncache.
Improve mirror split with opened temporary volumes.
Improve pvmove finish with opened temporary volumes.
Fix backup limit for devices file, handle over 10,000 files.
Ignore reported optimal_io_size not divisible by 4096.
Fix busy-loop in config reading when read returned 0.
Fix DM cache preserving logic (2.03.28).
Improve use of lvmlockd for usecases involving thin volumes and pools.
Version 2.03.30 - 14th January 2025
===================================

View File

@@ -1,5 +1,12 @@
Version 1.02.205 -
===================
Version 1.02.206 - 05th May 2025
================================
Add support for using regex in selection criteria for string lists.
Fix string list selection when using [<item> || <item> ...].
Version 1.02.205 - 27th February 2025
=====================================
Restore missing symbol dm_tree_node_size_changed@Base (1.02.175).
Restore missing symbol dm_bitset_parse_list@@DM_1_02_138 (1.02.175).
Version 1.02.204 - 14th January 2025
====================================
@@ -273,7 +280,7 @@ Version 1.02.136 - 5th November 2016
Still produce output when dmsetup dependency tree building finds dev missing.
Check and report pthread_sigmask() failure in dmeventd.
Check mem alloc fail in _canonicalize_field_ids().
Use unsigned math when checking more then 31 legs of raid.
Use unsigned math when checking more than 31 legs of raid.
Fix 'dmstats delete' with dmsetup older than v1.02.129
Fix stats walk segfault with dmsetup older than v1.02.129

View File

@@ -586,7 +586,7 @@ allocation {
# Configuration option allocation/thin_pool_crop_metadata.
# Older version of lvm2 cropped pool's metadata size to 15.81 GiB.
# This is slightly less then the actual maximum 15.88 GiB.
# This is slightly less than the actual maximum 15.88 GiB.
# For compatibility with older version and use of cropped size set to 1.
# This configuration option has an automatic default value.
# thin_pool_crop_metadata = 0

View File

@@ -160,6 +160,8 @@ def call_lvm(command, debug=False, line_cb=None,
# Check to see if process has terminated, None when running
if process.poll() is not None:
stdout_text += read_decoded(process.stdout)
stderr_text += read_decoded(process.stderr)
break
except IOError as ioe:
log_debug("call_lvm:" + str(ioe))

View File

@@ -46,7 +46,7 @@ static char *_construct_lvm_system_dir_env(const char *sysdir)
* - or -
* just single char to store NULL byte
*/
size_t l = sysdir ? strlen(sysdir) + 16 : 1;
size_t l = sysdir ? strlen(sysdir) + sizeof(LVM_SYSTEM_DIR): 1;
char *env = (char *) malloc(l * sizeof(char));
if (!env)
@@ -89,6 +89,17 @@ char *construct_id(const char *sysdir, const char *uuid)
return id;
}
static void _free_lvmpolld_lv(struct lvmpolld_lv *p)
{
free((void *)p->devicesfile);
free((void *)p->lvm_system_dir_env);
free((void *)p->lvmpolld_id);
free((void *)p->lvname);
free((void *)p->sinterval);
free((void *)p->cmdargv);
free((void *)p->cmdenvp);
}
struct lvmpolld_lv *pdlv_create(struct lvmpolld_state *ls, const char *id,
const char *vgname, const char *lvname,
const char *sysdir, enum poll_type type,
@@ -96,30 +107,26 @@ struct lvmpolld_lv *pdlv_create(struct lvmpolld_state *ls, const char *id,
struct lvmpolld_store *pdst,
const char *devicesfile)
{
char *lvmpolld_id = strdup(id), /* copy */
*full_lvname = _construct_full_lvname(vgname, lvname), /* copy */
*lvm_system_dir_env = _construct_lvm_system_dir_env(sysdir); /* copy */
char *devicesfile_dup = devicesfile ? strdup(devicesfile) : NULL;
struct lvmpolld_lv tmp = {
.ls = ls,
.type = type,
.lvmpolld_id = lvmpolld_id,
.lvid = _get_lvid(lvmpolld_id, sysdir),
.lvname = full_lvname,
.devicesfile = devicesfile_dup,
.lvm_system_dir_env = lvm_system_dir_env,
.sinterval = strdup(sinterval), /* copy */
.lvmpolld_id = strdup(id),
.lvname = _construct_full_lvname(vgname, lvname),
.devicesfile = devicesfile ? strdup(devicesfile) : NULL,
.lvm_system_dir_env = _construct_lvm_system_dir_env(sysdir),
.sinterval = strdup(sinterval),
.pdtimeout = pdtimeout < MIN_POLLING_TIMEOUT ? MIN_POLLING_TIMEOUT : pdtimeout,
.cmd_state = { .retcode = -1, .signal = 0 },
.pdst = pdst,
.init_rq_count = 1
}, *pdlv = (struct lvmpolld_lv *) malloc(sizeof(struct lvmpolld_lv));
if (!pdlv || !tmp.lvid || !tmp.lvname || !tmp.lvm_system_dir_env || !tmp.sinterval)
if (!pdlv || !tmp.lvmpolld_id || !tmp.lvname || !tmp.lvm_system_dir_env || !tmp.sinterval)
goto err;
memcpy(pdlv, &tmp, sizeof(*pdlv));
tmp.lvid = _get_lvid(tmp.lvmpolld_id, sysdir),
*pdlv = tmp;
if (pthread_mutex_init(&pdlv->lock, NULL))
goto err;
@@ -127,29 +134,20 @@ struct lvmpolld_lv *pdlv_create(struct lvmpolld_state *ls, const char *id,
return pdlv;
err:
free((void *)devicesfile_dup);
free((void *)full_lvname);
free((void *)lvmpolld_id);
free((void *)lvm_system_dir_env);
free((void *)tmp.sinterval);
free((void *)pdlv);
_free_lvmpolld_lv(&tmp);
free(pdlv);
return NULL;
}
void pdlv_destroy(struct lvmpolld_lv *pdlv)
{
free((void *)pdlv->lvmpolld_id);
free((void *)pdlv->devicesfile);
free((void *)pdlv->lvname);
free((void *)pdlv->sinterval);
free((void *)pdlv->lvm_system_dir_env);
free((void *)pdlv->cmdargv);
free((void *)pdlv->cmdenvp);
_free_lvmpolld_lv(pdlv);
pthread_mutex_destroy(&pdlv->lock);
free((void *)pdlv);
free(pdlv);
}
unsigned pdlv_get_polling_finished(struct lvmpolld_lv *pdlv)

View File

@@ -31,6 +31,7 @@
struct selection {
struct dm_pool *mem;
struct dm_pool *regex_mem;
struct selection_node *selection_root;
int add_new_fields;
};
@@ -204,7 +205,9 @@ static const struct op_def _op_log[] = {
struct selection_str_list {
struct dm_str_list str_list;
unsigned type; /* either SEL_AND or SEL_OR */
struct dm_regex *regex;
size_t regex_num_patterns;
unsigned type; /* either SEL_LIST_LS or SEL_LIST_SUBSET_LS with either SEL_AND or SEL_OR */
};
struct field_selection_value {
@@ -1412,8 +1415,11 @@ struct dm_report *dm_report_init(uint32_t *report_types,
void dm_report_free(struct dm_report *rh)
{
if (rh->selection)
if (rh->selection) {
dm_pool_destroy(rh->selection->mem);
if (rh->selection->regex_mem)
dm_pool_destroy(rh->selection->regex_mem);
}
if (rh->value_cache)
dm_hash_destroy(rh->value_cache);
dm_pool_destroy(rh->mem);
@@ -1752,8 +1758,74 @@ static int _cmp_field_time(struct dm_report *rh,
return 0;
}
static int _str_list_item_match_regex(const struct str_list_sort_value *val, unsigned int i, struct dm_regex *regex)
{
struct pos_len *item = val->items + i;
char *s = (char *) (val->value + item->pos);
char c = s[item->len];
int r;
/*
* The val->items contains the whole string list in the form of a single string,
* where each item is delimited by a delimiter.
*
* The item->pos + item->len pair then points to the exact item within the val->items.
*
* The dm_regex_match accepts a string, not the pos + len pair, so we need to adapt here:
* replace the delimiter with '\0' temporarily so the item is a proper string.
*/
s[item->len] = '\0';
r = dm_regex_match(regex, s);
s[item->len] = c;
return r;
}
static size_t _bitset_count_set(dm_bitset_t bs)
{
size_t i, size = bs[0]/DM_BITS_PER_INT + 1;
size_t count = 0;
for (i = 1; i <= size; i++)
count += hweight32(bs[i]);
return count;
}
/* Matches if all items from selection string list match list value strictly 1:1. */
static int _cmp_field_string_list_strict_all(const struct str_list_sort_value *val,
static int _cmp_field_string_list_strict_regex_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
dm_bitset_t bs;
int r;
if (!val->items)
return (sel->regex_num_patterns == 1) && dm_regex_match(sel->regex, "") >= 0;
if (!(bs = dm_bitset_create(rh->selection->mem, sel->regex_num_patterns))) {
log_error("Failed to create bitset for regex match counter.");
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
if ((r = _str_list_item_match_regex(val, i, sel->regex)) < 0) {
r = 0;
goto out;
}
dm_bit_set(bs, r);
}
r = _bitset_count_set(bs) == sel->regex_num_patterns;
out:
dm_pool_free(rh->selection->mem, bs);
return r;
}
/* Matches if all items from selection string list match list value strictly 1:1. */
static int _cmp_field_string_list_strict_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int sel_list_size = dm_list_size(&sel->str_list.list);
@@ -1785,7 +1857,36 @@ static int _cmp_field_string_list_strict_all(const struct str_list_sort_value *v
}
/* Matches if all items from selection string list match a subset of list value. */
static int _cmp_field_string_list_subset_all(const struct str_list_sort_value *val,
static int _cmp_field_string_list_subset_regex_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
dm_bitset_t bs;
unsigned int i;
int r;
if (!val->items)
return (sel->regex_num_patterns == 1) && dm_regex_match(sel->regex, "") >= 0;
if (!(bs = dm_bitset_create(rh->selection->mem, sel->regex_num_patterns))) {
log_error("Failed to create bitset for regex match counter.");
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
if ((r = _str_list_item_match_regex(val, i, sel->regex)) < 0)
continue;
dm_bit_set(bs, r);
}
r = _bitset_count_set(bs) == sel->regex_num_patterns;
dm_pool_free(rh->selection->mem, bs);
return r;
}
/* Matches if all items from selection string list match a subset of list value. */
static int _cmp_field_string_list_subset_all(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int sel_list_size = dm_list_size(&sel->str_list.list);
@@ -1820,8 +1921,26 @@ static int _cmp_field_string_list_subset_all(const struct str_list_sort_value *v
}
/* Matches if any item from selection string list matches list value. */
static int _cmp_field_string_list_any(const struct str_list_sort_value *val,
const struct selection_str_list *sel)
static int _cmp_field_string_list_subset_regex_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
if (!val->items)
return dm_regex_match(sel->regex, "") >= 0;
for (i = 1; i <= val->items[0].pos; i++) {
if (_str_list_item_match_regex(val, i, sel->regex) >= 0)
return 1;
}
return 0;
}
/* Matches if any item from selection string list matches list value. */
static int _cmp_field_string_list_subset_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
struct dm_str_list *sel_item;
unsigned int i;
@@ -1850,7 +1969,59 @@ static int _cmp_field_string_list_any(const struct str_list_sort_value *val,
return 0;
}
static int _cmp_field_string_list(struct dm_report *rh __attribute__((unused)),
/* Matches if all items from list value can be matched by any item from selection list. */
static int _cmp_field_string_list_strict_regex_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
if (!val->items)
return dm_regex_match(sel->regex, "") >= 0;
for (i = 1; i <= val->items[0].pos; i++) {
if (_str_list_item_match_regex(val, i, sel->regex) < 0)
return 0;
}
return 1;
}
/* Matches if all items from list value can be matched by any item from selection list. */
static int _cmp_field_string_list_strict_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
struct dm_str_list *sel_item;
unsigned int i;
int match;
/* match blank string list with selection that contains blank string */
if (!val->items) {
dm_list_iterate_items(sel_item, &sel->str_list.list) {
if (!strcmp(sel_item->str, ""))
return 1;
}
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
match = 0;
dm_list_iterate_items(sel_item, &sel->str_list.list) {
if ((strlen(sel_item->str) == val->items[i].len) &&
!strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len)) {
match = 1;
break;
}
}
if (!match)
return 0;
}
return 1;
}
static int _cmp_field_string_list(struct dm_report *rh,
uint32_t field_num, const char *field_id,
const struct str_list_sort_value *val,
struct field_selection *fs)
@@ -1872,11 +2043,16 @@ static int _cmp_field_string_list(struct dm_report *rh __attribute__((unused)),
switch (sel->type & SEL_MASK) {
case SEL_AND:
r = subset ? _cmp_field_string_list_subset_all(val, sel)
: _cmp_field_string_list_strict_all(val, sel);
r = subset ? sel->regex ? _cmp_field_string_list_subset_regex_all(rh, val, sel)
: _cmp_field_string_list_subset_all(rh, val, sel)
: sel->regex ? _cmp_field_string_list_strict_regex_all(rh, val, sel)
: _cmp_field_string_list_strict_all(rh, val, sel);
break;
case SEL_OR:
r = _cmp_field_string_list_any(val, sel);
r = subset ? sel->regex ? _cmp_field_string_list_subset_regex_any(rh, val, sel)
: _cmp_field_string_list_subset_any(rh, val, sel)
: sel->regex ? _cmp_field_string_list_strict_regex_any(rh, val, sel)
: _cmp_field_string_list_strict_any(rh, val, sel);
break;
default:
log_error(INTERNAL_ERROR "_cmp_field_string_list: unsupported string "
@@ -1910,7 +2086,17 @@ static int _compare_selection_field(struct dm_report *rh,
}
if (fs->flags & FLD_CMP_REGEX)
r = _cmp_field_regex((const char *) f->sort_value, fs);
switch (f->props->flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_STRING:
r = _cmp_field_regex((const char *) f->sort_value, fs);
break;
case DM_REPORT_FIELD_TYPE_STRING_LIST:
r = _cmp_field_string_list(rh, f->props->field_num, field_id, (const struct str_list_sort_value *) f->sort_value, fs);
break;
default:
log_error(INTERNAL_ERROR "_compare_selection_field: regex: incorrect type %" PRIu32 " for field %s",
f->props->flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
}
else {
switch(f->props->flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_PERCENT:
@@ -1937,7 +2123,8 @@ static int _compare_selection_field(struct dm_report *rh,
r = _cmp_field_time(rh, f->props->field_num, field_id, *(const time_t *) f->sort_value, fs);
break;
default:
log_error(INTERNAL_ERROR "_compare_selection_field: unknown field type for field %s", field_id);
log_error(INTERNAL_ERROR "_compare_selection_field: incorrect type %" PRIu32 " for field %s",
f->props->flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
}
}
@@ -2629,11 +2816,9 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
static const char *_tok_value_regex(struct dm_report *rh,
const struct dm_report_field_type *ft,
const char *s, const char **begin,
const char **end, uint32_t *flags,
struct reserved_value_wrapper *rvw)
const char **end, uint32_t *flags)
{
char c;
rvw->reserved = NULL;
s = _skip_space(s);
@@ -2696,7 +2881,8 @@ static int _add_item_to_string_list(struct dm_pool *mem, const char *begin,
static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
struct dm_pool *mem, const char *s,
const char **begin, const char **end,
struct selection_str_list **sel_str_list)
struct selection_str_list **sel_str_list,
uint32_t *flags)
{
static const char _str_list_item_parsing_failed[] = "Failed to parse string list value "
"for selection field %s.";
@@ -2710,12 +2896,11 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
int list_end = 0;
char c;
if (!(ssl = dm_pool_alloc(mem, sizeof(*ssl)))) {
log_error("_tok_value_string_list: memory allocation failed for selection list");
if (!(ssl = dm_pool_zalloc(mem, sizeof(*ssl)))) {
log_error("_tok_value_string_list: memory allocation failed for selection list.");
goto bad;
}
dm_list_init(&ssl->str_list.list);
ssl->type = 0;
*begin = s;
if (!(op_flags = _tok_op_log(s, &tmp, SEL_LIST_LS | SEL_LIST_SUBSET_LS))) {
@@ -2727,7 +2912,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
}
if (!_add_item_to_string_list(mem, begin_item, end_item, &ssl->str_list.list))
goto_bad;
ssl->type = SEL_OR | SEL_LIST_LS;
ssl->type = SEL_OR | SEL_LIST_SUBSET_LS;
goto out;
}
@@ -2802,12 +2987,17 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
else
ssl->type |= SEL_LIST_SUBSET_LS;
/* Sort the list. */
if (!(list_size = dm_list_size(&ssl->str_list.list))) {
log_error(INTERNAL_ERROR "_tok_value_string_list: list has no items");
goto bad;
} else if (list_size == 1)
goto out;
if (*flags & FLD_CMP_REGEX)
/* No need to sort the list for regex. */
goto out;
/* Sort the list. */
if (!(arr = malloc(sizeof(item) * list_size))) {
log_error("_tok_value_string_list: memory allocation failed for sort array");
goto bad;
@@ -3323,7 +3513,10 @@ static const char *_tok_value(struct dm_report *rh,
s = _skip_space(s);
s = _get_reserved(rh, expected_type, field_num, implicit, s, begin, end, rvw);
/* recognize possible reserved value (but not in a regex) */
if (!(*flags & FLD_CMP_REGEX))
s = _get_reserved(rh, expected_type, field_num, implicit, s, begin, end, rvw);
if (rvw->reserved) {
/*
* FLD_CMP_NUMBER shares operators with FLD_CMP_TIME,
@@ -3334,17 +3527,24 @@ static const char *_tok_value(struct dm_report *rh,
else if (expected_type == DM_REPORT_FIELD_TYPE_NUMBER)
*flags &= ~FLD_CMP_TIME;
*flags |= expected_type;
/* if we matched a reserved value, skip further processing of this token */
return s;
}
switch (expected_type) {
case DM_REPORT_FIELD_TYPE_STRING:
c = _get_and_skip_quote_char(&s);
if (!(s = _tok_value_string(s, begin, end, c, SEL_AND | SEL_OR | SEL_PRECEDENCE_PE, NULL))) {
log_error("Failed to parse string value "
"for selection field %s.", ft->id);
return NULL;
if (*flags & FLD_CMP_REGEX) {
if (!(s = _tok_value_regex(rh, ft, s, begin, end, flags)))
return NULL;
} else {
c = _get_and_skip_quote_char(&s);
if (!(s = _tok_value_string(s, begin, end, c, SEL_AND | SEL_OR | SEL_PRECEDENCE_PE, NULL))) {
log_error("Failed to parse string value "
"for selection field %s.", ft->id);
return NULL;
}
}
*flags |= DM_REPORT_FIELD_TYPE_STRING;
break;
@@ -3353,7 +3553,7 @@ static const char *_tok_value(struct dm_report *rh,
if (!(str_list = (struct selection_str_list **) custom))
goto_bad;
s = _tok_value_string_list(ft, mem, s, begin, end, str_list);
s = _tok_value_string_list(ft, mem, s, begin, end, str_list, flags);
if (!(*str_list)) {
log_error("Failed to parse string list value "
"for selection field %s.", ft->id);
@@ -3437,7 +3637,7 @@ static const char *_tok_value(struct dm_report *rh,
return s;
bad:
log_error(INTERNAL_ERROR "Forbidden NULL custom detected.");
log_error(INTERNAL_ERROR "_tok_value: Forbidden NULL custom parameter detected.");
return NULL;
}
@@ -3508,6 +3708,19 @@ static int _get_reserved_value(struct dm_report *rh, uint32_t field_num,
return 1;
}
static struct dm_regex *_selection_regex_create(struct selection *selection, const char * const *patterns,
unsigned num_patterns)
{
if (!selection->regex_mem) {
if (!(selection->regex_mem = dm_pool_create("report selection regex", 32 * 1024))) {
log_error("Failed to create report selection regex memory pool.");
return NULL;
}
}
return dm_regex_create(selection->regex_mem, patterns, num_patterns);
}
static struct field_selection *_create_field_selection(struct dm_report *rh,
uint32_t field_num,
int implicit,
@@ -3525,7 +3738,11 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
struct time_value *tval;
uint64_t factor;
char *s;
const char *s_array[2] = { 0 };
const char *s_arr_single[2] = { 0 };
const char **s_arr;
size_t s_arr_size;
struct dm_str_list *sl;
size_t i;
dm_list_iterate_items(fp, &rh->field_props) {
if ((fp->implicit == implicit) && (fp->field_num == field_num)) {
@@ -3590,21 +3807,53 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
/* store comparison operand */
if (flags & FLD_CMP_REGEX) {
/* REGEX */
if (!(s = malloc(len + 1))) {
log_error("dm_report: malloc failed to store "
"regex value for selection field %s", field_id);
goto error;
}
memcpy(s, v, len);
s[len] = '\0';
s_array[0] = s;
switch (flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_STRING:
if (!(s = malloc(len + 1))) {
log_error("dm_report: malloc failed to store "
"regex value for selection field %s", field_id);
goto error;
}
memcpy(s, v, len);
s[len] = '\0';
s_arr_single[0] = s;
fs->value->v.r = dm_regex_create(rh->selection->mem, s_array, 1);
free(s);
if (!fs->value->v.r) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
fs->value->v.r = _selection_regex_create(rh->selection, s_arr_single, 1);
free(s);
if (!fs->value->v.r) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
}
break;
case DM_REPORT_FIELD_TYPE_STRING_LIST:
if (!custom)
goto bad;
fs->value->v.l = *((struct selection_str_list **) custom);
s_arr_size = dm_list_size(&fs->value->v.l->str_list.list);
if (!(s_arr = malloc(sizeof(char *) * s_arr_size))) {
log_error("dm_report: malloc failed for regex array "
"for selection field %s", field_id);
goto error;
}
i = 0;
dm_list_iterate_items(sl, &fs->value->v.l->str_list.list)
s_arr[i++] = sl->str;
fs->value->v.l->regex = _selection_regex_create(rh->selection, s_arr, s_arr_size);
fs->value->v.l->regex_num_patterns = s_arr_size;
free(s_arr);
if (!fs->value->v.l->regex) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
}
break;
default:
log_error(INTERNAL_ERROR "_create_field_selection: regex: incorrect type %" PRIu32 " for field %s",
flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
goto error;
}
} else {
/* STRING, NUMBER, SIZE, PERCENT, STRING_LIST, TIME */
@@ -3718,8 +3967,8 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
}
break;
default:
log_error(INTERNAL_ERROR "_create_field_selection: "
"unknown type of selection field %s", field_id);
log_error(INTERNAL_ERROR "_create_field_selection: incorrect type %" PRIu32 " for field %s",
flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
goto error;
}
}
@@ -3730,7 +3979,7 @@ error_field_id:
field_id);
goto error;
bad:
log_error(INTERNAL_ERROR "Forbidden NULL custom detected.");
log_error(INTERNAL_ERROR "_create_field_selection: Forbidden NULL custom detected.");
error:
dm_pool_free(rh->selection->mem, fs);
@@ -3866,7 +4115,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
char *tmp;
char c;
/* field name */
/* get field name */
if (!(last = _tok_field_name(s, &ws, &we))) {
log_error("Expecting field name");
goto bad;
@@ -3899,7 +4148,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
} else
ft = &rh->fields[field_num];
/* comparison operator */
/* get comparison operator */
if (!(flags = _tok_op_cmp(we, &last))) {
_display_selection_help(rh);
log_error("Unrecognised comparison operator: %s", we);
@@ -3911,50 +4160,49 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
goto bad;
}
/* comparison value */
/* check we can use the operator with the field */
if (flags & FLD_CMP_REGEX) {
/*
* REGEX value
*/
if (!(last = _tok_value_regex(rh, ft, last, &vs, &ve, &flags, &rvw)))
goto_bad;
} else {
/*
* STRING, NUMBER, SIZE, PERCENT, STRING_LIST, TIME value
*/
if (flags & FLD_CMP_NUMBER) {
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_NUMBER |
DM_REPORT_FIELD_TYPE_SIZE |
DM_REPORT_FIELD_TYPE_PERCENT |
DM_REPORT_FIELD_TYPE_TIME))) {
_display_selection_help(rh);
log_error("Operator can be used only with number, size, time or percent fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_TIME) {
if (!(ft->flags & DM_REPORT_FIELD_TYPE_TIME)) {
_display_selection_help(rh);
log_error("Operator can be used only with time fields: %s", ws);
goto bad;
}
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_STRING |
DM_REPORT_FIELD_TYPE_STRING_LIST))) {
_display_selection_help(rh);
log_error("Operator can be used only with string or string list fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_NUMBER) {
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_NUMBER |
DM_REPORT_FIELD_TYPE_SIZE |
DM_REPORT_FIELD_TYPE_PERCENT |
DM_REPORT_FIELD_TYPE_TIME))) {
_display_selection_help(rh);
log_error("Operator can be used only with number, size, time or percent fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_TIME) {
if (!(ft->flags & DM_REPORT_FIELD_TYPE_TIME)) {
_display_selection_help(rh);
log_error("Operator can be used only with time fields: %s", ws);
goto bad;
}
if (ft->flags == DM_REPORT_FIELD_TYPE_SIZE ||
ft->flags == DM_REPORT_FIELD_TYPE_NUMBER ||
ft->flags == DM_REPORT_FIELD_TYPE_PERCENT)
custom = &factor;
else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME)
custom = &tval;
else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST)
custom = &str_list;
else
custom = NULL;
if (!(last = _tok_value(rh, ft, field_num, implicit,
last, &vs, &ve, &flags,
&rvw, rh->selection->mem, custom)))
goto_bad;
}
/* assign custom structures to hold extra information for specific value types */
if (ft->flags == DM_REPORT_FIELD_TYPE_SIZE ||
ft->flags == DM_REPORT_FIELD_TYPE_NUMBER ||
ft->flags == DM_REPORT_FIELD_TYPE_PERCENT)
custom = &factor;
else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME)
custom = &tval;
else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST)
custom = &str_list;
else
custom = NULL;
/* get value to compare with */
if (!(last = _tok_value(rh, ft, field_num, implicit,
last, &vs, &ve, &flags,
&rvw, rh->selection->mem, custom)))
goto_bad;
*next = _skip_space(last);
/* create selection */
@@ -4095,7 +4343,7 @@ error:
static int _alloc_rh_selection(struct dm_report *rh)
{
if (!(rh->selection = dm_pool_zalloc(rh->mem, sizeof(struct selection))) ||
!(rh->selection->mem = dm_pool_create("report selection", 10 * 1024))) {
!(rh->selection->mem = dm_pool_create("report selection", 1024))) {
log_error("Failed to allocate report selection structure.");
if (rh->selection)
dm_pool_free(rh->mem, rh->selection);

View File

@@ -169,7 +169,7 @@ int dm_vasprintf(char **result, const char *format, va_list aq)
}
if (i > 1) {
/* Reallocating more then once? */
/* Reallocating more than once? */
if (!(*result = strdup(buf))) {
free(buf);
return -1;
@@ -591,7 +591,7 @@ const char *dm_size_to_string(struct dm_pool *mem, uint64_t size,
if ((s < NUM_UNIT_PREFIXES) &&
((unit_type == 'R') || (unit_type == 'r'))) {
/* When the rounding would cause difference, add '<' prefix
* i.e. 2043M is more then 1.9949G prints <2.00G
* i.e. 2043M is more than 1.9949G prints <2.00G
* This version is for 2 digits fixed precision */
d = 100. * (double) size / byte;
if (!_close_enough(floorl(d), nearbyintl(d)))

View File

@@ -120,7 +120,7 @@ int dm_get_status_raid(struct dm_pool *mem, const char *params,
if (!(pp = _skip_fields(p, 1)))
goto_bad;
/* Raid target can actually report more then real number of legs in a case
/* Raid target can actually report more than real number of legs in a case
* raid legs have been removed during initial raid array resynchronization */
if (i > (pp - p - 1))
i = pp - p - 1;
@@ -571,7 +571,7 @@ int dm_get_status_mirror(struct dm_pool *mem, const char *params,
pos += used;
if (num_devs > DM_MIRROR_MAX_IMAGES) {
log_error(INTERNAL_ERROR "More then " DM_TO_STRING(DM_MIRROR_MAX_IMAGES)
log_error(INTERNAL_ERROR "More than " DM_TO_STRING(DM_MIRROR_MAX_IMAGES)
" reported in mirror status.");
goto out;
}

View File

@@ -6,11 +6,11 @@ Version 2.03.30
Small bugfix release:
* **NEW** Create /dev/disk/by-diskseq/<DISKSEQ> symlink for public DM devices.
* **NEW** Create `/dev/disk/by-diskseq/<DISKSEQ>` symlink for public DM devices.
* Lvresize reports origin vdo volume cannot be resized.
* Support setting reserved_memory|stack using --config on cmdline.
* Support setting `reserved_memory|stack` using `--config` on cmdline.
* Fix support for disabling memory locking (2.03.27).
* Do not extend an LV if FS resize unsupported and '--fs resize' used.
* Do not extend an LV if FS resize unsupported and `--fs resize` used.
* Prevent leftover temporary device when converting in use volume to a pool.
* lvconvert detects volume in use early when converting it to a pool.
* Handle NVMe with quirk changed WWID not matching WWID in devices file.

View File

@@ -0,0 +1,33 @@
<!-- Page title -->
[[!meta title="Version 2.03.31 - Bug Fix Release"]]
Version 2.03.31
===============
Bugfix release:
* Disallow shared activation of LV with CoW snapshot.
* Ignore reported `optimal_io_size` not divisible by 4096.
* Restore support for `LVM_SUPPRESS_FD_WARNINGS` (2.03.24).
* Fix DM cache preserving logic (2.03.28).
* Restore missing symbol `dm_tree_node_size_changed@Base` (1.02.175).
* Restore missing symbol `dm_bitset_parse_list@@DM_1_02_138` (1.02.175).
* Fix uncache and split cache restoring original state of volume.
* Extend use of lockopt skip to more scenarios.
* Reduce `mandoc -T lint` reported issues for man pages.
* Enhance error path resolving in polling code.
* Fix lvmlockd use in lvremove of CoW snapshot, VDO pool, and uncache.
* Improve mirror split with opened temporary volumes.
* Improve pvmove finish with opened temporary volumes.
* Fix backup limit for devices file, handle over 10,000 files.
* Fix busy-loop in config reading when read returned 0.
* Improve use of lvmlockd for usecases involving thin volumes and pools.
<!-- remove the pending tag on release, remove draft tag once editing is complete -->
[[!tag]]
<!--
For old releases add Release Timestamp like this, date from git show $COMMIT is fine.
[[!meta date="Thu Feb 27 16:51:29 2025 +0100"]]
-->

View File

@@ -0,0 +1,26 @@
<!-- Page title -->
[[!meta title="Version 2.03.32 - Bug Fix Release"]]
Version 2.03.32
===============
Mostly bugfix release:
* Add support for using regex in selection criteria for string lists.
* Accept thin pool data LV as cachable LV.
* Accept `--autobackup` option in pvresize.
* Allow using zram block devices (likely for testing).
* Lvconvert vdopool conversion propperly validates acceptable LVs.
* Fix lvresize when resizing COW snapshots already covering origin.
* Fix lvmdbusd read of executed lvm commands output.
* Fix construction of DM UUID for cachevol `_cdata` and `_cmeta` devices.
* Ignore PV claims from old metadata when then PV belongs to a new VG.
* Fix integrity metadata rounding.
* Fix string list selection when using `[<item> || <item> ...]`.
<!-- remove the pending tag on release, remove draft tag once editing is complete -->
[[!tag]]
<!--
For old releases add Release Timestamp like this, date from git show $COMMIT is fine.
[[!meta date="Mon May 05 17:02:00 2025 +0200"]]
-->

View File

@@ -2014,7 +2014,7 @@ int dev_manager_thin_device_id(struct dev_manager *dm,
if (dm_get_next_target(dmt, NULL, &start, &length,
&target_type, &params)) {
log_error("More then one table line found for %s.",
log_error("More than one table line found for %s.",
display_lvname(lv));
goto out;
}
@@ -2067,7 +2067,7 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
display_lvname(lv));
if (dm_get_next_target(dmt, NULL, &start, &length, &type, &params)) {
log_error("More then one table line found for %s.",
log_error("More than one table line found for %s.",
display_lvname(lv));
goto out;
}
@@ -2121,7 +2121,7 @@ int dev_manager_vdo_pool_size_config(struct dev_manager *dm,
display_lvname(lv));
if (dm_get_next_target(dmt, NULL, &start, &length, &type, &params)) {
log_error("More then one table line found for %s.",
log_error("More than one table line found for %s.",
display_lvname(lv));
goto out;
}
@@ -2773,9 +2773,10 @@ static int _add_cvol_subdev_to_dtree(struct dev_manager *dm, struct dm_tree *dtr
const struct logical_volume *pool_lv = lvseg->pool_lv;
struct dm_info info;
char *name ,*dlid;
union lvid lvid = { { lv->vg->id, _get_id_for_meta_or_data(lvseg, meta_or_data) } };
union lvid lvid = { .id = { lv->vg->id, _get_id_for_meta_or_data(lvseg, meta_or_data) } };
lvid.s[sizeof(lvid.id)] = 0;
if (!(dlid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&lvid.s, layer)))
if (!(dlid = dm_build_dm_uuid(mem, UUID_PREFIX, lvid.s, layer)))
return_0;
/* Name is actually not really needed here, but aids debugging... */
@@ -3426,9 +3427,10 @@ static int _add_new_cvol_subdev_to_dtree(struct dev_manager *dm,
const struct logical_volume *pool_lv = lvseg->pool_lv;
struct dm_tree_node *dnode;
char *dlid, *dlid_pool, *name;
union lvid lvid = { { lv->vg->id, _get_id_for_meta_or_data(lvseg, meta_or_data) } };
union lvid lvid = { .id = { lv->vg->id, _get_id_for_meta_or_data(lvseg, meta_or_data) } };
lvid.s[sizeof(lvid.id)] = 0;
if (!(dlid = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid.s, layer)))
if (!(dlid = dm_build_dm_uuid(dm->mem, UUID_PREFIX, lvid.s, layer)))
return_0;
if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, pool_lv->name, layer)))

121
lib/cache/lvmcache.c vendored
View File

@@ -21,7 +21,6 @@
#include "lib/device/device_id.h"
#include "lib/locking/locking.h"
#include "lib/metadata/metadata.h"
#include "lib/mm/memlock.h"
#include "lib/format_text/format-text.h"
#include "lib/config/config.h"
#include "lib/filters/filter.h"
@@ -1954,7 +1953,7 @@ static int _lvmcache_update_vgname(struct cmd_context *cmd,
log_warn("WARNING: VG name %s is used by VGs %s and %s.",
vgname, vgid_dashed, other_dashed);
log_warn("Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.");
log_warn("WARNING: fix duplicate VG names with vgrename uuid, or vgrename --devices");
}
if (!vginfo_is_allowed && !other_is_allowed) {
@@ -2097,12 +2096,17 @@ int lvmcache_update_vgname_and_id(struct cmd_context *cmd, struct lvmcache_info
vgid = vgname;
}
/* FIXME: remove this, it shouldn't be needed */
/* If PV without mdas is already in a real VG, don't make it orphan */
if (is_orphan_vg(vgname) && info->vginfo &&
mdas_empty_or_ignored(&info->mdas) &&
!is_orphan_vg(info->vginfo->vgname) && critical_section())
/*
* This happens when vgremove does pv_write to make a PV
* that was previously part of a VG into a new orphan.
* FIXME: change pv_write to not use or update lvmcache,
* which should only be updated by label_scan.
*/
if (is_orphan_vg(vgname) && info->vginfo && !is_orphan_vg(info->vginfo->vgname)) {
log_debug("lvmcache change %s to orphan from previous VG %s.",
dev_name(info->dev), info->vginfo->vgname);
return 1;
}
/*
* Creates a new vginfo struct for this vgname/vgid if none exists,
@@ -2265,7 +2269,7 @@ int lvmcache_update_vgname_and_id(struct cmd_context *cmd, struct lvmcache_info
* using the 'vg'.
*/
int lvmcache_update_vg_from_read(struct volume_group *vg, unsigned precommitted)
void lvmcache_update_vg_from_read(struct volume_group *vg, int *incorrect_pv_claim)
{
char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
@@ -2285,9 +2289,11 @@ int lvmcache_update_vg_from_read(struct volume_group *vg, unsigned precommitted)
if (!(vginfo = lvmcache_vginfo_from_vgname(vg->name, vgid))) {
log_error(INTERNAL_ERROR "lvmcache_update_vg %s no vginfo", vg->name);
return 0;
return;
}
log_debug_cache("lvmcache_update_vg %s vginfo from metadata", vg->name);
/*
* The label scan doesn't know when a PV with old metadata has been
* removed from the VG. Now with the vg we can tell, so remove the
@@ -2326,8 +2332,32 @@ int lvmcache_update_vg_from_read(struct volume_group *vg, unsigned precommitted)
continue;
}
log_debug_cache("lvmcache_update_vg %s for info %s",
vg->name, dev_name(info->dev));
/*
* If this PV info is already attached to a different VG, don't
* override that. The info/vginfo map a PV to a VG based on the
* metadata which appears on the PV itself. That has precedence
* over a different mapping of PV to another VG (the vg arg here)
* which is likely outdated metadata from some other device.
*/
if (info->vginfo && !is_orphan_vg(info->vginfo->vgname) &&
(strcmp(info->vginfo->vgname, vg->name) || memcmp(info->vginfo->vgid, &vg->id, ID_LEN))) {
char vgid_old[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
char vgid_new[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
memcpy(vgid_old, &vg->id, ID_LEN);
memcpy(vgid_new, info->vginfo->vgid, ID_LEN);
if (!strcmp(info->vginfo->vgname, vg->name))
log_warn("WARNING: PV %s %s belongs to VGID %s, ignoring claim from VGID %s (%s).",
dev_name(info->dev), pvid, vgid_new, vgid_old, vg->name);
else
log_warn("WARNING: PV %s %s belongs to VG %s, ignoring claim from VG %s.",
dev_name(info->dev), pvid, info->vginfo->vgname, vg->name);
pvl->pv->wrong_vg = 1;
*incorrect_pv_claim = 1;
continue;
}
log_debug_cache("lvmcache_update_vg %s for %s", vg->name, dev_name(info->dev));
/*
* FIXME: use a different function that just attaches info's that
@@ -2359,8 +2389,6 @@ int lvmcache_update_vg_from_read(struct volume_group *vg, unsigned precommitted)
break;
}
}
return 1;
}
/*
@@ -3203,6 +3231,73 @@ bool lvmcache_is_outdated_dev(struct cmd_context *cmd,
return false;
}
/*
* Metadata is being processed which shows 'vg' containing 'pv'.
* Verify that this is consistent with the headers/metadata that
* were scanned from PV. The headers/metadata scanned from the
* actual PV could be different from what 'vg' metadata claims,
* if the 'vg' metadata is old/outdated.
*/
int lvmcache_verify_info_in_vg(struct volume_group *vg, struct lvmcache_info *info)
{
char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
memcpy(vgid, &vg->id, ID_LEN);
if (!info->dev) {
log_error(INTERNAL_ERROR "Verify PV info in %s: skip, no dev", vg->name);
return 1;
}
if (!info->dev->pvid[0]) {
log_debug("Verify PV %s in %s: uncertain, no pvid",
dev_name(info->dev), vg->name);
return 1;
}
if (!info->vginfo) {
log_debug("Verify PV %s %s in %s: uncertain, no vginfo",
info->dev->pvid, dev_name(info->dev), vg->name);
return 1;
}
if (strcmp(vg->name, info->vginfo->vgname)) {
log_debug("Verify PV %s %s in %s: fail, other VG %s",
info->dev->pvid, dev_name(info->dev), vg->name, info->vginfo->vgname);
return 0;
}
if (memcmp(vgid, info->vginfo->vgid, ID_LEN)) {
log_debug("Verify PV %s %s in %s: fail, other vgid %s",
info->dev->pvid, dev_name(info->dev), vg->name, info->vginfo->vgid);
return 0;
}
return 1;
}
int lvmcache_verify_pv_in_vg(struct volume_group *vg, struct physical_volume *pv)
{
struct lvmcache_info *info;
char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
memcpy(&pvid, &pv->id.uuid, ID_LEN);
if (!(info = lvmcache_info_from_pvid(pvid, NULL, 0))) {
log_debug("Verify PV %s in %s: skip, no info", pvid, vg->name);
return 1;
}
if (pv->dev != info->dev) {
log_debug("Verify PV %s in %s: skip, different devs", info->dev->pvid, vg->name);
return 1;
}
return lvmcache_verify_info_in_vg(vg, info);
}
const char *dev_filtered_reason(struct device *dev)
{
if (dev->filtered_flags & DEV_FILTERED_REGEX)

View File

@@ -83,7 +83,7 @@ void lvmcache_del_dev(struct device *dev);
/* Update things */
int lvmcache_update_vgname_and_id(struct cmd_context *cmd, struct lvmcache_info *info,
struct lvmcache_vgsummary *vgsummary);
int lvmcache_update_vg_from_read(struct volume_group *vg, unsigned precommitted);
void lvmcache_update_vg_from_read(struct volume_group *vg, int *incorrect_pv_claim);
void lvmcache_lock_vgname(const char *vgname, int read_only);
void lvmcache_unlock_vgname(const char *vgname);
@@ -190,6 +190,9 @@ void lvmcache_save_metadata_size(uint64_t val);
bool lvmcache_has_old_metadata(struct cmd_context *cmd, const char *vgname, const char *vgid, struct device *dev);
int lvmcache_verify_pv_in_vg(struct volume_group *vg, struct physical_volume *pv);
int lvmcache_verify_info_in_vg(struct volume_group *vg, struct lvmcache_info *info);
void lvmcache_get_outdated_devs(struct cmd_context *cmd,
const char *vgname, const char *vgid,
struct dm_list *devs);

View File

@@ -681,7 +681,7 @@ cfg(allocation_thin_pool_metadata_require_separate_pvs_CFG, "thin_pool_metadata_
cfg(allocation_thin_pool_crop_metadata_CFG, "thin_pool_crop_metadata", allocation_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_CROP_METADATA, vsn(2, 3, 12), NULL, 0, NULL,
"Older version of lvm2 cropped pool's metadata size to 15.81 GiB.\n"
"This is slightly less then the actual maximum 15.88 GiB.\n"
"This is slightly less than the actual maximum 15.88 GiB.\n"
"For compatibility with older version and use of cropped size set to 1.\n")
cfg(allocation_thin_pool_zero_CFG, "thin_pool_zero", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_ZERO, vsn(2, 2, 99), NULL, 0, NULL,

View File

@@ -70,6 +70,7 @@ static const dev_known_type_t _dev_known_types[] = {
{"nvme", 64, "NVM Express"},
{"zvol", 16, "ZFS Zvols"},
{"VxDMP", 16, "Veritas Dynamic Multipathing"},
{"zram", 1, "zram block device"},
{"", 0, ""}
};

View File

@@ -73,7 +73,7 @@ static void _persistent_filter_wipe(struct cmd_context *cmd, struct dev_filter *
_init_hash(pf);
} else {
dm_list_iterate_items(sl, &dev->aliases)
radix_tree_remove(pf->devices, sl->str, strlen(sl->str));
(void) radix_tree_remove(pf->devices, sl->str, strlen(sl->str));
}
}

View File

@@ -219,7 +219,7 @@ static void _remove_expired(const char *dir, const char *vgname,
sum /= 1024 * 1024;
if (sum > 128 || archives_size > 8192)
log_print_unless_silent("Consider pruning %s VG archive with more then %u MiB in %u files (see archiving settings in lvm.conf).",
log_print_unless_silent("Consider pruning %s VG archive with more than %u MiB in %u files (see archiving settings in lvm.conf).",
vgname, (unsigned)sum, archives_size);
}

View File

@@ -1124,11 +1124,11 @@ static int _busy_vg(struct cmd_context *cmd, struct volume_group *vg)
int ret;
if (!_use_lvmlockd) {
log_error("Lvmlockd is not in use.");
log_error("lvmlockd is not in use.");
return 0;
}
if (!_lvmlockd_connected) {
log_error("Lvmlockd is not connected.");
log_error("lvmlockd is not connected.");
return 0;
}
@@ -1231,6 +1231,9 @@ static int _free_vg_sanlock(struct cmd_context *cmd, struct volume_group *vg)
if (result == -EBUSY) {
log_error("Lockspace for \"%s\" not stopped on other hosts", vg->name);
goto out;
} else if (result == -ENOLS) {
log_error("Lockspace for \"%s\" is not started.", vg->name);
goto out;
}
if (!ret) {
@@ -1708,7 +1711,14 @@ int lockd_global_create(struct cmd_context *cmd, const char *def_mode, const cha
return 0;
}
log_debug("lockd global lock_type %s", vg_lock_type);
if (cmd->lockd_gl_disable) {
log_debug("lockd global create disabled %s", def_mode ?: "");
if (def_mode && !strcmp(def_mode, "ex"))
log_warn("WARNING: skipping global lock in lvmlockd.");
goto out;
}
log_debug("lockd global create lock_type %s", vg_lock_type);
if (!mode)
mode = def_mode;
@@ -1820,6 +1830,8 @@ int lockd_global_create(struct cmd_context *cmd, const char *def_mode, const cha
return 0;
}
out:
/* --shared with vgcreate does not mean include_shared_vgs */
cmd->include_shared_vgs = 0;
@@ -1930,9 +1942,6 @@ int lockd_global(struct cmd_context *cmd, const char *def_mode)
return 0;
}
if (cmd->lockd_gl_disable)
return 1;
if (def_mode && !strcmp(def_mode, "un")) {
mode = "un";
goto req;
@@ -1956,6 +1965,12 @@ int lockd_global(struct cmd_context *cmd, const char *def_mode)
if (!strcmp(mode, "un") && cmd->lockd_global_ex)
cmd->lockd_global_ex = 0;
if (cmd->lockd_gl_disable) {
log_debug("lockd global disabled %s", def_mode ?: "");
if (def_mode && !strcmp(def_mode, "ex"))
log_warn("WARNING: skipping global lock in lvmlockd.");
goto allow;
}
req:
log_debug("lockd global %s", mode);
@@ -2023,6 +2038,7 @@ int lockd_global(struct cmd_context *cmd, const char *def_mode)
result == -ESTARTING ||
result == -EVGKILLED ||
result == -ELOCKIO ||
result == -ELMERR ||
result == -EORPHAN ||
result == -EADOPT_RETRY ||
result == -EADOPT_NONE) {
@@ -2036,6 +2052,8 @@ int lockd_global(struct cmd_context *cmd, const char *def_mode)
log_error("Global lock failed: check that global lockspace is started");
else if (result == -ELOCKIO)
log_error("Global lock failed: storage errors for sanlock leases");
else if (result == -ELMERR)
log_error("Global lock failed: lock manager error");
else if (result == -EVGKILLED)
log_error("Global lock failed: storage failed for sanlock leases");
else if (result == -EORPHAN)
@@ -2087,11 +2105,17 @@ int lockd_global(struct cmd_context *cmd, const char *def_mode)
goto allow;
}
if (result == -ELMERR) {
log_warn("Skipping global lock: lock manager error");
goto allow;
}
if ((lockd_flags & LD_RF_NO_GL_LS) || (lockd_flags & LD_RF_NO_LOCKSPACES)) {
log_debug("Skipping global lock: lockspace not found or started");
goto allow;
}
/*
* This is for completeness. If we reach here, then
* a specific check for the error should be added above
@@ -2201,8 +2225,12 @@ int lockd_vg(struct cmd_context *cmd, const char *vg_name, const char *def_mode,
/*
* Some special cases need to disable the vg lock.
*/
if (cmd->lockd_vg_disable)
if (cmd->lockd_vg_disable) {
log_debug("lockd VG disabled %s", def_mode ?: "");
if (def_mode && !strcmp(def_mode, "ex"))
log_warn("WARNING: skipping VG lock in lvmlockd.");
return 1;
}
/*
* An unlock is simply sent or skipped without any need
@@ -2402,6 +2430,18 @@ int lockd_vg(struct cmd_context *cmd, const char *vg_name, const char *def_mode,
}
}
if (result == -ELMERR) {
if (!strcmp(mode, "sh")) {
log_warn("VG %s lock skipped: lock manager error.", vg_name);
ret = 1;
goto out;
} else {
log_error("VG %s lock failed: lock manager error.", vg_name);
ret = 0;
goto out;
}
}
/*
* No lockspace for the VG was found. It may be a local
* VG that lvmlockd doesn't keep track of, or it may be
@@ -2621,13 +2661,24 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
return 1;
}
if (cmd->lockd_lv_disable)
if (cmd->lockd_lv_disable) {
log_debug("lockd_lv disabled %s %s/%s", def_mode ?: "", vg->name, lv_name);
if (def_mode && strcmp(def_mode, "un"))
log_warn("WARNING: skipping LV lock in lvmlockd.");
return 1;
}
if (!_use_lvmlockd)
return 0;
if (!_lvmlockd_connected)
if (!_use_lvmlockd || !_lvmlockd_connected) {
if (def_mode && !strcmp(def_mode, "un"))
return 1;
if (!_use_lvmlockd)
log_error("LV %s/%s lock failed: lvmlockd is required for VG lock_type %s.",
vg->name, lv_name, vg->lock_type ?: "unknown");
if (!_lvmlockd_connected)
log_error("LV %s/%s lock failed: lvmlockd connection is required.",
vg->name, lv_name);
return 0;
}
/*
* For lvchange/vgchange activation, def_mode is "sh" or "ex"
@@ -3180,9 +3231,15 @@ void lockd_lvremove_done(struct cmd_context *cmd, struct logical_volume *lv, str
if (!lockd_lv(cmd, lv, "un", LDLV_PERSISTENT))
goto_bad;
lockd_free_lv_after_update(cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
}
/*
* In some cases the LV being removed will not have a lock itself to
* free (no lock_args), e.g. when removing a thin LV.
*/
if (lv->lock_args)
lockd_free_lv_queue(cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
return;
bad:
log_warn("WARNING: Failed to unlock %s.", lv_other ? display_lvname(lv_other) : display_lvname(lv));
@@ -3398,20 +3455,6 @@ int lockd_lv(struct cmd_context *cmd, struct logical_volume *lv,
log_debug("lockd_lv %s %s", def_mode ?: "no_mode", display_lvname(lv));
if (!_use_lvmlockd) {
log_error("LV in VG %s with lock_type %s requires lvmlockd.",
lv->vg->name, lv->vg->lock_type);
return 0;
}
if (!_lvmlockd_connected && (def_mode && !strcmp(def_mode, "un"))) {
log_debug("Skip LV unlock: no lvmlockd");
return 1;
}
if (!_lvmlockd_connected)
return 0;
/*
* This addresses the specific case of: vgchange -an vg
* when vg is a shared VG that is not started. Without
@@ -3457,7 +3500,9 @@ int lockd_lv(struct cmd_context *cmd, struct logical_volume *lv,
lv_is_mirror_type(lv) ||
lv_is_raid_type(lv) ||
lv_is_vdo_type(lv) ||
lv_is_cache_type(lv)) {
lv_is_cache_type(lv) ||
lv_is_origin(lv) ||
lv_is_cow(lv)) {
flags |= LDLV_MODE_NO_SH;
}
@@ -3653,10 +3698,19 @@ static int _free_lv(struct cmd_context *cmd, struct volume_group *vg,
int result;
int ret;
if (!_use_lvmlockd)
if (cmd->lockd_lv_disable) {
log_debug("lockd free LV disabled %s/%s %s lock_args %s", vg->name, lv_name, lv_uuid, lock_args ?: "none");
return 1;
}
if (!_use_lvmlockd) {
log_error("LV %s/%s free lock in shared VG: lvmlockd is required.", vg->name, lv_name);
return 0;
if (!_lvmlockd_connected)
}
if (!_lvmlockd_connected) {
log_error("LV %s/%s free lock in shared VG: lvmlockd is not connected.", vg->name, lv_name);
return 0;
}
log_debug("lockd free LV %s/%s %s lock_args %s", vg->name, lv_name, lv_uuid, lock_args ?: "none");
@@ -3676,8 +3730,12 @@ static int _free_lv(struct cmd_context *cmd, struct volume_group *vg,
ret = (result < 0) ? 0 : 1;
}
if (!ret)
log_error("_free_lv lvmlockd result %d", result);
if (!ret) {
if (result == -ENOLS)
log_error("LV %s/%s free lock in shared VG: lockspace not started", vg->name, lv_name);
else
log_error("LV %s/%s free lock in shared VG: lvmlockd error %d.", vg->name, lv_name, result);
}
daemon_reply_destroy(reply);
@@ -3817,8 +3875,10 @@ void lockd_free_removed_lvs(struct cmd_context *cmd, struct volume_group *vg, in
* and we don't free any of the locks.
*/
if (remove_success) {
dm_list_iterate_items(fli, &vg->lockd_free_lvs)
_free_lv(cmd, vg, fli->name, fli->uuid, fli->args);
dm_list_iterate_items(fli, &vg->lockd_free_lvs) {
if (!_free_lv(cmd, vg, fli->name, fli->uuid, fli->args))
log_error("Failed to free lock for LV %s/%s in lvmlockd.", vg->name, fli->name);
}
}
vg->needs_lockd_free_lvs = 0;
dm_list_init(&vg->lockd_free_lvs);
@@ -3831,8 +3891,8 @@ void lockd_free_removed_lvs(struct cmd_context *cmd, struct volume_group *vg, in
* remove none of the LVs, and lockd_free_removed_lvs() will be called with
* remove_success == 0, and it will not free any of the LV locks.
*/
int lockd_free_lv_after_update(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args)
void lockd_free_lv_queue(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args)
{
struct free_lv_info *fli;
char lv_uuid[64] __attribute__((aligned(8)));
@@ -3840,33 +3900,32 @@ int lockd_free_lv_after_update(struct cmd_context *cmd, struct volume_group *vg,
switch (get_lock_type_from_string(vg->lock_type)) {
case LOCK_TYPE_NONE:
case LOCK_TYPE_CLVM:
return 1;
return;
case LOCK_TYPE_DLM:
case LOCK_TYPE_SANLOCK:
case LOCK_TYPE_IDM:
if (!lock_args)
return 1;
return;
break;
default:
log_error("lockd_free_lv_after_update: unknown lock_type.");
return 0;
log_error("lockd_free_lv_queue: unknown lock_type.");
return;
}
if (!id_write_format(lv_id, lv_uuid, sizeof(lv_uuid)))
return_0;
return;
/* save lv info to send the free_lv messages later */
if (!(fli = dm_pool_zalloc(vg->vgmem, sizeof(*fli))))
return_0;
return;
if (!(fli->uuid = dm_pool_strdup(vg->vgmem, lv_uuid)))
return_0;
return;
if (!(fli->name = dm_pool_strdup(vg->vgmem, lv_name)))
return_0;
return;
if (!(fli->args = dm_pool_strdup(vg->vgmem, lock_args)))
return_0;
return;
dm_list_add(&vg->lockd_free_lvs, &fli->list);
vg->needs_lockd_free_lvs = 1;
return 1;
}
int lockd_free_lv(struct cmd_context *cmd, struct volume_group *vg,

View File

@@ -116,8 +116,8 @@ int lockd_init_lv_args(struct cmd_context *cmd, struct volume_group *vg,
struct logical_volume *lv, const char *lock_type, const char *last_args, const char **lock_args);
int lockd_free_lv(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args);
int lockd_free_lv_after_update(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args);
void lockd_free_lv_queue(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args);
void lockd_free_removed_lvs(struct cmd_context *cmd, struct volume_group *vg, int remove_success);
const char *lockd_running_lock_type(struct cmd_context *cmd, int *found_multiple);
@@ -273,10 +273,9 @@ static inline int lockd_free_lv(struct cmd_context *cmd, struct volume_group *vg
return 1;
}
static inline int lockd_free_lv_after_update(struct cmd_context *cmd, struct volume_group *vg,
static inline void lockd_free_lv_queue(struct cmd_context *cmd, struct volume_group *vg,
const char *lv_name, struct id *lv_id, const char *lock_args)
{
return 1;
}
static inline void lockd_free_removed_lvs(struct cmd_context *cmd, struct volume_group *vg, int remove_success)

View File

@@ -222,7 +222,7 @@ int update_cache_pool_params(struct cmd_context *cmd,
}
if (*chunk_size < min_chunk_size) {
/*
* When using more then 'standard' default,
* When using more than 'standard' default,
* keep user informed he might be using things in unintended direction
*/
log_print_unless_silent("Using %s chunk size instead of default %s, "

View File

@@ -132,6 +132,12 @@ static int _lv_create_integrity_metadata(struct cmd_context *cmd,
meta_sectors = meta_bytes / 512;
lp_meta.extents = meta_sectors / vg->extent_size;
/* Use one extent if the VG extent size is larger than the number of sectors needed. */
if (!lp_meta.extents) {
log_debug("Round integrity meta size up to one extent.");
lp_meta.extents = 1;
}
log_verbose("Creating integrity metadata LV %s with size %s.",
metaname, display_size(cmd, meta_sectors));
@@ -197,6 +203,8 @@ int lv_extend_integrity_in_raid(struct logical_volume *lv, struct dm_list *pvh)
meta_bytes = _lv_size_bytes_to_integrity_meta_bytes(lv_size_bytes, 0, 0);
meta_sectors = meta_bytes / 512;
meta_extents = meta_sectors / vg->extent_size;
if (!meta_extents)
meta_extents = 1;
prev_meta_sectors = lv_imeta->size;
prev_meta_extents = prev_meta_sectors / vg->extent_size;

View File

@@ -1230,7 +1230,7 @@ static int _release_and_discard_lv_segment_area(struct lv_segment *seg, uint32_t
if (vg_is_shared(vg)) {
if (!lockd_lv_name(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args, "un", LDLV_PERSISTENT))
log_error("Failed to unlock vdo pool in lvmlockd.");
lockd_free_lv_after_update(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
lockd_free_lv_queue(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
}
return 1;
}
@@ -5587,13 +5587,8 @@ static int _lvresize_adjust_extents(struct logical_volume *lv,
log_print_unless_silent("Reached maximum COW size %s (%" PRIu32 " extents).",
display_size(vg->cmd, (uint64_t) vg->extent_size * logical_extents_used),
logical_extents_used);
lp->extents = logical_extents_used; // CHANGES lp->extents
seg_size = lp->extents - existing_logical_extents; // Recalculate
if (lp->extents == existing_logical_extents) {
/* Signal that normal resizing is not required */
lp->size_changed = 1;
return 1;
}
/* Truncate lp->extents to logical_extents_used */
lp->extents = logical_extents_used;
}
} else if (lv_is_thin_pool_metadata(lv)) {
if (!(seg = get_only_segment_using_this_lv(lv)))

View File

@@ -86,14 +86,14 @@ int lv_merge_segments(struct logical_volume *lv)
* bogus segment structure setup.
*/
#define raid_seg_error(msg) do { \
log_error("LV %s invalid: %s for %s segment", \
log_error("LV %s invalid: %s for %s segment.", \
display_lvname(seg->lv), (msg), lvseg_name(seg)); \
if ((*error_count)++ > ERROR_MAX) \
return; \
} while (0)
#define raid_seg_error_val(msg, val) do { \
log_error("LV %s invalid: %s (is %u) for %s segment", \
log_error("LV %s invalid: %s (is %u) for %s segment.", \
display_lvname(seg->lv), (msg), (val), lvseg_name(seg)); \
if ((*error_count)++ > ERROR_MAX) \
return; \
@@ -282,16 +282,20 @@ static void _check_raid_seg(struct lv_segment *seg, int *error_count)
/* Default < 10, change once raid1 split shift and rename SubLVs works! */
if (seg_is_raid1(seg)) {
if (seg->area_count > DEFAULT_RAID1_MAX_IMAGES) {
log_error("LV %s invalid: maximum supported areas %u (is %u) for %s segment",
seg->lv->name, DEFAULT_RAID1_MAX_IMAGES, seg->area_count, lvseg_name(seg));
if ((*error_count)++ > ERROR_MAX)
return;
}
} else if (seg->area_count > DEFAULT_RAID_MAX_IMAGES) {
log_error("LV %s invalid: maximum supported areas %u (is %u) for %s segment",
seg->lv->name, DEFAULT_RAID_MAX_IMAGES, seg->area_count, lvseg_name(seg));
log_error("LV %s invalid: maximum supported areas %u "
"(is %u) for %s segment.",
seg->lv->name, DEFAULT_RAID1_MAX_IMAGES,
seg->area_count, lvseg_name(seg));
if ((*error_count)++ > ERROR_MAX)
return;
}
} else if (seg->area_count > DEFAULT_RAID_MAX_IMAGES) {
log_error("LV %s invalid: maximum supported areas %u "
"(is %u) for %s segment.",
seg->lv->name, DEFAULT_RAID_MAX_IMAGES,
seg->area_count, lvseg_name(seg));
if ((*error_count)++ > ERROR_MAX)
return;
}
/* FIXME: should we check any non-RAID segment struct members at all? */
@@ -627,7 +631,7 @@ int check_lv_segments_complete_vg(struct logical_volume *lv)
seg_le(seg, s))) ||
find_mirror_seg(seg2) != seg)) {
log_error("LV %s: segment %u mirror "
"image %u missing mirror ptr",
"image %u missing mirror ptr.",
lv->name, seg_count, s);
inc_error_count;
}
@@ -651,7 +655,9 @@ int check_lv_segments_complete_vg(struct logical_volume *lv)
lv_is_raid(lv) ||
lv_is_snapshot(lv) ||
lv_is_thin_pool(lv) ||
lv_is_thin_volume(lv))) {
lv_is_thin_volume(lv) ||
lv_is_vdo_pool(lv) ||
lv_is_vdo(lv))) {
log_error("LV %s must have exactly one segment.",
lv->name);
inc_error_count;
@@ -661,7 +667,7 @@ int check_lv_segments_complete_vg(struct logical_volume *lv)
(!(seg2 = first_seg(lv)) || !(seg2 = find_pool_seg(seg2)) ||
seg2->area_count != 1 || seg_type(seg2, 0) != AREA_LV ||
seg_lv(seg2, 0) != lv)) {
log_error("LV %s: segment 1 pool data LV does not point back to same LV",
log_error("LV %s: segment 1 pool data LV does not point back to same LV.",
lv->name);
inc_error_count;
}
@@ -732,7 +738,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
if (seg->len != seg->area_len &&
seg->len != seg->area_len * data_rimage_count) {
log_error("LV %s: segment %u with len=%u "
" has inconsistent area_len %u",
"has inconsistent area_len %u.",
lv->name, seg_count, seg->len, seg->area_len);
inc_error_count;
}
@@ -740,7 +746,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
if (seg_is_snapshot(seg)) {
if (seg->cow && seg->cow == seg->origin) {
log_error("LV %s: segment %u has same LV %s for "
"both origin and snapshot",
"both origin and snapshot.",
lv->name, seg_count, seg->cow->name);
inc_error_count;
}
@@ -748,8 +754,8 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) == AREA_UNASSIGNED) {
log_error("LV %s: segment %u has unassigned "
"area %u.",
log_error("LV %s: segment %u has "
"unassigned area %u.",
lv->name, seg_count, s);
inc_error_count;
} else if (seg_type(seg, s) == AREA_PV) {
@@ -757,7 +763,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
seg_pvseg(seg, s)->lvseg != seg ||
seg_pvseg(seg, s)->lv_area != s) {
log_error("LV %s: segment %u has "
"inconsistent PV area %u",
"inconsistent PV area %u.",
lv->name, seg_count, s);
inc_error_count;
}
@@ -766,7 +772,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
seg_lv(seg, s)->vg != lv->vg ||
seg_lv(seg, s) == lv) {
log_error("LV %s: segment %u has "
"inconsistent LV area %u",
"inconsistent LV area %u.",
lv->name, seg_count, s);
inc_error_count;
/* Can't check more of such segment */
@@ -789,15 +795,15 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
seg_found++;
if (!seg_found) {
log_error("LV %s segment %u uses LV %s,"
" but missing ptr from %s to %s",
log_error("LV %s segment %u uses LV %s, "
"but missing ptr from %s to %s.",
lv->name, seg_count,
seg_lv(seg, s)->name,
seg_lv(seg, s)->name, lv->name);
inc_error_count;
} else if (seg_found > 1) {
log_error("LV %s has duplicated links "
"to LV %s segment %u",
"to LV %s segment %u.",
seg_lv(seg, s)->name,
lv->name, seg_count);
inc_error_count;
@@ -810,7 +816,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
}
if (le != lv->le_count) {
log_error("LV %s: inconsistent LE count %u != %u",
log_error("LV %s: inconsistent LE count %u != %u.",
lv->name, le, lv->le_count);
inc_error_count;
}
@@ -846,7 +852,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
if (!seg_found) {
log_error("LV %s is used by LV %s:%" PRIu32 "-%" PRIu32
", but missing ptr from %s to %s",
", but missing ptr from %s to %s.",
lv->name, seg->lv->name, seg->le,
seg->le + seg->len - 1,
seg->lv->name, lv->name);
@@ -854,7 +860,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
} else if (seg_found != sl->count) {
log_error("Reference count mismatch: LV %s has %u "
"links to LV %s:%" PRIu32 "-%" PRIu32
", which has %u links",
", which has %u links.",
lv->name, sl->count, seg->lv->name, seg->le,
seg->le + seg->len - 1, seg_found);
inc_error_count;
@@ -869,7 +875,7 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
if (!seg_found) {
log_error("LV segment %s:%" PRIu32 "-%" PRIu32
" is incorrectly listed as being used by LV %s",
" is incorrectly listed as being used by LV %s.",
seg->lv->name, seg->le, seg->le + seg->len - 1,
lv->name);
inc_error_count;
@@ -879,16 +885,16 @@ int check_lv_segments_incomplete_vg(struct logical_volume *lv)
dm_list_iterate_items(glvl, &lv->indirect_glvs) {
if (glvl->glv->is_historical) {
if (glvl->glv->historical->indirect_origin != lv->this_glv) {
log_error("LV %s is indirectly used by historical LV %s"
"but that historical LV does not point back to LV %s",
log_error("LV %s is indirectly used by historical LV %s "
"but that historical LV does not point back to LV %s.",
lv->name, glvl->glv->historical->name, lv->name);
inc_error_count;
}
} else {
if (!(seg = first_seg(glvl->glv->live)) ||
seg->indirect_origin != lv->this_glv) {
log_error("LV %s is indirectly used by LV %s"
"but that LV does not point back to LV %s",
log_error("LV %s is indirectly used by LV %s "
"but that LV does not point back to LV %s.",
lv->name, glvl->glv->live->name, lv->name);
inc_error_count;
}
@@ -913,7 +919,7 @@ static int _lv_split_segment(struct logical_volume *lv, struct lv_segment *seg,
if (!seg_can_split(seg)) {
log_error("Unable to split the %s segment at LE %" PRIu32
" in LV %s", lvseg_name(seg), le, lv->name);
" in LV %s.", lvseg_name(seg), le, lv->name);
return 0;
}
@@ -930,7 +936,7 @@ static int _lv_split_segment(struct logical_volume *lv, struct lv_segment *seg,
}
if (!str_list_dup(lv->vg->vgmem, &split_seg->tags, &seg->tags)) {
log_error("LV segment tags duplication failed");
log_error("LV segment tags duplication failed.");
return 0;
}
@@ -957,7 +963,7 @@ static int _lv_split_segment(struct logical_volume *lv, struct lv_segment *seg,
if (!set_lv_segment_area_lv(split_seg, s, seg_lv(seg, s),
seg_le(seg, s) + seg->area_len, 0))
return_0;
log_debug_alloc("Split %s:%u[%u] at %u: %s LE %u", lv->name,
log_debug_alloc("Split %s:%u[%u] at %u: %s LE %u.", lv->name,
seg->le, s, le, seg_lv(seg, s)->name,
seg_le(split_seg, s));
break;
@@ -971,14 +977,14 @@ static int _lv_split_segment(struct logical_volume *lv, struct lv_segment *seg,
seg->area_len,
split_seg, s)))
return_0;
log_debug_alloc("Split %s:%u[%u] at %u: %s PE %u", lv->name,
log_debug_alloc("Split %s:%u[%u] at %u: %s PE %u.", lv->name,
seg->le, s, le,
dev_name(seg_dev(seg, s)),
seg_pe(split_seg, s));
break;
case AREA_UNASSIGNED:
log_error("Unassigned area %u found in segment", s);
log_error("Unassigned area %u found in segment.", s);
return 0;
}
}
@@ -997,7 +1003,7 @@ int lv_split_segment(struct logical_volume *lv, uint32_t le)
struct lv_segment *seg;
if (!(seg = find_seg_by_le(lv, le))) {
log_error("Segment with extent %" PRIu32 " in LV %s not found",
log_error("Segment with extent %" PRIu32 " in LV %s not found.",
le, lv->name);
return 0;
}

View File

@@ -67,6 +67,13 @@ static int _check_pv_ext(struct cmd_context *cmd, struct volume_group *vg)
if (!(info = lvmcache_info_from_pvid(pvl->pv->dev->pvid, pvl->pv->dev, 0)))
continue;
/*
* If this vg metadata is old/outdated, it may no longer reflect the
* actual VG containing this PV, in which case we ignore this check.
*/
if (!lvmcache_verify_info_in_vg(vg, info))
continue;
ext_version = lvmcache_ext_version(info);
if (ext_version < PV_HEADER_EXTENSION_VSN) {
log_warn("WARNING: PV %s in VG %s is using an old PV header, modify the VG to update.",
@@ -3636,29 +3643,6 @@ int pv_write(struct cmd_context *cmd,
return 1;
}
int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv)
{
const char *old_vg_name = pv->vg_name;
pv->vg_name = cmd->fmt->orphan_vg_name;
pv->status = ALLOCATABLE_PV;
pv->pe_alloc_count = 0;
if (!dev_get_size(pv->dev, &pv->size)) {
log_error("%s: Couldn't get size.", pv_dev_name(pv));
return 0;
}
if (!pv_write(cmd, pv, 0)) {
log_error("Failed to clear metadata from physical "
"volume \"%s\" after removal from \"%s\"",
pv_dev_name(pv), old_vg_name);
return 0;
}
return 1;
}
/**
* is_orphan_vg - Determine whether a vg_name is an orphan
* @vg_name: pointer to the vg_name
@@ -4671,13 +4655,15 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
const char *vgname,
const char *vgid,
unsigned precommitted,
int writing)
int writing,
int *incorrect_pv_claim)
{
const struct format_type *fmt = cmd->fmt;
struct format_instance *fid = NULL;
struct format_instance_ctx fic;
struct volume_group *vg, *vg_ret = NULL;
struct metadata_area *mda, *mda2;
struct pv_list *pvl;
unsigned use_precommitted = precommitted;
struct device *mda_dev, *dev_ret = NULL;
struct cached_vg_fmtdata *vg_fmtdata = NULL; /* Additional format-specific data about the vg */
@@ -4915,7 +4901,15 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
* Also, outdated PVs that have been removed from the VG were incorrectly
* attached to the vginfo during label_scan, and now need to be detached.
*/
lvmcache_update_vg_from_read(vg_ret, vg_ret->status & PRECOMMITTED);
lvmcache_update_vg_from_read(vg_ret, incorrect_pv_claim);
/* Undo set_pv_devices for PVs that are incorrectly claimed. */
if (incorrect_pv_claim) {
dm_list_iterate_items(pvl, &vg_ret->pvs) {
if (pvl->pv->wrong_vg)
pvl->pv->dev = NULL;
}
}
/*
* lvmcache_update_vg identified outdated mdas that we read above that
@@ -4949,6 +4943,8 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
int original_vgid_set = vgid ? 1 : 0;
int writing = (vg_read_flags & READ_FOR_UPDATE);
int activating = (vg_read_flags & READ_FOR_ACTIVATE);
int is_duplicate_vgname;
int incorrect_pv_claim = 0;
*error_flags = SUCCESS;
if (error_vg)
@@ -5024,14 +5020,16 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
}
}
is_duplicate_vgname = lvmcache_has_duplicate_local_vgname(vgid, vg_name);
/*
* vgchange -ay (no vgname arg) will activate multiple local VGs with the same
* name, but if the vgs have the same lv name, activating those lvs will fail.
*/
if (activating && original_vgid_set && lvmcache_has_duplicate_local_vgname(vgid, vg_name))
if (activating && original_vgid_set && is_duplicate_vgname)
log_warn("WARNING: activating multiple VGs with the same name is dangerous and may fail.");
if (!(vg = _vg_read(cmd, vg_name, vgid, 0, writing))) {
if (!(vg = _vg_read(cmd, vg_name, vgid, 0, writing, &incorrect_pv_claim))) {
unlock_vg(cmd, NULL, vg_name);
/* Some callers don't care if the VG doesn't exist and don't want an error message. */
if (!(vg_read_flags & READ_OK_NOTFOUND))
@@ -5080,11 +5078,14 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
/* The obvious and common case of a missing device. */
if ((vg_is_foreign(vg) && !cmd->include_foreign_vgs) || cmd->expect_missing_vg_device)
log_debug("VG %s is missing PV %s (last written to %s)", vg_name, uuidstr, pvl->pv->device_hint ?: "na");
log_debug("VG %s is missing PV %s (last written to %s)",
is_duplicate_vgname ? vgid : vg_name, uuidstr, pvl->pv->device_hint ?: "na");
else if (pvl->pv->device_hint)
log_warn("WARNING: VG %s is missing PV %s (last written to %s).", vg_name, uuidstr, pvl->pv->device_hint);
log_warn("WARNING: VG %s is missing PV %s (last written to %s).",
is_duplicate_vgname ? vgid : vg_name, uuidstr, pvl->pv->device_hint);
else
log_warn("WARNING: VG %s is missing PV %s.", vg_name, uuidstr);
log_warn("WARNING: VG %s is missing PV %s.",
is_duplicate_vgname ? vgid : vg_name, uuidstr);
missing_pv_dev++;
} else if (pvl->pv->status & MISSING_PV) {
@@ -5158,6 +5159,18 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
goto bad;
}
/*
* If the VG metadata is referencing PVs that don't belong to it,
* then don't allow the VG to be modified or activated, to avoid
* damanging those PVs.
*/
if (incorrect_pv_claim) {
log_error("Cannot use VG %s referencing incorrect PVs.", vg->name);
log_error("(See vgreduce --removemissing with --devices options.)");
failure |= FAILED_NOT_ENABLED;
goto bad;
}
if (!cmd->handles_missing_pvs && (missing_pv_dev || missing_pv_flag)) {
log_error("Cannot change VG %s while PVs are missing.", vg->name);
log_error("See vgreduce --removemissing and vgextend --restoremissing.");

View File

@@ -381,8 +381,6 @@ int get_default_pvmetadatasize_sectors(void);
void set_pe_align(struct physical_volume *pv, uint64_t data_alignment);
void set_pe_align_offset(struct physical_volume *pv, uint64_t data_alignment_offset);
int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv);
int check_dev_block_size_for_vg(struct device *dev, const struct volume_group *vg,
unsigned int *max_logical_block_size_found);
int check_pv_dev_sizes(struct volume_group *vg);

View File

@@ -376,15 +376,15 @@ struct lv_segment *find_pool_seg(const struct lv_segment *seg)
struct seg_list *sl;
dm_list_iterate_items(sl, &seg->lv->segs_using_this_lv) {
/* Needs to be he only item in list */
/* Needs to be the only item in list */
if (lv_is_pending_delete(sl->seg->lv))
continue;
if (pool_seg) {
log_error("%s is referenced by more then one segments (%s, %s).",
log_error("%s is referenced by more than one segment (%s, %s).",
display_lvname(seg->lv), display_lvname(pool_seg->lv),
display_lvname(sl->seg->lv));
return NULL; /* More then one segment */
return NULL; /* More than one segment */
}
pool_seg = sl->seg;

View File

@@ -63,6 +63,7 @@ struct physical_volume {
/* This is true whenever the represented PV has a label associated. */
uint64_t is_labelled:1;
uint64_t unused_missing_cleared:1;
uint64_t wrong_vg:1; /* vg metadata includes this PVID but the PV is actually in a different vg */
/* NB. label_sector is valid whenever is_labelled is true */
uint64_t label_sector;

View File

@@ -643,7 +643,7 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
* Assisted excl_local activation of lvl listed LVs before resume
*
* FIXME: code which needs to use this function is usually unsafe
* against crashes as it's doing more then 1 operation per commit
* against crashes as it's doing more than 1 operation per commit
* and as such is currently irreversible on error path.
*
* Function is not making backup as this is usually not the last

View File

@@ -415,7 +415,7 @@ int thin_pool_check_overprovisioning(const struct logical_volume *lv)
/* Thin sum size is above VG size */
txt = " and the size of whole volume group";
else if ((sz = vg_free(lv->vg)) < thinsum)
/* Thin sum size is more then free space in a VG */
/* Thin sum size is more than free space in a VG */
txt = !sz ? "" : " and the amount of free space in volume group";
else if ((max_threshold > 99) || !min_percent)
/* There is some free space in VG, but it is not configured
@@ -624,8 +624,8 @@ int update_thin_pool_lv(struct logical_volume *lv, int activate)
if (activate) {
/* If the pool is not active, do activate deactivate */
monitored = dmeventd_monitor_mode();
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
if (DMEVENTD_MONITOR_IGNORE != (monitored = dmeventd_monitor_mode()))
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
if (!lv_is_active(lv)) {
/*
* FIXME:
@@ -660,6 +660,9 @@ int update_thin_pool_lv(struct logical_volume *lv, int activate)
}
}
/* Unlock memory if possible */
memlock_unlock(lv->vg->cmd);
if (!sync_local_dev_names(lv->vg->cmd)) {
log_error("Failed to sync local devices LV %s.",
display_lvname(lv));
@@ -673,11 +676,8 @@ int update_thin_pool_lv(struct logical_volume *lv, int activate)
}
init_dmeventd_monitor(monitored);
/* Unlock memory if possible */
memlock_unlock(lv->vg->cmd);
if (!ret)
return_0;
return 0;
}
dm_list_init(&(first_seg(lv)->thin_messages));
@@ -922,7 +922,7 @@ int update_thin_pool_params(struct cmd_context *cmd,
*crop_metadata = get_thin_pool_crop_metadata(cmd, *crop_metadata, pool_metadata_size);
if ((max_pool_data_size / extent_size) < pool_data_extents) {
log_error("Selected chunk size %s cannot address more then %s of thin pool data space.",
log_error("Selected chunk size %s cannot address more than %s of thin pool data space.",
display_size(cmd, *chunk_size), display_size(cmd, max_pool_data_size));
return 0;
}

View File

@@ -303,7 +303,7 @@ static int _add_log(struct dm_pool *mem, struct lv_segment *seg,
log_warn_suppress(seg->lv->vg->cmd->mirror_warn_printed,
"WARNING: Mirror %s without monitoring will not react on failures.",
display_lvname(seg->lv));
seg->lv->vg->cmd->mirror_warn_printed = 1; /* Do not print this more then once */
seg->lv->vg->cmd->mirror_warn_printed = 1; /* Do not print this more than once */
} else
log_flags |= DM_BLOCK_ON_ERROR;
}

View File

@@ -121,9 +121,9 @@ void init_dmeventd_monitor(int reg)
_dmeventd_monitor = reg;
}
void init_disable_dmeventd_monitoring(int reg)
void init_disable_dmeventd_monitoring(int disable)
{
_disable_dmeventd_monitoring = reg;
_disable_dmeventd_monitoring = disable;
}
void init_background_polling(int polling)
@@ -233,9 +233,9 @@ const char *log_command_file(void)
return _log_command_file;
}
void init_error_message_produced(int value)
void init_error_message_produced(int produced)
{
_error_message_produced = value;
_error_message_produced = produced;
}
int error_message_produced(void)

View File

@@ -299,7 +299,7 @@ bool raid_is_available(const struct logical_volume *lv)
lv_is_partial(seg_lv(seg, s)))
missing_legs++;
/* Degradation: segtype raid1 may miss legs-1, raid0/4/5/6 may loose parity devices. */
/* Degradation: segtype raid1 may miss legs-1, raid0/4/5/6 may lose parity devices. */
return missing_legs <= (seg_is_raid1(seg) ? seg->area_count - 1 : seg->segtype->parity_devs);
}

View File

@@ -43,7 +43,7 @@ daemon_handle daemon_open(daemon_info i)
if (connect(h.socket_fd,(struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
h.error = errno;
log_sys_error("connect", i.socket);
log_debug("socket connect error %d for %s", h.error, i.socket);
goto error;
}

View File

@@ -105,16 +105,15 @@ static void _daemon_close_descriptor(int fd, unsigned suppress_warnings,
* Note: when 'from_fd' is set to -1, unused 'custom_fds' must use same value!
*
* command: print command name with warning message
* suppress_warning: whether to print warning messages
* suppress_warnings: whether to print warning messages
* above_fd: close all descriptors above this descriptor
* custom_fds: preserve descriptors from this set of descriptors
*/
static int daemon_close_stray_fds(const char *command, int suppress_warning,
static int daemon_close_stray_fds(const char *command, int suppress_warnings,
int from_fd, const struct custom_fds *custom_fds)
{
struct rlimit rlim;
int fd;
unsigned suppress_warnings = 0;
pid_t ppid = getppid();
char parent_cmdline[64];
static const char _fd_dir[] = DEFAULT_PROC_DIR "/self/fd";
@@ -147,7 +146,7 @@ static int daemon_close_stray_fds(const char *command, int suppress_warning,
if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
fd = 256; /* just have to guess */
else if ((fd = (int)rlim.rlim_cur) > 65536)
fd = 65536; /* do not bother with more then 64K fds */
fd = 65536; /* do not bother with more than 64K fds */
while (--fd > from_fd) {
if ((fd != custom_fds->out) &&

View File

@@ -267,6 +267,7 @@ dm_tree_node_set_thin_external_origin
dm_tree_node_set_thin_pool_discard
dm_tree_node_set_thin_pool_error_if_no_space
dm_tree_node_set_udev_flags
dm_tree_node_size_changed
dm_tree_preload_children
dm_tree_retry_remove
dm_tree_set_cookie

View File

@@ -145,8 +145,8 @@ int dm_bit_get_last(dm_bitset_t bs)
/*
* Based on the Linux kernel __bitmap_parselist from lib/bitmap.c
*/
dm_bitset_t dm_bitset_parse_list(const char *str, struct dm_pool *mem,
size_t min_num_bits)
DM_EXPORT_NEW_SYMBOL(dm_bitset_t, dm_bitset_parse_list, 1_02_138)
(const char *str, struct dm_pool *mem, size_t min_num_bits)
{
unsigned a, b;
int c, old_c, totaldigits, ndigits;

View File

@@ -659,7 +659,8 @@ void *dm_tree_node_get_context(const struct dm_tree_node *node)
return node->context;
}
int dm_tree_node_size_changed(const struct dm_tree_node *dnode)
DM_EXPORT_NEW_SYMBOL(int, dm_tree_node_size_changed, 1_02_110)
(const struct dm_tree_node *dnode)
{
return dnode->props.size_changed;
}

View File

@@ -30,6 +30,7 @@
struct selection {
struct dm_pool *mem;
struct dm_pool *regex_mem;
struct selection_node *selection_root;
int add_new_fields;
};
@@ -203,7 +204,9 @@ static const struct op_def _op_log[] = {
struct selection_str_list {
struct dm_str_list str_list;
unsigned type; /* either SEL_AND or SEL_OR */
struct dm_regex *regex;
size_t regex_num_patterns;
unsigned type; /* either SEL_LIST_LS or SEL_LIST_SUBSET_LS with either SEL_AND or SEL_OR */
};
struct field_selection_value {
@@ -1410,8 +1413,11 @@ struct dm_report *dm_report_init(uint32_t *report_types,
void dm_report_free(struct dm_report *rh)
{
if (rh->selection)
if (rh->selection) {
dm_pool_destroy(rh->selection->mem);
if (rh->selection->regex_mem)
dm_pool_destroy(rh->selection->regex_mem);
}
if (rh->value_cache)
dm_hash_destroy(rh->value_cache);
dm_pool_destroy(rh->mem);
@@ -1749,8 +1755,74 @@ static int _cmp_field_time(struct dm_report *rh,
return 0;
}
static int _str_list_item_match_regex(const struct str_list_sort_value *val, unsigned int i, struct dm_regex *regex)
{
struct pos_len *item = val->items + i;
char *s = (char *) (val->value + item->pos);
char c = s[item->len];
int r;
/*
* The val->items contains the whole string list in the form of a single string,
* where each item is delimited by a delimiter.
*
* The item->pos + item->len pair then points to the exact item within the val->items.
*
* The dm_regex_match accepts a string, not the pos + len pair, so we need to adapt here:
* replace the delimiter with '\0' temporarily so the item is a proper string.
*/
s[item->len] = '\0';
r = dm_regex_match(regex, s);
s[item->len] = c;
return r;
}
static size_t _bitset_count_set(dm_bitset_t bs)
{
size_t i, size = bs[0]/DM_BITS_PER_INT + 1;
size_t count = 0;
for (i = 1; i <= size; i++)
count += hweight32(bs[i]);
return count;
}
/* Matches if all items from selection string list match list value strictly 1:1. */
static int _cmp_field_string_list_strict_all(const struct str_list_sort_value *val,
static int _cmp_field_string_list_strict_regex_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
dm_bitset_t bs;
int r;
if (!val->items)
return (sel->regex_num_patterns == 1) && dm_regex_match(sel->regex, "") >= 0;
if (!(bs = dm_bitset_create(rh->selection->mem, sel->regex_num_patterns))) {
log_error("Failed to create bitset for regex match counter.");
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
if ((r = _str_list_item_match_regex(val, i, sel->regex)) < 0) {
r = 0;
goto out;
}
dm_bit_set(bs, r);
}
r = _bitset_count_set(bs) == sel->regex_num_patterns;
out:
dm_pool_free(rh->selection->mem, bs);
return r;
}
/* Matches if all items from selection string list match list value strictly 1:1. */
static int _cmp_field_string_list_strict_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int sel_list_size = dm_list_size(&sel->str_list.list);
@@ -1782,7 +1854,36 @@ static int _cmp_field_string_list_strict_all(const struct str_list_sort_value *v
}
/* Matches if all items from selection string list match a subset of list value. */
static int _cmp_field_string_list_subset_all(const struct str_list_sort_value *val,
static int _cmp_field_string_list_subset_regex_all(const struct dm_report *rh,
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
dm_bitset_t bs;
unsigned int i;
int r;
if (!val->items)
return (sel->regex_num_patterns == 1) && dm_regex_match(sel->regex, "") >= 0;
if (!(bs = dm_bitset_create(rh->selection->mem, sel->regex_num_patterns))) {
log_error("Failed to create bitset for regex match counter.");
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
if ((r = _str_list_item_match_regex(val, i, sel->regex)) < 0)
continue;
dm_bit_set(bs, r);
}
r = _bitset_count_set(bs) == sel->regex_num_patterns;
dm_pool_free(rh->selection->mem, bs);
return r;
}
/* Matches if all items from selection string list match a subset of list value. */
static int _cmp_field_string_list_subset_all(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int sel_list_size = dm_list_size(&sel->str_list.list);
@@ -1817,8 +1918,26 @@ static int _cmp_field_string_list_subset_all(const struct str_list_sort_value *v
}
/* Matches if any item from selection string list matches list value. */
static int _cmp_field_string_list_any(const struct str_list_sort_value *val,
const struct selection_str_list *sel)
static int _cmp_field_string_list_subset_regex_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
if (!val->items)
return dm_regex_match(sel->regex, "") >= 0;
for (i = 1; i <= val->items[0].pos; i++) {
if (_str_list_item_match_regex(val, i, sel->regex) >= 0)
return 1;
}
return 0;
}
/* Matches if any item from selection string list matches list value. */
static int _cmp_field_string_list_subset_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
struct dm_str_list *sel_item;
unsigned int i;
@@ -1847,7 +1966,59 @@ static int _cmp_field_string_list_any(const struct str_list_sort_value *val,
return 0;
}
static int _cmp_field_string_list(struct dm_report *rh __attribute__((unused)),
/* Matches if all items from list value can be matched by any item from selection list. */
static int _cmp_field_string_list_strict_regex_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
unsigned int i;
if (!val->items)
return dm_regex_match(sel->regex, "") >= 0;
for (i = 1; i <= val->items[0].pos; i++) {
if (_str_list_item_match_regex(val, i, sel->regex) < 0)
return 0;
}
return 1;
}
/* Matches if all items from list value can be matched by any item from selection list. */
static int _cmp_field_string_list_strict_any(const struct dm_report *rh __attribute__((unused)),
const struct str_list_sort_value *val,
const struct selection_str_list *sel)
{
struct dm_str_list *sel_item;
unsigned int i;
int match;
/* match blank string list with selection that contains blank string */
if (!val->items) {
dm_list_iterate_items(sel_item, &sel->str_list.list) {
if (!strcmp(sel_item->str, ""))
return 1;
}
return 0;
}
for (i = 1; i <= val->items[0].pos; i++) {
match = 0;
dm_list_iterate_items(sel_item, &sel->str_list.list) {
if ((strlen(sel_item->str) == val->items[i].len) &&
!strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len)) {
match = 1;
break;
}
}
if (!match)
return 0;
}
return 1;
}
static int _cmp_field_string_list(struct dm_report *rh,
uint32_t field_num, const char *field_id,
const struct str_list_sort_value *val,
struct field_selection *fs)
@@ -1869,11 +2040,16 @@ static int _cmp_field_string_list(struct dm_report *rh __attribute__((unused)),
switch (sel->type & SEL_MASK) {
case SEL_AND:
r = subset ? _cmp_field_string_list_subset_all(val, sel)
: _cmp_field_string_list_strict_all(val, sel);
r = subset ? sel->regex ? _cmp_field_string_list_subset_regex_all(rh, val, sel)
: _cmp_field_string_list_subset_all(rh, val, sel)
: sel->regex ? _cmp_field_string_list_strict_regex_all(rh, val, sel)
: _cmp_field_string_list_strict_all(rh, val, sel);
break;
case SEL_OR:
r = _cmp_field_string_list_any(val, sel);
r = subset ? sel->regex ? _cmp_field_string_list_subset_regex_any(rh, val, sel)
: _cmp_field_string_list_subset_any(rh, val, sel)
: sel->regex ? _cmp_field_string_list_strict_regex_any(rh, val, sel)
: _cmp_field_string_list_strict_any(rh, val, sel);
break;
default:
log_error(INTERNAL_ERROR "_cmp_field_string_list: unsupported string "
@@ -1907,7 +2083,17 @@ static int _compare_selection_field(struct dm_report *rh,
}
if (fs->flags & FLD_CMP_REGEX)
r = _cmp_field_regex((const char *) f->sort_value, fs);
switch (f->props->flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_STRING:
r = _cmp_field_regex((const char *) f->sort_value, fs);
break;
case DM_REPORT_FIELD_TYPE_STRING_LIST:
r = _cmp_field_string_list(rh, f->props->field_num, field_id, (const struct str_list_sort_value *) f->sort_value, fs);
break;
default:
log_error(INTERNAL_ERROR "_compare_selection_field: regex: incorrect type %" PRIu32 " for field %s",
f->props->flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
}
else {
switch(f->props->flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_PERCENT:
@@ -1934,7 +2120,8 @@ static int _compare_selection_field(struct dm_report *rh,
r = _cmp_field_time(rh, f->props->field_num, field_id, *(const time_t *) f->sort_value, fs);
break;
default:
log_error(INTERNAL_ERROR "_compare_selection_field: unknown field type for field %s", field_id);
log_error(INTERNAL_ERROR "_compare_selection_field: incorrect type %" PRIu32 " for field %s",
f->props->flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
}
}
@@ -2626,11 +2813,9 @@ static int _check_reserved_values_supported(const struct dm_report_field_type fi
static const char *_tok_value_regex(struct dm_report *rh,
const struct dm_report_field_type *ft,
const char *s, const char **begin,
const char **end, uint32_t *flags,
struct reserved_value_wrapper *rvw)
const char **end, uint32_t *flags)
{
char c;
rvw->reserved = NULL;
s = _skip_space(s);
@@ -2693,7 +2878,8 @@ static int _add_item_to_string_list(struct dm_pool *mem, const char *begin,
static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
struct dm_pool *mem, const char *s,
const char **begin, const char **end,
struct selection_str_list **sel_str_list)
struct selection_str_list **sel_str_list,
uint32_t *flags)
{
static const char _str_list_item_parsing_failed[] = "Failed to parse string list value "
"for selection field %s.";
@@ -2707,12 +2893,11 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
int list_end = 0;
char c;
if (!(ssl = dm_pool_alloc(mem, sizeof(*ssl)))) {
log_error("_tok_value_string_list: memory allocation failed for selection list");
if (!(ssl = dm_pool_zalloc(mem, sizeof(*ssl)))) {
log_error("_tok_value_string_list: memory allocation failed for selection list.");
goto bad;
}
dm_list_init(&ssl->str_list.list);
ssl->type = 0;
*begin = s;
if (!(op_flags = _tok_op_log(s, &tmp, SEL_LIST_LS | SEL_LIST_SUBSET_LS))) {
@@ -2724,7 +2909,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
}
if (!_add_item_to_string_list(mem, begin_item, end_item, &ssl->str_list.list))
goto_bad;
ssl->type = SEL_OR | SEL_LIST_LS;
ssl->type = SEL_OR | SEL_LIST_SUBSET_LS;
goto out;
}
@@ -2799,12 +2984,17 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
else
ssl->type |= SEL_LIST_SUBSET_LS;
/* Sort the list. */
if (!(list_size = dm_list_size(&ssl->str_list.list))) {
log_error(INTERNAL_ERROR "_tok_value_string_list: list has no items");
goto bad;
} else if (list_size == 1)
goto out;
if (*flags & FLD_CMP_REGEX)
/* No need to sort the list for regex. */
goto out;
/* Sort the list. */
if (!(arr = dm_malloc(sizeof(item) * list_size))) {
log_error("_tok_value_string_list: memory allocation failed for sort array");
goto bad;
@@ -3320,7 +3510,10 @@ static const char *_tok_value(struct dm_report *rh,
s = _skip_space(s);
s = _get_reserved(rh, expected_type, field_num, implicit, s, begin, end, rvw);
/* recognize possible reserved value (but not in a regex) */
if (!(*flags & FLD_CMP_REGEX))
s = _get_reserved(rh, expected_type, field_num, implicit, s, begin, end, rvw);
if (rvw->reserved) {
/*
* FLD_CMP_NUMBER shares operators with FLD_CMP_TIME,
@@ -3331,17 +3524,24 @@ static const char *_tok_value(struct dm_report *rh,
else if (expected_type == DM_REPORT_FIELD_TYPE_NUMBER)
*flags &= ~FLD_CMP_TIME;
*flags |= expected_type;
/* if we matched a reserved value, skip further processing of this token */
return s;
}
switch (expected_type) {
case DM_REPORT_FIELD_TYPE_STRING:
c = _get_and_skip_quote_char(&s);
if (!(s = _tok_value_string(s, begin, end, c, SEL_AND | SEL_OR | SEL_PRECEDENCE_PE, NULL))) {
log_error("Failed to parse string value "
"for selection field %s.", ft->id);
return NULL;
if (*flags & FLD_CMP_REGEX) {
if (!(s = _tok_value_regex(rh, ft, s, begin, end, flags)))
return NULL;
} else {
c = _get_and_skip_quote_char(&s);
if (!(s = _tok_value_string(s, begin, end, c, SEL_AND | SEL_OR | SEL_PRECEDENCE_PE, NULL))) {
log_error("Failed to parse string value "
"for selection field %s.", ft->id);
return NULL;
}
}
*flags |= DM_REPORT_FIELD_TYPE_STRING;
break;
@@ -3350,7 +3550,7 @@ static const char *_tok_value(struct dm_report *rh,
if (!(str_list = (struct selection_str_list **) custom))
goto_bad;
s = _tok_value_string_list(ft, mem, s, begin, end, str_list);
s = _tok_value_string_list(ft, mem, s, begin, end, str_list, flags);
if (!(*str_list)) {
log_error("Failed to parse string list value "
"for selection field %s.", ft->id);
@@ -3434,7 +3634,7 @@ static const char *_tok_value(struct dm_report *rh,
return s;
bad:
log_error(INTERNAL_ERROR "Forbidden NULL custom detected.");
log_error(INTERNAL_ERROR "_tok_value: Forbidden NULL custom parameter detected.");
return NULL;
}
@@ -3505,6 +3705,19 @@ static int _get_reserved_value(struct dm_report *rh, uint32_t field_num,
return 1;
}
static struct dm_regex *_selection_regex_create(struct selection *selection, const char * const *patterns,
unsigned num_patterns)
{
if (!selection->regex_mem) {
if (!(selection->regex_mem = dm_pool_create("report selection regex", 32 * 1024))) {
log_error("Failed to create report selection regex memory pool.");
return NULL;
}
}
return dm_regex_create(selection->regex_mem, patterns, num_patterns);
}
static struct field_selection *_create_field_selection(struct dm_report *rh,
uint32_t field_num,
int implicit,
@@ -3522,7 +3735,11 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
struct time_value *tval;
uint64_t factor;
char *s;
const char *s_array[2] = { 0 };
const char *s_arr_single[2] = { 0 };
const char **s_arr;
size_t s_arr_size;
struct dm_str_list *sl;
size_t i;
dm_list_iterate_items(fp, &rh->field_props) {
if ((fp->implicit == implicit) && (fp->field_num == field_num)) {
@@ -3587,21 +3804,53 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
/* store comparison operand */
if (flags & FLD_CMP_REGEX) {
/* REGEX */
if (!(s = dm_malloc(len + 1))) {
log_error("dm_report: dm_malloc failed to store "
"regex value for selection field %s", field_id);
goto error;
}
memcpy(s, v, len);
s[len] = '\0';
s_array[0] = s;
switch (flags & DM_REPORT_FIELD_TYPE_MASK) {
case DM_REPORT_FIELD_TYPE_STRING:
if (!(s = malloc(len + 1))) {
log_error("dm_report: malloc failed to store "
"regex value for selection field %s", field_id);
goto error;
}
memcpy(s, v, len);
s[len] = '\0';
s_arr_single[0] = s;
fs->value->v.r = dm_regex_create(rh->selection->mem, s_array, 1);
dm_free(s);
if (!fs->value->v.r) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
fs->value->v.r = _selection_regex_create(rh->selection, s_arr_single, 1);
free(s);
if (!fs->value->v.r) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
}
break;
case DM_REPORT_FIELD_TYPE_STRING_LIST:
if (!custom)
goto bad;
fs->value->v.l = *((struct selection_str_list **) custom);
s_arr_size = dm_list_size(&fs->value->v.l->str_list.list);
if (!(s_arr = malloc(sizeof(char *) * s_arr_size))) {
log_error("dm_report: malloc failed for regex array "
"for selection field %s", field_id);
goto error;
}
i = 0;
dm_list_iterate_items(sl, &fs->value->v.l->str_list.list)
s_arr[i++] = sl->str;
fs->value->v.l->regex = _selection_regex_create(rh->selection, s_arr, s_arr_size);
fs->value->v.l->regex_num_patterns = s_arr_size;
free(s_arr);
if (!fs->value->v.l->regex) {
log_error("dm_report: failed to create regex "
"matcher for selection field %s", field_id);
goto error;
}
break;
default:
log_error(INTERNAL_ERROR "_create_field_selection: regex: incorrect type %" PRIu32 " for field %s",
flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
goto error;
}
} else {
/* STRING, NUMBER, SIZE, PERCENT, STRING_LIST, TIME */
@@ -3715,8 +3964,8 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
}
break;
default:
log_error(INTERNAL_ERROR "_create_field_selection: "
"unknown type of selection field %s", field_id);
log_error(INTERNAL_ERROR "_create_field_selection: incorrect type %" PRIu32 " for field %s",
flags & DM_REPORT_FIELD_TYPE_MASK, field_id);
goto error;
}
}
@@ -3727,7 +3976,7 @@ error_field_id:
field_id);
goto error;
bad:
log_error(INTERNAL_ERROR "Forbidden NULL custom detected.");
log_error(INTERNAL_ERROR "_create_field_selection: Forbidden NULL custom detected.");
error:
dm_pool_free(rh->selection->mem, fs);
@@ -3863,7 +4112,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
char *tmp;
char c;
/* field name */
/* get field name */
if (!(last = _tok_field_name(s, &ws, &we))) {
log_error("Expecting field name");
goto bad;
@@ -3896,7 +4145,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
} else
ft = &rh->fields[field_num];
/* comparison operator */
/* get comparison operator */
if (!(flags = _tok_op_cmp(we, &last))) {
_display_selection_help(rh);
log_error("Unrecognised comparison operator: %s", we);
@@ -3908,50 +4157,49 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
goto bad;
}
/* comparison value */
/* check we can use the operator with the field */
if (flags & FLD_CMP_REGEX) {
/*
* REGEX value
*/
if (!(last = _tok_value_regex(rh, ft, last, &vs, &ve, &flags, &rvw)))
goto_bad;
} else {
/*
* STRING, NUMBER, SIZE, PERCENT, STRING_LIST, TIME value
*/
if (flags & FLD_CMP_NUMBER) {
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_NUMBER |
DM_REPORT_FIELD_TYPE_SIZE |
DM_REPORT_FIELD_TYPE_PERCENT |
DM_REPORT_FIELD_TYPE_TIME))) {
_display_selection_help(rh);
log_error("Operator can be used only with number, size, time or percent fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_TIME) {
if (!(ft->flags & DM_REPORT_FIELD_TYPE_TIME)) {
_display_selection_help(rh);
log_error("Operator can be used only with time fields: %s", ws);
goto bad;
}
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_STRING |
DM_REPORT_FIELD_TYPE_STRING_LIST))) {
_display_selection_help(rh);
log_error("Operator can be used only with string or string list fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_NUMBER) {
if (!(ft->flags & (DM_REPORT_FIELD_TYPE_NUMBER |
DM_REPORT_FIELD_TYPE_SIZE |
DM_REPORT_FIELD_TYPE_PERCENT |
DM_REPORT_FIELD_TYPE_TIME))) {
_display_selection_help(rh);
log_error("Operator can be used only with number, size, time or percent fields: %s", ws);
goto bad;
}
} else if (flags & FLD_CMP_TIME) {
if (!(ft->flags & DM_REPORT_FIELD_TYPE_TIME)) {
_display_selection_help(rh);
log_error("Operator can be used only with time fields: %s", ws);
goto bad;
}
if (ft->flags == DM_REPORT_FIELD_TYPE_SIZE ||
ft->flags == DM_REPORT_FIELD_TYPE_NUMBER ||
ft->flags == DM_REPORT_FIELD_TYPE_PERCENT)
custom = &factor;
else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME)
custom = &tval;
else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST)
custom = &str_list;
else
custom = NULL;
if (!(last = _tok_value(rh, ft, field_num, implicit,
last, &vs, &ve, &flags,
&rvw, rh->selection->mem, custom)))
goto_bad;
}
/* assign custom structures to hold extra information for specific value types */
if (ft->flags == DM_REPORT_FIELD_TYPE_SIZE ||
ft->flags == DM_REPORT_FIELD_TYPE_NUMBER ||
ft->flags == DM_REPORT_FIELD_TYPE_PERCENT)
custom = &factor;
else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME)
custom = &tval;
else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST)
custom = &str_list;
else
custom = NULL;
/* get value to compare with */
if (!(last = _tok_value(rh, ft, field_num, implicit,
last, &vs, &ve, &flags,
&rvw, rh->selection->mem, custom)))
goto_bad;
*next = _skip_space(last);
/* create selection */
@@ -4092,7 +4340,7 @@ error:
static int _alloc_rh_selection(struct dm_report *rh)
{
if (!(rh->selection = dm_pool_zalloc(rh->mem, sizeof(struct selection))) ||
!(rh->selection->mem = dm_pool_create("report selection", 10 * 1024))) {
!(rh->selection->mem = dm_pool_create("report selection", 1024))) {
log_error("Failed to allocate report selection structure.");
if (rh->selection)
dm_pool_free(rh->mem, rh->selection);

View File

@@ -169,7 +169,7 @@ int dm_vasprintf(char **result, const char *format, va_list aq)
}
if (i > 1) {
/* Reallocating more then once? */
/* Reallocating more than once? */
if (!(*result = dm_strdup(buf))) {
dm_free(buf);
return -1;
@@ -591,7 +591,7 @@ const char *dm_size_to_string(struct dm_pool *mem, uint64_t size,
if ((s < NUM_UNIT_PREFIXES) &&
((unit_type == 'R') || (unit_type == 'r'))) {
/* When the rounding would cause difference, add '<' prefix
* i.e. 2043M is more then 1.9949G prints <2.00G
* i.e. 2043M is more than 1.9949G prints <2.00G
* This version is for 2 digits fixed precision */
d = 100. * (double) size / byte;
if (!_close_enough(floorl(d), nearbyintl(d)))

View File

@@ -120,7 +120,7 @@ int dm_get_status_raid(struct dm_pool *mem, const char *params,
if (!(pp = _skip_fields(p, 1)))
goto_bad;
/* Raid target can actually report more then real number of legs in a case
/* Raid target can actually report more than real number of legs in a case
* raid legs have been removed during initial raid array resynchronization */
if (i > (pp - p - 1))
i = pp - p - 1;
@@ -512,7 +512,7 @@ int dm_get_status_mirror(struct dm_pool *mem, const char *params,
pos += used;
if (num_devs > DM_MIRROR_MAX_IMAGES) {
log_error(INTERNAL_ERROR "More then " DM_TO_STRING(DM_MIRROR_MAX_IMAGES)
log_error(INTERNAL_ERROR "More than " DM_TO_STRING(DM_MIRROR_MAX_IMAGES)
" reported in mirror status.");
goto out;
}

View File

@@ -146,7 +146,7 @@ SEE_ALSO=$(srcdir)/see_also.end
.PRECIOUS: %.8_gen
%.8_gen: $(srcdir)/%.8_des $(srcdir)/%.8_end $(MANGENERATOR) $(TESTMAN)
%.8_gen: $(srcdir)/%.8_des $(srcdir)/%.8_end $(MANGENERATOR) $(TESTMAN) $(SEE_ALSO)
$(Q)set -e ; ( \
if [ ! -s $(TESTMAN) ] ; then \
cat $(srcdir)/$(@:%.8_gen=%.8_pregen) \

View File

@@ -1,4 +1,18 @@
.TH "BLKDEACTIVATE" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "BLKDEACTIVATE" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.SH NAME
.
@@ -6,26 +20,26 @@ blkdeactivate \(em utility to deactivate block devices
.
.SH SYNOPSIS
.
.ad l
.nh
.B blkdeactivate
.RB [ -d
.NSY blkdeactivate 1
.RB [ -d | --dmoptions\ \c
.IR dm_options ]
.RB [ -e ]
.RB [ -h ]
.RB [ -l
.RB [ -e | --errors ]
.RB [ -h | --help ]
.RB [ -l | --lvmoptions\ \c
.IR lvm_options ]
.RB [ -m
.IR mpath_options ]
.RB [ -r
.RB [ -r | --mdraidoptions\ \c
.IR mdraid_options ]
.RB [ -o
.RB [ -m | --mpathoptions\ \c
.IR mpath_options ]
.RB [ -u | --umount ]
.RB [ -o | --vdooptions\ \c
.IR vdo_options ]
.RB [ -u ]
.RB [ -v ]
.RB [ -v | --verbose ]
.RI [ device ]
.
.PD
.ad
.hy
.ad b
.
.SH DESCRIPTION
.
@@ -41,16 +55,23 @@ MD devices are handled using the \fBmdadm\fP(8) command.
.SH OPTIONS
.
.TP
.BR -d | --dmoptions " " \fIdm_options
\fB-d\fP|\fB--dmoptions\fP \fIdm_options\fP
Comma separated list of device-mapper specific options.
Accepted \fBdmsetup\fP(8) options are:
.br
Accepted
.BR dmsetup (8)
options are:
.
.RS
.
.TP
.B retry
Retry removal several times in case of failure.
.
.TP
.B force
Force device removal.
.
.RE
.
.TP
@@ -65,12 +86,14 @@ the device was skipped.
Display the help text.
.
.TP
.BR -l | --lvmoptions " " \fIlvm_options
\fB-l\fP|\fB--lvmoptions\fP \fIlvm_options\fP
Comma-separated list of LVM specific options:
.RS
.
.TP
.B retry
Retry removal several times in case of failure.
.
.TP
.B wholevg
Deactivate the whole LVM Volume Group when processing a Logical Volume.
@@ -79,34 +102,31 @@ each Logical Volume separately.
.RE
.
.TP
.BR -r | --mdraidoptions " " \fImdraid_options
\fB-r\fP|\fB--mdraidoptions\fP \fImdraid_options\fP
Comma-separated list of MD RAID specific options:
.
.RS
.
.TP
.B wait
Wait MD device's resync, recovery or reshape action to complete
before deactivation.
.
.RE
.
.TP
.BR -m | --mpathoptions " " \fImpath_options
\fB-m\fP|\fB--mpathoptions\fP \fImpath_options\fP
Comma-separated list of device-mapper multipath specific options:
.
.RS
.
.TP
.B disablequeueing
Disable queueing on all multipath devices before deactivation.
This avoids a situation where blkdeactivate may end up waiting if
all the paths are unavailable for any underlying device-mapper multipath
device.
.RE
.
.TP
.BR -o | --vdooptions " " \fIvdo_options
Comma-separated list of VDO specific options:
.RS
.TP
.BR configfile = \fIfile
Use specified VDO configuration file.
.RE
.
.TP
@@ -115,7 +135,19 @@ Unmount a mounted device before trying to deactivate it.
Without this option used, a device that is mounted is not deactivated.
.
.TP
.BR -v ", " --verbose
\fB-o\fP|\fB--vdooptions\fP \fIvdo_options\fP
Comma-separated list of VDO specific options:
.
.RS
.
.TP
\fBconfigfile\fP=\fIfile\fP
Use specified VDO configuration file.
.
.RE
.
.TP
.BR -v | --verbose
Run in verbose mode. Use \fB-vv\fP for even more verbose mode.
.
.SH EXAMPLES
@@ -123,41 +155,40 @@ Run in verbose mode. Use \fB-vv\fP for even more verbose mode.
Deactivate all supported block devices found in the system, skipping mounted
devices.
.br
#
.B blkdeactivate
.P
Deactivate all supported block devices found in the system, unmounting any
mounted devices first, if possible.
.br
#
.B blkdeactivate -u
.P
Deactivate the device /dev/vg/lvol0 together with all its holders, unmounting
any mounted devices first, if possible.
.br
#
.na
.B blkdeactivate -u /dev/vg/lvol0
.P
Deactivate all supported block devices found in the system. If the deactivation
of a device-mapper device fails, retry it. Deactivate the whole
Volume Group at once when processing an LVM Logical Volume.
.br
#
.na
.B blkdeactivate -u -d retry -l wholevg
.P
Deactivate all supported block devices found in the system. If the deactivation
of a device-mapper device fails, retry it and force removal.
.br
#
.B blkdeactivate -d force,retry
.
.SH SEE ALSO
.
.nh
.ad l
.BR dmsetup (8),
.BR lsblk (8),
.na
.BR lvm (8),
.P
.BR dmsetup (8),
.P
.BR lsblk (8),
.BR mdadm (8),
.BR multipathd (8),
.BR vdo (8),

View File

@@ -1,15 +1,33 @@
.TH CMIRRORD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.SH NAME
.
cmirrord \(em cluster mirror log daemon
.
.SH SYNOPSIS
.
.B cmirrord
.NSY cmirrord 1
.RB [ -f | --foreground ]
.RB [ -h | --help ]
.
.PD
.ad
.hy
.
.SH DESCRIPTION
.
\fBcmirrord\fP is the daemon that tracks mirror log information in a cluster.
@@ -34,13 +52,17 @@ mirror log daemon.
.TP
.BR -f | --foreground
Do not fork and log to the terminal.
.
.TP
.BR -h | --help
Print usage.
.
.SH SEE ALSO
.
.nh
.na
.BR lvmlockd (8),
.BR lvm (8),
.P
.BR syslog (3),
.BR signal (7)

View File

@@ -1,17 +1,31 @@
.TH DMEVENTD 8 "DM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.SH NAME
.
dmeventd \(em Device-mapper event daemon
.
.SH SYNOPSIS
.
.B dmeventd
.NSY dmeventd 1
.RB [ -d
.RB [ -d
.RB [ -d ]]]
.RB [ -e
.BR exit_on_path ]
.RB [ -e\ \c
.IR exit_on_path ]
.RB [ -f ]
.RB [ -h ]
.RB [ -i ]
@@ -20,6 +34,10 @@ dmeventd \(em Device-mapper event daemon
.RB [ -V ]
.RB [ -? ]
.
.PD
.ad
.hy
.
.SH DESCRIPTION
.
dmeventd is the event monitoring daemon for device-mapper devices.
@@ -39,7 +57,7 @@ debug messages sent to syslog.
Each extra d adds more debugging information.
.
.TP
.B -e exit_on_path
\fB-e\fP \fIexit_on_path\fP
Specifies the file path whose presence is checked by the daemon when it
receives a signal (SIGINT, SIGTERM) and allows to exit even if there are still
monitored devices.
@@ -86,14 +104,12 @@ Show version of dmeventd.
.TP
.B Mirror
Attempts to handle device failure automatically.
.br
See
.BR lvm.conf (5).
.
.TP
.B Raid
Attempts to handle device failure automatically.
.br
See
.BR lvm.conf (5).
.
@@ -111,15 +127,15 @@ it gets umounted if possible.
.B Thin
Monitors how full a thin pool data and metadata is becoming and emits
a warning to syslog when it exceeds 80% full.
The warning is repeated when more then 85%, 90% and 95%
The warning is repeated when more than 85%, 90% and 95%
of the thin pool is filled. See
.BR lvm.conf (5).
When a thin pool fills over 50% (data or metadata) thin plugin calls
configured \fBdmeventd/thin_command\fP with every 5% increase.
configured \fBdmeventd/\:thin_command\fP with every 5% increase.
With default setting it calls internal
\fBlvm lvextend --use-policies\fP to resize thin pool
when it's been filled above configured threshold
\fBactivation/thin_pool_autoextend_threshold\fP.
\fBactivation/\:thin_pool\%_auto\%extend\%_threshold\fP.
If the command fails, dmeventd thin plugin will keep
retrying execution with increasing time delay between
retries up to 42 minutes.
@@ -130,26 +146,28 @@ use \fBfstrim\fP(8) to free recover space in a thin pool,
but also can use \fBlvextend --use-policies\fP if other actions
have not released enough space.
Command is executed with environmental variable
\fBLVM_RUN_BY_DMEVENTD=1\fP so any lvm2 command executed
in this environment will not try to interact with dmeventd.
To see the fullness of a thin pool command may check these
two environmental variables
\fBDMEVENTD_THIN_POOL_DATA\fP and \fBDMEVENTD_THIN_POOL_\:METADATA\fP.
\fBLVM_RUN_BY\%_DM\%EVENTD=1\fP
so any lvm2 command executed in this environment
will not try to interact with dmeventd.
To see the fullness of a thin pool command
may check these two environmental variables
\fBDMEVENTD\%_THIN\%_POOL\%_DATA\fP and
\fBDMEVENTD\%_THIN\%_POOL\%_METADATA\fP.
Command can also read status with tools like \fBlvs\fP(8).
.
.TP
.B Vdo
Monitors how full a VDO pool data is becoming and emits
a warning to syslog when it exceeds 80% full.
The warning is repeated when more then 85%, 90% and 95%
The warning is repeated when more than 85%, 90% and 95%
of the VDO pool is filled. See
.BR lvm.conf (5).
When a VDO pool fills over 50% vdo plugin calls
configured \fBdmeventd/vdo_command\fP with every 5% increase.
configured \fBdmeventd/\:vdo_command\fP with every 5% increase.
With default setting it calls internal
\fBlvm lvextend --use-policies\fP to resize VDO pool
when it's been filled above the configured threshold
\fBactivation/vdo_pool_autoextend_threshold\fP.
\fBactivation/\:vdo_pool\%_auto\%extend\%_threshold\fP.
If the command fails, dmeventd vdo plugin will keep
retrying execution with increasing time delay between
retries up to 42 minutes.
@@ -157,10 +175,10 @@ User may also configure external command to support more advanced
maintenance operations of a VDO pool.
Such external command can e.g. remove some unneeded space
with \fBfstrim\fP(8),
but also can use \fBlvextend --use-policies\fP if other actions
have not released enough space.
but also can use \fBlvextend --use-policies\fP
if other actions have not released enough space.
Command is executed with environmental variable
\fBLVM_RUN_BY_DMEVENTD=1\fP so any lvm2 command executed
\fBLVM_RUN_BY\%_DMEVENTD=1\fP so any lvm2 command executed
in this environment will not try to interact with dmeventd.
To see the fullness of a VDO pool command may check this
environmental variable \fBDMEVENTD_VDO_POOL\fP.
@@ -170,19 +188,22 @@ Command can also read status with tools like \fBlvs\fP(8).
.
.TP
.B DMEVENTD_THIN_POOL_DATA
Variable is set by thin plugin and is available to executed program. Value present
actual usage of thin pool data volume. Variable is not set when error event
is processed.
Variable is set by thin plugin and is available to executed program.
Value present actual usage of thin pool data volume.
Variable is not set when error event is processed.
.
.TP
.B DMEVENTD_THIN_POOL_METADATA
Variable is set by thin plugin and is available to executed program. Value present
actual usage of thin pool metadata volume. Variable is not set when error event
is processed.
Variable is set by thin plugin and is available to executed program.
Value present actual usage of thin pool metadata volume.
Variable is not set when error event is processed.
.
.TP
.B DMEVENTD_VDO_POOL
Variable is set by vdo plugin and is available to executed program. Value present
actual usage of VDO pool data volume. Variable is not set when error event
is processed.
Variable is set by vdo plugin and is available to executed program.
Value present actual usage of VDO pool data volume.
Variable is not set when error event is processed.
.
.TP
.B LVM_RUN_BY_DMEVENTD
Variable is set by thin and vdo plugin to prohibit recursive interaction
@@ -191,8 +212,10 @@ a thin_command, vdo_command environment.
.
.SH SEE ALSO
.
.nh
.na
.BR lvm (8),
.BR lvm.conf (5),
.BR lvextend (8),
.br
.P
.BR fstrim (8)

View File

@@ -1,5 +1,28 @@
.TH DMFILEMAPD 8 "Dec 17 2016" "Linux" "MAINTENANCE COMMANDS"
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.de OPT_FD
. I file_descriptor
..
@@ -26,21 +49,16 @@ dmfilemapd \(em device-mapper filemap monitoring daemon
.
.SH SYNOPSIS
.
.de CMD_DMFILEMAPD
. ad l
. nh
. BR dmfilemapd
. OPT_FD
. OPT_GROUP
. OPT_PATH
. OPT_MODE
. OPT_DEBUG
. hy
. ad b
..
.CMD_DMFILEMAPD
.NSY dmfilemapd 1
.OPT_FD
.OPT_GROUP
.OPT_PATH
.OPT_MODE
.OPT_DEBUG
.
.PD
.ad
.hy
.
.SH DESCRIPTION
.
@@ -83,11 +101,15 @@ and the \fImode\fP option for more information.
.OPT_MODE
The filemap monitoring mode the daemon.
Use either
.na
.nh
.B inode
(\fBDM_FILEMAP_FOLLOW_INODE\fP), or
.B path
(\fBDM_FILEMAP_FOLLOW_PATH\fP), to enable follow-inode or
follow-path mode respectively.
(\fBDM_FILEMAP_FOLLOW_PATH\fP),
to enable follow-inode or follow-path mode respectively.
.hy
.ad
.
.TP
.RI [ foreground ]
@@ -113,26 +135,26 @@ cause the daemon to terminate.
.P
In both modes, the daemon will always shut down when the group
being monitored is deleted.
.P
.
.TP
.B Follow inode
.P
The daemon follows the inode of the file, as it was at the time the
daemon started. The file descriptor referencing the file is kept
open at all times, and the daemon will exit when it detects that
the file has been unlinked and it is the last holder of a reference
to the file.
.P
.sp
This mode is useful if the file is expected to be renamed, or moved
within the file system, while it is being monitored.
.P
.
.TP
.B Follow path
.P
The daemon follows the path that was given on the daemon command
line. The file descriptor referencing the file is re-opened on each
iteration of the daemon, and the daemon will exit if no file exists
at this location (a tolerance is allowed so that a brief delay
between removal and replacement is permitted).
.P
.sp
This mode is useful if the file is updated by unlinking the original
and placing a new file at the same path.
.
@@ -143,7 +165,9 @@ extents and the regions contained in the group, however, since the
daemon can only react to new allocations once they have been written,
there are inevitably some IO events that cannot be counted when a
file is growing, particularly if the file is being extended by a
single thread writing beyond EOF (for example, the \fBdd\fP program).
single thread writing beyond EOF (for example, the
.BR dd (1)
program).
.P
There is a further loss of events in that there is currently no way
to atomically resize a \fBdmstats\fP region and preserve its current
@@ -164,17 +188,14 @@ manually for debugging or testing purposes.
.P
Start the daemon in the background, in follow-path mode
.br
#
.B dmfilemapd 3 0 /srv/images/vm.img path 0 0 3< /srv/images/vm.img
.br
.P
Start the daemon in follow-inode mode, disable forking and enable
verbose logging
.br
.ad l
#
.B dmfilemapd 3 0 /var/tmp/data inode 1 3 3< /var/tmp/data
.nf
.P
.EX
Starting dmfilemapd with fd=3, group_id=0 mode=inode, path=/var/tmp/data
dm version [ opencount flush ] [16384] (*1)
dm info (253:0) [ opencount flush ] [16384] (*1)
@@ -185,22 +206,24 @@ dm_stats_walk_init: initialized flags to 4000000000000
starting stats walk with GROUP
exiting _filemap_monitor_get_events() with deleted=0, check=0
Waiting for check interval
.fi
.ad b
.EE
.
.SH AUTHORS
.
Bryn M. Reeves <bmr@redhat.com>
.MT bmr@redhat.com
Bryn M. Reeves
.ME
.
.SH SEE ALSO
.
.nh
.na
.BR dmstats (8)
.P
LVM2 resource page:
.UR https://www.sourceware.org/lvm2
LVM2 resource page:
.UE
.br
.UR http://www.sourceware.org/lvm2
Device-mapper resource page:
.UR http://sources.redhat.com/dm
.UE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,18 @@
.TH "FSADM" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "FSADM" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.SH "NAME"
.
@@ -6,22 +20,20 @@ fsadm \(em utility to resize or check filesystem on a device
.
.SH SYNOPSIS
.
.PD 0
.ad l
.TP 6
.B fsadm
.NSY fsadm 1
.RI [ options ]
.BR check
.IR device
.B check
.I device
.
.TP
.B fsadm
.NSY fsadm
.RI [ options ]
.BR resize
.IR device
.B resize
.I device
.RI [ new_size ]
.ad b
.
.PD
.ad
.hy
.
.SH DESCRIPTION
.
@@ -31,16 +43,16 @@ It tries to use the same API for
.BR ext2 ,
.BR ext3 ,
.BR ext4 ,
.BR ReiserFS
.B ReiserFS
and
.BR XFS
.B XFS
filesystem.
.
.SH OPTIONS
.
.TP
.BR -e | --ext-offline
Unmount ext2/ext3/ext4 filesystem before doing resize.
Unmount ext2/\:ext3/\:ext4 filesystem before doing resize.
.
.TP
.BR -f | --force
@@ -70,10 +82,12 @@ Answer "yes" at any prompts.
.
.TP
.BR -c | --cryptresize
Resize dm-crypt mapping together with filesystem detected on the device. The dm-crypt device must be recognizable by cryptsetup(8).
Resize dm-crypt mapping together with filesystem detected on the device.
The dm-crypt device must be recognizable by cryptsetup(8).
.
.TP
.BR \fInew_size [ B | K | M | G | T | P | E ]
.IR new_size [\c
.BR B | K | M | G | T | P | E ]
Absolute number of filesystem blocks to be in the filesystem,
or an absolute size using a suffix (in powers of 1024).
If new_size is not supplied, the whole device is used.
@@ -82,19 +96,19 @@ If new_size is not supplied, the whole device is used.
.
On successful completion, the status code is 0.
A status code of 2 indicates the operation was interrupted by the user.
A status code of 3 indicates the requested check operation could not be performed
because the filesystem is mounted and does not support an online
A status code of 3 indicates the requested check operation
could not be performed because the filesystem is mounted
and does not support an online
.BR fsck (8).
A status code of 1 is used for other failures.
.
.SH EXAMPLES
.
Resize the filesystem on logical volume \fI/dev/vg/test\fP to 1000 megabytes.
Resize the filesystem on logical volume \fI/dev/vg/test\fP to 1000\ MiB.
If \fI/dev/vg/test\fP contains ext2/ext3/ext4
filesystem it will be unmounted prior the resize.
All [y/n] questions will be answered 'y'.
.P
#
.B fsadm -e -y resize /dev/vg/test 1000M
.
.SH ENVIRONMENT VARIABLES
@@ -102,6 +116,7 @@ All [y/n] questions will be answered 'y'.
.TP
.B TMPDIR
The temporary directory name for mount points. Defaults to "\fI/tmp\fP".
.
.TP
.B DM_DEV_DIR
The device directory name.
@@ -110,7 +125,7 @@ Defaults to "\fI/dev\fP" and must be an absolute path.
.SH SEE ALSO
.
.nh
.ad l
.na
.BR lvm (8),
.BR lvresize (8),
.BR lvm.conf (5),

File diff suppressed because it is too large Load Diff

View File

@@ -46,12 +46,13 @@ Convert a mirror LV to a raid1 LV with the same number of images.
.br
.B lvconvert --type raid1 vg/lvol1
.P
Convert a linear LV to a two-way mirror LV, allocating new extents from specific
PV ranges.
Convert a linear LV to a two-way mirror LV, allocating new extents
from specific PV ranges.
.br
.B lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15
.P
Convert a mirror LV to a linear LV, freeing physical extents from a specific PV.
Convert a mirror LV to a linear LV,
freeing physical extents from a specific PV.
.br
.B lvconvert --type linear vg/lvol1 /dev/sda
.P
@@ -75,10 +76,8 @@ Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
.P
Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
.br
.B lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1
.RS
.B vg/lvol1 /dev/sd[fgh]1
.RE
.B lvconvert --replace /dev/sdb1 --replace /dev/sdc1 \
--replace /dev/sdd1 vg/lvol1 /dev/sd[fgh]1
.P
Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a raid6 LV.
.br
@@ -92,7 +91,7 @@ through thinLV and for the conversion set the pool metadata size to 1GiB.
Convert an LV into a thin-pool with VDO deduplication and compression
for storing its data.
.br
.B lvconvert --type thin-pool --pooldatavdo y vg/lvol1
.B lvconvert --type thin-pool --pooldatavdo y vg/lvol1
.P
Convert an LV into a thin LV in the specified thin pool. The existing LV
is used as an external read-only origin for the new thin LV.
@@ -103,10 +102,7 @@ Convert an LV into a thin LV in the specified thin pool. The existing LV
is used as an external read-only origin for the new thin LV, and is
renamed "external".
.br
.B lvconvert --type thin --thinpool vg/tpool1
.RS
.B --originname external vg/lvol1
.RE
.B lvconvert --type thin --thinpool vg/tpool1 --originname external vg/lvol1
.P
Convert an LV to a cache pool LV using another specified LV for cache pool
metadata.

File diff suppressed because it is too large Load Diff

View File

@@ -28,8 +28,9 @@ to improve performance.
.P
VDO LVs are also provisioned volumes from a VDO pool, and are created with a
virtual size rather than a physical size (see \fBlvmvdo\fP(7)).
.P
.
.SS Usage notes
.
In the usage section below, \fB--size\fP \fISize\fP can be replaced
with \fB--extents\fP \fINumber\fP. See descriptions in the options section.
.P

View File

@@ -1,25 +1,25 @@
.
.SH EXAMPLES
.
.P
Create a striped LV with 3 stripes, a stripe size of 8 KiB and a size of 100 MiB.
Create a striped LV with 3 stripes, a stripe size of 8\ KiB
and a size of 100\ MiB.
The LV name is chosen by lvcreate.
.br
.B lvcreate -i 3 -I 8 -L 100m vg00
.P
Create a raid1 LV with two images, and a usable size of 500 MiB. This
operation requires two devices, one for each mirror image. RAID metadata
(superblock and bitmap) is also included on the two devices.
Create a raid1 LV with two images, and a usable size of 500\ MiB.
This operation requires two devices, one for each mirror image.
RAID metadata (superblock and bitmap) is also included on the two devices.
.br
.B lvcreate --type raid1 -m1 -L 500m -n mylv vg00
.P
Create a mirror LV with two images, and a usable size of 500 MiB.
Create a mirror LV with two images, and a usable size of 500\ MiB.
This operation requires three devices: two for mirror images and
one for a disk log.
.br
.B lvcreate --type mirror -m1 -L 500m -n mylv vg00
.P
Create a mirror LV with 2 images, and a usable size of 500 MiB.
Create a mirror LV with 2 images, and a usable size of 500\ MiB.
This operation requires 2 devices because the log is in memory.
.br
.B lvcreate --type mirror -m1 --mirrorlog core -L 500m -n mylv vg00
@@ -33,17 +33,17 @@ for overwriting 20% of the size of the original LV.
.br
.B lvcreate -s -l 20%ORIGIN -n mysnap vg00/mylv
.P
Create a sparse LV with 1 TiB of virtual space, and actual space just under
100 MiB.
Create a sparse LV with 1 TiB of virtual space,
and actual space just under 100\ MiB.
.br
.B lvcreate --snapshot --virtualsize 1t --size 100m --name mylv vg00
.P
Create a linear LV with a usable size of 64 MiB on specific physical extents.
Create a linear LV with a usable size of 64\ MiB on specific physical extents.
.br
.B lvcreate -L 64m -n mylv vg00 /dev/sda:0-7 /dev/sdb:0-7
.P
Create a RAID5 LV with a usable size of 5 GiB, 3 stripes, a stripe size of
64 KiB, using a total of 4 devices (including one for parity).
64\ KiB, using a total of 4 devices (including one for parity).
.br
.B lvcreate --type raid5 -L 5G -i 3 -I 64 -n mylv vg00
.P
@@ -52,14 +52,12 @@ PVs in the VG (note that the command will fail if there are more than 8 PVs in
the VG, in which case \fB-i 7\fP must be used to get to the current maximum of
8 devices including parity for RaidLVs).
.br
.B lvcreate --config allocation/raid_stripe_all_devices=1
.RS
.B --type raid5 -l 100%FREE -n mylv vg00
.RE
.B lvcreate --config allocation/\:raid_stripe_all_devices=1 \
--type raid5 -l 100%FREE -n mylv vg00
.P
Create RAID10 LV with a usable size of 5 GiB, using 2 stripes, each on
a two-image mirror. (Note that the \fB-i\fP and \fB-m\fP arguments behave
differently:
Create RAID10 LV with a usable size of 5 GiB, using 2 stripes,
each on a two-image mirror.
(Note that the \fB-i\fP and \fB-m\fP arguments behave differently:
\fB-i\fP specifies the total number of stripes,
but \fB-m\fP specifies the number of images in addition
to the first image).
@@ -70,17 +68,15 @@ Create a 1 TiB thin LV mythin, with 256 GiB thinpool tpool0 in vg00.
.br
.B lvcreate -T -V 1T --size 256G --name mythin vg00/tpool0
.P
Create a 1 TiB thin LV, first creating a new thin pool for it, where
the thin pool has 100 MiB of space, uses 2 stripes, has a 64 KiB stripe
size, and 256 KiB chunk size.
Create a 1 TiB thin LV, first creating a new thin pool for it,
where the thin pool has 100\ MiB of space, uses 2 stripes,
has a 64\ KiB stripe size, and 256\ KiB chunk size.
.br
.B lvcreate --type thin --name mylv --thinpool mypool
.RS
.B -V 1t -L 100m -i 2 -I 64 -c 256 vg00
.RE
.B lvcreate --type thin --name mylv --thinpool mypool -V 1t \
-L 100m -i 2 -I 64 -c 256 vg00
.P
Create a thin snapshot of a thin LV (the size option must not be
used, otherwise a copy-on-write snapshot would be created).
Create a thin snapshot of a thin LV (the size option must not be used,
otherwise a copy-on-write snapshot would be created).
.br
.B lvcreate --snapshot --name mysnap vg00/thinvol
.P
@@ -97,10 +93,7 @@ then be used to cache an LV.
Create a cache LV, first creating a new origin LV on a slow physical device,
then combining the new origin LV with an existing cache pool.
.br
.B lvcreate --type cache --cachepool my_cpool
.RS
.B -L 100G -n mylv vg00 /dev/slow1
.RE
.B lvcreate --type cache --cachepool my_cpool -L 100G -n mylv vg00 /dev/slow1
.P
Create a VDO LV vdo0 with VDOPoolLV size of 10 GiB and name vpool1.
.br

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,220 @@
.TH LVM FULLREPORT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_aligned
.OPS aligned
..
.de O_all
.OPS a all
..
.de O_binary
.OPS binary
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_configreport
.OPA configreport
\%\fBlog\fP|\:\
\fBvg\fP|\:\
\fBlv\fP|\:\
\fBpv\fP|\:\
\fBpvseg\fP|\:\
\fBseg\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_foreign
.OPS foreign
..
.de O_headings
.OPA headings
\%\fBnone\fP|\:\
\fBabbrev\fP|\:\
\fBfull\fP|\:\
\fB0\fP|\:\
\fB1\fP|\:\
\fB2\fP
..
.de O_help
.OPS h help
..
.de O_ignorelockingfailure
.OPS ignorelockingfailure
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_logonly
.OPS logonly
..
.de O_longhelp
.OPS longhelp
..
.de O_nameprefixes
.OPS nameprefixes
..
.de O_noheadings
.OPS noheadings
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_nosuffix
.OPS nosuffix
..
.de O_options
.OPA o options
\fIString\fP
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_readonly
.OPS readonly
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_rows
.OPS rows
..
.de O_select
.OPA S select
\fIString\fP
..
.de O_separator
.OPA separator
\fIString\fP
..
.de O_shared
.OPS shared
..
.de O_sort
.OPA O sort
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_unbuffered
.OPS unbuffered
..
.de O_units
.OPA units
\%[\fINumber\fP]\fBr\fP|\:\
\fBR\fP|\:\
\fBh\fP|\:\
\fBH\fP|\:\
\fBb\fP|\:\
\fBB\fP|\:\
\fBs\fP|\:\
\fBS\fP|\:\
\fBk\fP|\:\
\fBK\fP|\:\
\fBm\fP|\:\
\fBM\fP|\:\
\fBg\fP|\:\
\fBG\fP|\:\
\fBt\fP|\:\
\fBT\fP|\:\
\fBp\fP|\:\
\fBP\fP|\:\
\fBe\fP|\:\
\fBE\fP
..
.de O_unquoted
.OPS unquoted
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvm fullreport \(em Display full report
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvm fullreport\fP
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.br
[ \fIposition_args\fP ]
.br
[ \fIposition_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -23,202 +226,267 @@ if information changes between commands.
.
.SH USAGE
.
\fBlvm fullreport\fP
.br
.RS 4
.ad l
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
.br
[ \fB-a\fP|\fB--all\fP ]
.br
[ \fB-o\fP|\fB--options\fP \fIString\fP ]
.br
[ \fB-O\fP|\fB--sort\fP \fIString\fP ]
.br
[ \fB--configreport\fP \fBlog\fP|\fBvg\fP|\fBlv\fP|\fBpv\fP|\fBpvseg\fP|\fBseg\fP ]
.br
[ \fB--foreign\fP ]
.br
[ \fB--ignorelockingfailure\fP ]
.br
[ \fB--logonly\fP ]
.br
[ \fB--readonly\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
.br
[ \fB--shared\fP ]
.br
[ \fB--units\fP \c
.nh
\%[\fINumber\fP]\fBr\fP|\:\fBR\fP|\:\fBh\fP|\:\fBH\fP|\:\fBb\fP|\:\fBB\fP|\:\fBs\fP|\:\fBS\fP|\:\fBk\fP|\:\fBK\fP|\:\fBm\fP|\:\fBM\fP|\:\fBg\fP|\:\fBG\fP|\:\fBt\fP|\:\fBT\fP|\:\fBp\fP|\:\fBP\fP|\:\fBe\fP|\:\fBE\fP
.hy
.na
.B lvm fullreport
.RS
[
.O_select
]
.br
[ \fB--aligned\fP ]
[
.O_all
]
.br
[ \fB--binary\fP ]
[
.O_options
]
.br
[ \fB--headings\fP \fBnone\fP|\fBabbrev\fP|\fBfull\fP|\fB0\fP|\fB1\fP|\fB2\fP ]
[
.O_sort
]
.br
[ \fB--nameprefixes\fP ]
[
.O_configreport
]
.br
[ \fB--noheadings\fP ]
[
.O_foreign
]
.br
[ \fB--nosuffix\fP ]
[
.O_ignorelockingfailure
]
.br
[ \fB--rows\fP ]
[
.O_logonly
]
.br
[ \fB--separator\fP \fIString\fP ]
[
.O_readonly
]
.br
[ \fB--unbuffered\fP ]
[
.O_reportformat
]
.br
[ \fB--unquoted\fP ]
[
.O_shared
]
.br
[
.O_units
]
.br
[
.O_aligned
]
.br
[
.O_binary
]
.br
[
.O_headings
]
.br
[
.O_nameprefixes
]
.br
[
.O_noheadings
]
.br
[
.O_nosuffix
]
.br
[
.O_rows
]
.br
[
.O_separator
]
.br
[
.O_unbuffered
]
.br
[
.O_unquoted
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.RS 4
[ \fIVG\fP ... ]
.br
[ \fIVG\fP\ .\|.\|.\& ]
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.TP
.O_aligned
Use with --separator to align the output columns.
.
.HP
\fB--aligned\fP
.br
Use with --separator to align the output columns
.TP
.O_all
Show information about internal LVs.
These are components of normal LVs, such as mirrors,
which are not independently accessible, e.g. not mountable.
List all VGs. Equivalent to not specifying any VGs.
Show information about devices that have not been initialized
by LVM, i.e. they are not PVs.
.
.HP
\fB-a\fP|\fB--all\fP
.br
.
.HP
\fB--binary\fP
.br
.TP
.O_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).
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB--configreport\fP \fBlog\fP|\fBvg\fP|\fBlv\fP|\fBpv\fP|\fBpvseg\fP|\fBseg\fP
.br
.TP
.O_configreport
See \fBlvmreport\fP(7).
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB--foreign\fP
.br
.TP
.O_foreign
Report/display foreign VGs that would otherwise be skipped.
See \fBlvmsystemid\fP(7) for more information about foreign VGs.
.
.HP
\fB--headings\fP \fBnone\fP|\fBabbrev\fP|\fBfull\fP|\fB0\fP|\fB1\fP|\fB2\fP
.br
.TP
.O_headings
Type of headings to use in report output.
\fBnone\fP or \fB0\fP: No headings.
\fBabbrev\fP or \fB1\fP: Column name abbreviations.
\fBfull\fP or \fB2\fP: Full column names.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--ignorelockingfailure\fP
.br
.TP
.O_ignorelockingfailure
Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -226,65 +494,57 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--logonly\fP
.br
.TP
.O_logonly
Suppress command report and display only log report.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nameprefixes\fP
.br
.TP
.O_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).
.
.HP
\fB--noheadings\fP
.br
.TP
.O_noheadings
Suppress the headings line that is normally the first line of output.
Useful if grepping the output.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--nosuffix\fP
.br
.TP
.O_nosuffix
Suppress the suffix on output sizes. Use with --units
(except h and H) if processing the output.
.
.HP
\fB-o\fP|\fB--options\fP \fIString\fP
.br
.TP
.O_options
Comma-separated, ordered list of fields to display in columns.
String arg syntax is: [\fB+\fP|\fB-\fP|\fB#\fP]\fIField1\fP[\fB,\fP\fIField2\fP ...]
String arg syntax is:
[\fB+\fP|\fB-\fP|\fB#\fP]\fIField1\fP[\fB,\fP\fIField2\fP ...]
The prefix \fB+\fP will append the specified fields to the default fields,
\fB-\fP will remove the specified fields from the default fields, and
\fB#\fP will compact specified fields (removing them when empty for all rows.)
Use \fB-o help\fP 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.
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 \fBlv_all\fP to view all LV fields,
\fBvg_all\fP all VG fields,
@@ -295,27 +555,23 @@ Use field name \fBlv_all\fP to view all LV fields,
See the \fBlvm.conf\fP(5) report section for more config options.
See \fBlvmreport\fP(7) for more information about reporting.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--readonly\fP
.br
.TP
.O_readonly
Prevent the command from making changes, including activation and
metadata updates. (See --permission r for read only LVs.)
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -325,63 +581,52 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB--rows\fP
.br
.TP
.O_rows
Output columns as rows.
.
.HP
\fB-S\fP|\fB--select\fP \fIString\fP
.br
.TP
.O_select
Select objects for processing and reporting based on specified criteria.
The criteria syntax is described by \fB--select help\fP and \fBlvmreport\fP(7).
For reporting commands, one row is displayed for each object matching the criteria.
The criteria syntax is described by \fB--select help\fP
and \fBlvmreport\fP(7).
For reporting commands, one row is displayed
for each object matching the criteria.
See \fB--options help\fP 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.
.
.HP
\fB--separator\fP \fIString\fP
.br
.TP
.O_separator
String to use to separate each column. Useful if grepping the output.
.
.HP
\fB--shared\fP
.br
.TP
.O_shared
Report/display shared VGs that would otherwise be skipped when
lvmlockd is not being used on the host.
See \fBlvmlockd\fP(8) for more information about shared VGs.
.
.HP
\fB-O\fP|\fB--sort\fP \fIString\fP
.br
.TP
.O_sort
Comma-separated ordered list of columns to sort by. Replaces the default
selection. Precede any column with \fB-\fP for a reverse sort on that column.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB--unbuffered\fP
.br
.TP
.O_unbuffered
Produce output immediately without sorting or aligning the columns properly.
.
.HP
.ad l
\fB--units\fP \c
.nh
\%[\fINumber\fP]\fBr\fP|\:\fBR\fP|\:\fBh\fP|\:\fBH\fP|\:\fBb\fP|\:\fBB\fP|\:\fBs\fP|\:\fBS\fP|\:\fBk\fP|\:\fBK\fP|\:\fBm\fP|\:\fBM\fP|\:\fBg\fP|\:\fBG\fP|\:\fBt\fP|\:\fBT\fP|\:\fBp\fP|\:\fBP\fP|\:\fBe\fP|\:\fBE\fP
.hy
.ad b
.br
.TP
.O_units
All sizes are output in these units:
human-(r)eadable with '<' rounding indicator,
(h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes,
@@ -389,26 +634,22 @@ human-(r)eadable with '<' rounding indicator,
Capitalise to use multiples of 1000 (S.I.) instead of 1024.
Custom units can be specified, e.g. --units 3M.
.
.HP
\fB--unquoted\fP
.br
.TP
.O_unquoted
When used with --nameprefixes, output values in the field=value
pairs are not quoted.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -418,9 +659,11 @@ answer yes. Use with extreme caution.
.TP
.I VG
Volume Group name. See \fBlvm\fP(8) for valid names.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -444,10 +687,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,134 @@
.TH LVM LVPOLL 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_abort
.OPS abort
..
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_handlemissingpvs
.OPS handlemissingpvs
..
.de O_help
.OPS h help
..
.de O_interval
.OPA i interval
\fINumber\fP
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_polloperation
.OPA polloperation
\%\fBpvmove\fP|\:\
\fBconvert\fP|\:\
\fBmerge\fP|\:\
\fBmerge_thin\fP
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvm lvpoll \(em Continue already initiated poll operation on a logical volume
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvm lvpoll\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -20,140 +139,174 @@ directly.
.
.SH USAGE
.
\fBlvm lvpoll\fP \fB--polloperation\fP \fBpvmove\fP|\fBconvert\fP|\fBmerge\fP|\fBmerge_thin\fP \fILV\fP ...
.nh
.na
.B lvm lvpoll
.O_polloperation
\fILV\fP\ .\|.\|.\&
.RS
[
.O_autobackup
]
.br
.RS 4
.ad l
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
[
.O_interval
]
.br
[ \fB-i\fP|\fB--interval\fP \fINumber\fP ]
[
.O_abort
]
.br
[ \fB--abort\fP ]
.br
[ \fB--handlemissingpvs\fP ]
[
.O_handlemissingpvs
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--abort\fP
.br
.TP
.O_abort
Stop processing a poll operation in lvmpolld.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB--handlemissingpvs\fP
.br
.TP
.O_handlemissingpvs
Allows a polling operation to continue when PVs are missing,
e.g. for repairs due to faulty devices.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB-i\fP|\fB--interval\fP \fINumber\fP
.br
.TP
.O_interval
Report progress at regular intervals.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -161,70 +314,59 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--polloperation\fP \fBpvmove\fP|\fBconvert\fP|\fBmerge\fP|\fBmerge_thin\fP
.br
.TP
.O_polloperation
The command to perform from lvmpolld.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -235,9 +377,11 @@ answer yes. Use with extreme caution.
.I LV
Logical Volume name. See \fBlvm\fP(8) for valid names.
An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -261,10 +405,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -61,41 +61,53 @@ The following commands are built into lvm without links
normally being created in the filesystem for them.
.sp
.PD 0
.
.TP 16
.B config
The same as \fBlvmconfig\fP(8) below.
.
.TP
.B devtypes
Display the recognised built-in block device types.
.
.TP
.B dumpconfig
The same as \fBlvmconfig\fP(8) below.
.
.TP
.B formats
Display recognised metadata formats.
.
.TP
.B fullreport
Report information about PVs, PV segments, VGs, LVs and LV segments,
all at once.
.
.TP
.B help
Display the help text.
.
.TP
.B lastlog
Display log report of last command run in LVM shell
if command log reporting is enabled.
.
.TP
.B lvpoll
Complete lvmpolld operations (Internal command).
.
.TP
.B segtypes
Display recognised Logical Volume segment types.
.
.TP
.B systemid
Display any system ID currently set on this host.
.
.TP
.B tags
Display any tags defined on this host.
.
.TP
.B version
Display version information.
@@ -106,135 +118,178 @@ Display version information.
The following commands implement the core LVM functionality.
.sp
.PD 0
.
.TP 16
.B pvchange
Change attributes of a Physical Volume.
.
.TP
.B pvck
Check Physical Volume metadata.
.
.TP
.B pvcreate
Initialize a disk or partition for use by LVM.
.
.TP
.B pvdisplay
Display attributes of a Physical Volume.
.
.TP
.B pvmove
Move Physical Extents.
.
.TP
.B pvremove
Remove a Physical Volume.
.
.TP
.B pvresize
Resize a disk or partition in use by LVM.
.
.TP
.B pvs
Report information about Physical Volumes.
.
.TP
.B pvscan
List Physical Volumes.
.
.TP
.B vgcfgbackup
Backup Volume Group descriptor area.
.
.TP
.B vgcfgrestore
Restore Volume Group descriptor area.
.
.TP
.B vgchange
Change attributes of a Volume Group.
.
.TP
.B vgck
Check Volume Group metadata.
.
.TP
.B vgcreate
Create a Volume Group.
.
.TP
.B vgdisplay
Display attributes of Volume Groups.
.
.TP
.B vgexport
Make volume Groups unknown to the system.
.
.TP
.B vgextend
Add Physical Volumes to a Volume Group.
.
.TP
.B vgimport
Make exported Volume Groups known to the system.
.
.TP
.B vgimportclone
Import and rename duplicated Volume Group (e.g. a hardware snapshot).
.
.TP
.B vgimportdevices
Add PVs from a VG to the devices file.
.
.TP
.B vgmerge
Merge two Volume Groups.
.
.TP
.B vgmknodes
Recreate Volume Group directory and Logical Volume special files
.
.TP
.B vgreduce
Reduce a Volume Group by removing one or more Physical Volumes.
.
.TP
.B vgremove
Remove a Volume Group.
.
.TP
.B vgrename
Rename a Volume Group.
.
.TP
.B vgs
Report information about Volume Groups.
.
.TP
.B vgscan
List Volume Groups.
.
.TP
.B vgsplit
Split a Volume Group into two, moving any logical
volumes from one Volume Group to another by moving entire Physical
Split a Volume Group into two, moving any logical volumes
from one Volume Group to another by moving entire Physical
Volumes.
.
.TP
.B lvchange
Change attributes of a Logical Volume.
.
.TP
.B lvconvert
Convert a Logical Volume from linear to mirror or snapshot.
.
.TP
.B lvcreate
Create a Logical Volume in an existing Volume Group.
.
.TP
.B lvdisplay
Display attributes of a Logical Volume.
.
.TP
.B lvextend
Extend the size of a Logical Volume.
.
.TP
.B lvmconfig
Display the configuration information after
loading \fBlvm.conf\fP(5) and any other configuration files.
.
.TP
.B lvmdevices
Manage the devices file.
.
.TP
.B lvmdiskscan
Scan for all devices visible to LVM.
.
.TP
.B lvmdump
Create LVM information dumps for diagnostic purposes.
.
.TP
.B lvreduce
Reduce the size of a Logical Volume.
.
.TP
.B lvremove
Remove a Logical Volume.
.
.TP
.B lvrename
Rename a Logical Volume.
.
.TP
.B lvresize
Resize a Logical Volume.
.
.TP
.B lvs
Report information about Logical Volumes.
.
.TP
.B lvscan
List Logical Volumes.
@@ -246,9 +301,9 @@ device-mapper driver used by LVM directly, use \fBdmsetup\fP(8).
.SH VALID NAMES
.
The valid characters for VG and LV names are:
.BR a - z
.BR A - Z
.BR 0 - 9
.BR a \(en z
.BR A \(en Z
.BR 0 \(en 9
.B + _ . -
.P
VG names cannot begin with a hyphen.
@@ -302,7 +357,6 @@ Other software and scripts should use the
amendment when the software is updated. Should you need to process the node
names in /dev/mapper, you may use \fBdmsetup splitname\fP to separate out the
original VG, LV and internal layer names.
.P
.
.SH UNIQUE NAMES
.
@@ -333,11 +387,10 @@ Tags are user-defined strings that can be attached to PVs, VGs and LVs.
Tags can be displayed with commands pvs/vgs/lvs -o tags. Certain commands
will accept a tag name in place of a PV, VG, or LV name. In these cases,
the command will operate on each PV/VG/LV with the given tag. Tags
should be prefixed with @ to avoid ambiguity.
should be prefixed with @ to avoid ambiguity.
.br
Characters allowed in tags are:
.B A-Z a-z 0-9 _ + . - / = ! : # &
.P
.B A\(enZ a\(enz 0\(en9 _ + . - / = ! : # &
.
.SH ALLOCATION
.
@@ -435,55 +488,69 @@ Message text may also change.
.B HOME
Directory containing \fI.lvm_history\fP if the internal #DEFAULT_LIBLINE#
shell is invoked.
.
.TP
.B LVM_OUT_FD
File descriptor to use for common output from LVM commands.
.
.TP
.B LVM_ERR_FD
File descriptor to use for error output from LVM commands.
.
.TP
.B LVM_REPORT_FD
File descriptor to use for report output from LVM commands.
.
.TP
.B LVM_COMMAND_PROFILE
Name of default command profile to use for LVM commands. This profile
is overridden by direct use of \fB--commandprofile\fP command line option.
.
.TP
.B LVM_RUN_BY_DMEVENTD
This variable is normally set by dmeventd plugin to inform lvm command
it is running from dmeventd plugin so lvm takes some extra action
to avoid communication and deadlocks with dmeventd.
.
.TP
.B LVM_SYSTEM_DIR
Directory containing \fBlvm.conf\fP(5) and other LVM system files.
Defaults to "\fI#DEFAULT_SYS_DIR#\fP".
.
.TP
.B LVM_SUPPRESS_FD_WARNINGS
Suppress warnings about unexpected file descriptors passed into LVM.
.
.TP
.B LVM_SUPPRESS_SYSLOG
Suppress contacting syslog.
.
.TP
.B LVM_VG_NAME
The Volume Group name that is assumed for
any reference to a Logical Volume that doesn't specify a path.
Not set by default.
.
.TP
.B LVM_LVMPOLLD_PIDFILE
Path to the file that stores the lvmpolld process ID.
.
.TP
.B LVM_LVMPOLLD_SOCKET
Path to the socket used to communicate with lvmpolld..
.
.TP
.B LVM_LOG_FILE_EPOCH
A string of up to 32 letters appended to the log filename and
followed by the process ID and a startup timestamp using
this format string "_%s_%d_%llu". When set, each process logs to a
separate file.
.
.TP
.B LVM_LOG_FILE_MAX_LINES
If more than this number of lines are sent to the log file, the command gets
aborted. Automated tests use this to terminate looping commands.
.
.TP
.B LVM_EXPECTED_EXIT_STATUS
The status anticipated when the process exits. Use ">N" to match any
@@ -493,17 +560,21 @@ file got produced, it is deleted.
and
.B LVM_EXPECTED_EXIT_STATUS
together allow automated test scripts to discard uninteresting log data.
.
.TP
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known
to be unavailable.
.
.TP
.B DM_ABORT_ON_INTERNAL_ERRORS
Abort processing if the code detects a non-fatal internal error.
.
.TP
.B DM_DISABLE_UDEV
Avoid interaction with udev. LVM will manage the relevant nodes in /dev
directly.
.
.TP
.B DM_DEBUG_WITH_LINE_NUMBERS
Prepends source file name and code line number with libdm debugging.
@@ -512,12 +583,14 @@ Prepends source file name and code line number with libdm debugging.
.
.I #DEFAULT_SYS_DIR#/lvm.conf
.br
.I #DEFAULT_SYS_DIR#/lvmlocal.conf
.br
.I $HOME/.lvm_history
.
.SH SEE ALSO
.
.nh
.ad l
.na
.BR lvm (8),
.BR lvm.conf (5),
.BR lvmconfig (8),

View File

@@ -1,4 +1,4 @@
.TH LVM.CONF 5 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.TH LVM.CONF 5 "LVM TOOLS #VERSION#" "Red Hat, Inc." \" -*- nroff -*-
.
.SH NAME
.
@@ -11,7 +11,8 @@ lvm.conf \(em Configuration file for LVM2
.SH DESCRIPTION
.
\fBlvm.conf\fP is loaded during the initialisation phase of
\fBlvm\fP(8). This file can in turn lead to other files
.BR lvm (8).
This file can in turn lead to other files
being loaded - settings read in later override earlier
settings. File timestamps are checked between commands and if
any have changed, all the files are reloaded.
@@ -45,8 +46,8 @@ The \fBcommand profile\fP is used to override selected configuration
settings at global LVM command level - it is applied at the very beginning
of LVM command execution and it is used throughout the whole time of LVM
command execution. The command profile is applied by using the
\fB--commandprofile ProfileName\fP command line option that is recognised by
all LVM2 commands.
\fB--commandprofile ProfileName\fP command line option
that is recognised by all LVM2 commands.
.P
The \fBmetadata profile\fP is used to override selected configuration
settings at Volume Group/Logical Volume level - it is applied independently
@@ -77,12 +78,15 @@ For this purpose, there's the \fBcommand_profile_template.profile\fP
by profiles of certain type. Users are encouraged to copy these template
profiles and edit them as needed. Alternatively, the
\fBlvmconfig --file <ProfileName.profile> --type profilable-command <section>\fP
or \fBlvmconfig --file <ProfileName.profile> --type profilable-metadata <section>\fP
or \fBlvmconfig --file <ProfileName.profile>
--type profilable-metadata <section>\fP
can be used to generate a configuration with profilable settings in either
of the type for given section and save it to new ProfileName.profile
(if the section is not specified, all profilable settings are reported).
.P
The profiles are stored in \fI#DEFAULT_PROFILE_DIR#\fP directory by default.
The profiles are stored in
.I #DEFAULT_PROFILE_DIR#
directory by default.
This location can be changed by using the \fBconfig/profile_dir\fP setting.
Each profile configuration is stored in \fBProfileName.profile\fP file
in the profile directory. When referencing the profile, the \fB.profile\fP
@@ -97,12 +101,17 @@ When several configuration methods are used at the same time
and when LVM looks for the value of a particular setting, it traverses
this \fBconfig cascade\fP from left to right:
.P
\fBdirect config override on command line\fP \[->]
\fBcommand profile config\fP \[->]
\fBmetadata profile config\fP \[->]
\fBtag config\fP \[->]
\fBlvmlocal.conf\fP \[->]
\fBlvm.conf\fP
.B direct config override on command line
\[->]
.B command profile config
\[->]
.B metadata profile config
\[->]
.B tag config
\[->]
.B lvmlocal.conf
\[->]
.B lvm.conf
.P
No part of this cascade is compulsory. If there's no setting value found at
the end of the cascade, a default value is used for that setting.
@@ -112,32 +121,38 @@ the default values are.
.SH SYNTAX
.
This section describes the configuration file syntax.
.LP
.P
Whitespace is not significant unless it is within quotes.
This provides a wide choice of acceptable indentation styles.
Comments begin with # and continue to the end of the line.
They are treated as whitespace.
.LP
.P
Here is an informal grammar:
.
.TP
.BR file " = " value *
A configuration file consists of a set of values.
.
.TP
.BR value " = " section " | " assignment
A value can either be a new section, or an assignment.
.
.TP
.BR section " = " identifier " '" { "' " value "* '" } '
A section groups associated values together. If the same section is
encountered multiple times, the contents of all instances are concatenated
together in the order of appearance.
.br
It is denoted by a name and delimited by curly brackets.
It is denoted by a name and delimited by curly brackets. e.g.
.br
e.g. backup {
.br
...
.br
}
backup {
.RS
.RS
\|\.\|.\|.
.RE
}
.RE
.
.TP
.BR assignment " = " identifier " '" = "' ( " array " | " type " )"
.br
@@ -147,8 +162,9 @@ forward slashes, those are interpreted as path delimiters. The statement
multiple instances of the same key are encountered, only the last value is used
(and a warning is issued).
.br
e.g. \fBlevel = 7\fP
e.g.\& \fBlevel = 7\fP
.br
.
.TP
.BR array " = '" [ "' ( " type " '" , "')* " type " '" ] "' | '" [ "' '" ] '
Inhomogeneous arrays are supported.
@@ -159,13 +175,16 @@ An empty array is acceptable.
.br
An array with one element will be correctly interpreted if the array brackets
are missing.
.
.TP
.BR type " = " integer | float | string
.BR type " = "
.BR integer | float | string
.BR integer " = [" 0 - 9 "]*"
.br
.BR float " = [" 0 - 9 "]*'" . "'[" 0 - 9 ]*
.br
.BR string " = '" \(dq "' .* '" \(dq '
.
.IP
Strings with spaces must be enclosed in double quotes, single words that start
with a letter can be left unquoted.
@@ -207,6 +226,7 @@ e.g. umask:
.B lvmconfig --type default --withcomments Section/Setting
.
.SH FILES
.
.I #DEFAULT_SYS_DIR#/lvm.conf
.br
.I #DEFAULT_SYS_DIR#/lvmlocal.conf

View File

@@ -1,4 +1,4 @@
.TH "FSADM" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "FSADM" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.SH "NAME"
.
@@ -6,14 +6,9 @@ lvm_import_vdo \(em utility to import VDO volumes into a new volume group.
.
.SH SYNOPSIS
.
.PD 0
.ad l
.TP 10
.B lvm_import_vdo
.RI [ options ]
.IR device
.
.PD
.I device
.
.SH DESCRIPTION
.
@@ -22,7 +17,8 @@ lvm_import_vdo utility imports VDO volumes created and managed by
manager into
.BR lvm2 (8)
managed VDO LV. This is realized by moving VDO superblock by 2MiB
and creating lvm2 metadata at the front of this device. The operation is not reversible,
and creating lvm2 metadata at the front of this device.
The operation is not reversible,
thus after conversion to lvm2 the access to VDO data is only possible with
.BR lvm2 (8)
commands,
@@ -58,22 +54,24 @@ Be more verbose.
Answer "yes" at any prompts.
.
.TP
.BR --dry-run
.B --dry-run
Print verbosely commands without running them.
.
.TP
.BR --no-snapshot
With this option conversion tool will not use snapshot (COW storage) for conversion
in your $TMPDIR filesystem and it will directly manipulate with VDO device in-place.
Warning: the snapshot usage makes the whole conversion transactional and
.B --no-snapshot
With this option conversion tool will not use snapshot (COW storage)
for conversion in your $TMPDIR filesystem and it will directly manipulate
with VDO device in-place.
Warning: the snapshot usage makes the whole conversion transactional and
the snapshot can be just simply merged once the whole conversion
has successfully proceeded. In the case of error the snapshot is just removed.
Without the use of snapshot there is higher risk of problems with recoverability in
case some unexpected error occurs.
Without the use of snapshot there is higher risk of problems
with recoverability in case some unexpected error occurs.
.
.TP
.BR --vdo-config
Configuration file for VDO manager. Can be used to specify configuration for vdo manager.
.B --vdo-config
Configuration file for VDO manager.
Can be used to specify configuration for vdo manager.
.
.
.SH DIAGNOSTICS
@@ -83,7 +81,8 @@ A status code of 1 is used for failure.
.
.SH EXAMPLES
.
Convert VDO volume created by vdo manager into logical volume LV1 with within volume group VG1.
Convert VDO volume created by vdo manager into logical volume LV1
with within volume group VG1.
.P
#
.B lvm_import_vdo --name VG1/LV1 /dev/mapper/vdo-volume
@@ -93,16 +92,20 @@ Convert VDO volume created by vdo manager into logical volume LV1 with within vo
.TP
.B TMPDIR
The temporary directory name for mount points. Defaults to "\fI/tmp\fP".
.
.TP
.B DM_DEV_DIR
The device directory name.
Defaults to "\fI/dev\fP" and must be an absolute path.
.
.TP
.B DM_UUID_PREFIX
Specify uuid prefix for snapshot volume used during vdo conversion.
.
.TP
.B LVM_BINARY
Allow to override command called from lvm. Defaults to "\fIlvm\fP".
.
.TP
.B VDO_BINARY
Allow to override command called from vdo. Defaults to "\fIvdo\fP".
@@ -110,8 +113,8 @@ Allow to override command called from vdo. Defaults to "\fIvdo\fP".
.SH SEE ALSO
.
.nh
.ad l
.na
.BR lvm (8),
.BR lvm.conf (5),
.P
.BR vdo (8),
.BR vdo (8)

View File

@@ -1,4 +1,13 @@
.TH "LVMAUTOACTIVATION" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMAUTOACTIVATION" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc"
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.SH NAME
.
@@ -12,11 +21,13 @@ PVs in a VG have been attached, the VG is complete, and LVs in the VG are
activated.
.P
Autoactivation of VGs, or specific LVs, can be prevented using vgchange or
lvchange --setautoactivation n. The lvm.conf auto_activation_volume_list
lvchange --set\%auto\%activation\~n. The
.BR lvm.conf (5)
.B auto_activation_volume_list
is another way to limit autoactivation.
.
.SS event autoactivation
.P
.
LVM autoactivation is "event based", in which complete VGs are activated
in response to uevents which occur during system startup or at any time
after the system has started. An old form of autoactivation was "static"
@@ -32,37 +43,41 @@ device, which triggers autoactivation.
.P
There are two variations of event based autoactivation that may be used on
a system, depending on the LVM udev rule that is installed (found in
/lib/udev/rules.d/.) The following summarizes the steps in each rule
which lead to autoactivation:
.IR /lib/udev/rules.d/ ).
The following summarizes the steps in each rule which lead to autoactivation:
.P
.B 69-dm-lvm-metad.rules
.
.IP \[bu] 2
device /dev/name with major:minor X:Y is attached to the machine
.
.IP \[bu] 2
.IP \[bu]
systemd/udev runs blkid to identify /dev/name as an LVM PV
.
.IP \[bu] 2
.IP \[bu]
udev rule 69-dm-lvm-metad.rules is run for /dev/name
.
.IP \[bu] 2
.IP \[bu]
the lvm udev rule runs the systemd service lvm2-pvscan@X:Yservice
.
.IP \[bu] 2
.IP \[bu]
the lvm2-pvscan service runs:
.br
.na
.nh
pvscan --cache -aay --major X --minor Y
.hy
.ad
.
.IP \[bu] 2
.IP \[bu]
pvscan reads the device, records that the PV is online
(see pvs_online), and checks if the VG is complete.
.
.IP \[bu] 2
.IP \[bu]
if the VG is complete, pvscan creates the vgs_online temp file,
and activates the VG.
.
.IP \[bu] 2
.IP \[bu]
the activation command output can be seen from
systemctl status lvm2-pvscan*
.P
@@ -71,112 +86,122 @@ systemctl status lvm2-pvscan*
.IP \[bu] 2
device /dev/name with major:minor X:Y is attached to the machine
.
.IP \[bu] 2
.IP \[bu]
systemd/udev runs blkid to identify /dev/name as an LVM PV
.
.IP \[bu] 2
.IP \[bu]
udev rule 69-dm-lvm.rules is run for /dev/name
.
.IP \[bu] 2
.IP \[bu]
the lvm udev rule runs:
.br
.na
.nh
pvscan --cache --listvg --checkcomplete --vgonline
.br
--autoactivation event --udevoutput --journal=output /dev/name
.hy
.ad
.
.IP \[bu] 2
.IP \[bu]
pvscan reads the device, records that the PV is online
(see pvs_online), and checks if the VG is complete.
.
.IP \[bu] 2
.IP \[bu]
if the VG is complete, pvscan creates the vgs_online temp file,
and prints the name of the VG for the udev rule to import:
LVM_VG_NAME_COMPLETE='vgname'
.
.IP \[bu] 2
.IP \[bu]
if the lvm udev rule sees LVM_VG_NAME_COMPLETE from pvscan,
it activates the VG using a transient systemd service named
lvm-activate-<vgname>.
.
.IP \[bu] 2
.IP \[bu]
the lvm-activate-<vgname> service runs
.br
vgchange -aay --autoactivation event <vgname>
.
.IP \[bu] 2
.IP \[bu]
the activation command output can be seen from
journalctl -u lvm-activate-<vgname>
.P
.
.SS pvscan options
.P
.
.TP
.B --cache
.br
Read the <device> arg (and only that device), and record that
the PV is online by creating the /run/lvm/pvs_online/<pvid>
the PV is online by creating the
.I #DEFAULT_RUN_DIR#/pvs_online/<pvid>
file containing the name of the VG and the device for the PV.
.P
.
.TP
.B -aay
.br
Activate the VG from the pvscan command
(includes implicit --checkcomplete and --vgonline.)
.P
.
.TP
.B --checkcomplete
.br
Check if the VG is complete, i.e. all PVs are present on
the system, by checking /run/lvm/pvs_online/<pvid> files.
.P
the system, by checking
.I #DEFAULT_RUN_DIR#/pvs_online/<pvid>
files.
.
.TP
.B --vgonline
.br
Create /run/lvm/vgs_online/<vgname> if the VG is complete
Create
.I #DEFAULT_RUN_DIR#/vgs_online/<vgname>
if the VG is complete
(used to ensure only one command performs activation.)
.P
.
.TP
.B --autoactivation event
.br
Inform the command it is used for event based autoactivation.
.P
.
.TP
.B --listvg
.br
Print the name of the VG using the device.
.P
.
.TP
.B --udevoutput
.br
Only print output that can be imported to the udev rule,
using the udev environment key format, i.e. NAME='value'.
.P
.
.TP
.B --journal=output
.br
Send standard command output to the journal (when stdout
is reserved for udev output.)
.P
.
.SS run files
.P
Autoactivation commands use a number of temp files in /run/lvm (with the
expectation that /run is cleared between boots.)
.P
.
Autoactivation commands use a number of temp files in
.I #DEFAULT_RUN_DIR#
(with the expectation that
.I #DEFAULT_PID_DIR#
is cleared between boots).
.
.TP
.B pvs_online
.br
pvscan --cache creates a file here for each PV that is attached. The file
is named with the PVID and contains the VG name and device information.
The existence of the file is used to determine when all PVs for a given VG
are present. The device information in these files is also used to
optimize locating devices for a VG when the VG is activated.
.P
.
.TP
.B pvs_lookup
.br
pvscan --cache creates a file here named for a VG (if one doesn't already
exist.) The file contains a list of PVIDs in the VG. This is needed when
a PV is processed which has no VG metadata, in which case the list of
PVIDs from the lookup file is used to check if the VG is complete.
.P
.
.TP
.B vgs_online
.br
The first activation command (pvscan or vgchange) to create a file here,
named for the VG, will activate the VG. This resolves a race when
concurrent commands attempt to activate a VG at once.
.
.SS static autoactivation
.P
.
A static autoactivation method is no longer provided by lvm.
Setting event_activation=0 still disables event based autoactivation.
WARNING: disabling event activation without an alternative may prevent a
@@ -185,10 +210,12 @@ autoactivation during system startup, in which case disabling event
autoactivation may be useful.
.
.SS lvm.conf filter
.P
Device symlinks from /dev/disk/ can be used in the lvm.conf filter to
guard against changes in kernel device names. The /dev/disk/by-path/ or
/dev/disk/by-id/ prefixes should be included in the filter names; these
.
Device symlinks from \fI/dev/disk/\fP can be used in the
.BR lvm.conf (5)
filter to guard against changes in kernel device names.
The \fI/dev/disk/by-path/\fP or \fI/dev/disk/by-id/\fP
prefixes should be included in the filter names; these
prefixes help lvm detect that symlink names are used. Filters containing
symlinks require special matching by commands run in the lvm udev rule.
.P
@@ -198,105 +225,120 @@ may be less reliable. If a custom udev rule creates symlinks used in the
lvm filter, then the udev rule should be started prior to the lvm rule.
.
.SH EXAMPLES
.P
.
VG "vg" contains two PVs:
.nf
$ pvs -o name,vgname,uuid /dev/sdb /dev/sdc
PV VG PV UUID
/dev/sdb vg 1uKpaT-lFOZ-NLHX-j4jI-OBi1-QpdE-HZ5hZY
/dev/sdc vg 5J3tM8-aIPe-2vbd-DBe7-bvRq-TGj0-DaKV2G
.fi
.P
.EX
# pvs -o name,vgname,uuid /dev/sdb /dev/sdc
\ PV VG PV UUID
\ /dev/sdb vg 1uKpaT-lFOZ-NLHX-j4jI-OBi1-QpdE-HZ5hZY
\ /dev/sdc vg 5J3tM8-aIPe-2vbd-DBe7-bvRq-TGj0-DaKV2G
.EE
.P
use of --cache:
.nf
$ pvscan --cache /dev/sdb
pvscan[12922] PV /dev/sdb online.
$ pvscan --cache /dev/sdc
pvscan[12923] PV /dev/sdc online.
$ cat /run/lvm/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
.P
.EX
# pvscan --cache /dev/sdb
\ pvscan[12922] PV /dev/sdb online.
# pvscan --cache /dev/sdc
\ pvscan[12923] PV /dev/sdc online.
.P
# cat #DEFAULT_RUN_DIR#/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
8:16
vg:vg
dev:/dev/sdb
$ cat /run/lvm/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
# cat #DEFAULT_RUN_DIR#/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
8:32
vg:vg
dev:/dev/sdc
.fi
.EE
.P
use of -aay:
.nf
$ pvscan --cache -aay /dev/sdb
pvscan[12935] PV /dev/sdb online, VG vg incomplete (need 1).
$ pvscan --cache -aay /dev/sdc
pvscan[12936] PV /dev/sdc online, VG vg is complete.
pvscan[12936] VG vg run autoactivation.
1 logical volume(s) in volume group "vg" now active
$ cat /run/lvm/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
.P
.EX
# pvscan --cache -aay /dev/sdb
\ pvscan[12935] PV /dev/sdb online, VG vg incomplete (need 1).
# pvscan --cache -aay /dev/sdc
\ pvscan[12936] PV /dev/sdc online, VG vg is complete.
\ pvscan[12936] VG vg run autoactivation.
\ 1 logical volume(s) in volume group "vg" now active
.P
# cat #DEFAULT_RUN_DIR#/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
8:16
vg:vg
dev:/dev/sdb
$ cat /run/lvm/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
$ cat #DEFAULT_RUN_DIR#/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
8:32
vg:vg
dev:/dev/sdc
$ ls /run/lvm/vgs_online/vg
/run/lvm/vgs_online/vg
.fi
# ls #DEFAULT_RUN_DIR#/vgs_online/vg
#DEFAULT_RUN_DIR#/vgs_online/vg
.EE
.P
use of --listvg:
.nf
$ pvscan --cache --listvg /dev/sdb
VG vg
$ pvscan --cache --listvg /dev/sdc
VG vg
$ cat /run/lvm/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
.P
.EX
# pvscan --cache --listvg /dev/sdb
\ VG vg
# pvscan --cache --listvg /dev/sdc
\ VG vg
.P
# cat #DEFAULT_RUN_DIR#/pvs_online/1uKpaTlFOZNLHXj4jIOBi1QpdEHZ5hZY
8:16
vg:vg
dev:/dev/sdb
$ cat /run/lvm/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
$ cat #DEFAULT_RUN_DIR#/pvs_online/5J3tM8aIPe2vbdDBe7bvRqTGj0DaKV2G
8:32
vg:vg
dev:/dev/sdc
.fi
.EE
.P
use of --checkcomplete:
.nf
$ pvscan --cache --listvg --checkcomplete --vgonline /dev/sdb
pvscan[12996] PV /dev/sdb online, VG vg incomplete (need 1).
VG vg incomplete
$ pvscan --cache --listvg --checkcomplete --vgonline /dev/sdc
pvscan[12997] PV /dev/sdc online, VG vg is complete.
VG vg complete
.fi
.P
.EX
# pvscan --cache --listvg --checkcomplete --vgonline /dev/sdb
\ pvscan[12996] PV /dev/sdb online, VG vg incomplete (need 1).
\ VG vg incomplete
# pvscan --cache --listvg --checkcomplete --vgonline /dev/sdc
\ pvscan[12997] PV /dev/sdc online, VG vg is complete.
\ VG vg complete
.EE
.P
use of --udevoutput:
.nf
$ pvscan --cache --listvg --checkcomplete --vgonline --udevoutput /dev/sdb
.P
.EX
# pvscan --cache --listvg --checkcomplete --vgonline --udevoutput /dev/sdb
LVM_VG_NAME_INCOMPLETE='vg'
$ pvscan --cache --listvg --checkcomplete --vgonline --udevoutput /dev/sdc
# pvscan --cache --listvg --checkcomplete --vgonline --udevoutput /dev/sdc
LVM_VG_NAME_COMPLETE='vg'
.fi
.EE
.P
use of --listlvs:
.nf
$ lvs -o name,devices vg
LV Devices
lvol0 /dev/sdb(0)
lvol1 /dev/sdc(0)
lvol2 /dev/sdb(1),/dev/sdc(1)
$ pvscan --cache --listlvs --checkcomplete /dev/sdb
pvscan[13288] PV /dev/sdb online, VG vg incomplete (need 1).
VG vg incomplete
LV vg/lvol0 complete
LV vg/lvol2 incomplete
$ pvscan --cache --listlvs --checkcomplete /dev/sdc
pvscan[13289] PV /dev/sdc online, VG vg is complete.
VG vg complete
LV vg/lvol1 complete
LV vg/lvol2 complete
.fi
.P
.EX
# lvs -o name,devices vg
\ LV Devices
\ lvol0 /dev/sdb(0)
\ lvol1 /dev/sdc(0)
\ lvol2 /dev/sdb(1),/dev/sdc(1)
.P
# pvscan --cache --listlvs --checkcomplete /dev/sdb
\ pvscan[13288] PV /dev/sdb online, VG vg incomplete (need 1).
\ VG vg incomplete
\ LV vg/lvol0 complete
\ LV vg/lvol2 incomplete
# pvscan --cache --listlvs --checkcomplete /dev/sdc
\ pvscan[13289] PV /dev/sdc online, VG vg is complete.
\ VG vg complete
\ LV vg/lvol1 complete
\ LV vg/lvol2 complete
.EE
.
.SH SEE ALSO
.
.nh
.na
.BR lvm (8),
.BR lvm.conf (5),
.BR lvchange (8),
.BR pvscan (8)

View File

@@ -1,4 +1,13 @@
.TH "LVMCACHE" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMCACHE" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc"
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.SH NAME
.
@@ -21,7 +30,7 @@ used, portions of its data will be temporarily and transparently stored on
the special fast LV.
.P
The two kinds of caching are:
.P
.
.IP \[bu] 2
A read and write hot-spot cache, using the dm-cache kernel module.
This cache tracks access patterns and adjusts its content deliberately so
@@ -41,20 +50,23 @@ LVM refers to this using the LV type \fBwritecache\fP.
The main LV may already exist, and is located on larger, slower devices.
A main LV would be created with a command like:
.P
.EX
# lvcreate -n main -L Size vg /dev/slow_hhd
.EE
.
.SS 2. Identify fast LV to use as the cache
.
A fast LV is created using one or more fast devices, like an SSD. This
special LV will be used to hold the cache:
.P
.EX
# lvcreate -n fast -L Size vg /dev/fast_ssd
.P
# lvs -a
LV Attr Type Devices
fast -wi------- linear /dev/fast_ssd
main -wi------- linear /dev/slow_hhd
.fi
\ LV Attr Type Devices
\ fast -wi------- linear /dev/fast_ssd
\ main -wi------- linear /dev/slow_hhd
.EE
.
.SS 3. Start caching the main LV
.
@@ -63,15 +75,21 @@ type, and specify the fast LV to use as the cache:
.P
using dm-cache (with cachepool):
.P
.EX
# lvconvert --type cache --cachepool fast vg/main
.EE
.P
using dm-cache (with cachevol):
.P
.EX
# lvconvert --type cache --cachevol fast vg/main
.EE
.P
using dm-writecache (with cachevol):
.P
.EX
# lvconvert --type writecache --cachevol fast vg/main
.EE
.P
For more alternatives see:
.br
@@ -89,37 +107,35 @@ the original LV without the cache.
.sp
using dm-cache (with cachepool):
.P
.EX
# lvs -ao+devices
.nf
LV Pool Type Devices
main [fast_cpool] cache main_corig(0)
[fast_cpool] cache-pool fast_pool_cdata(0)
[fast_cpool_cdata] linear /dev/fast_ssd
[fast_cpool_cmeta] linear /dev/fast_ssd
[main_corig] linear /dev/slow_hhd
.fi
.sp
\ LV Pool Type Devices
\ main [fast_cpool] cache main_corig(0)
\ [fast_cpool] cache-pool fast_pool_cdata(0)
\ [fast_cpool_cdata] linear /dev/fast_ssd
\ [fast_cpool_cmeta] linear /dev/fast_ssd
\ [main_corig] linear /dev/slow_hhd
.EE
.P
using dm-cache (with cachevol):
.P
.EX
# lvs -ao+devices
\ LV Pool Type Devices
\ main [fast_cvol] cache main_corig(0)
\ [fast_cvol] linear /dev/fast_ssd
\ [main_corig] linear /dev/slow_hhd
.EE
.P
.nf
LV Pool Type Devices
main [fast_cvol] cache main_corig(0)
[fast_cvol] linear /dev/fast_ssd
[main_corig] linear /dev/slow_hhd
.fi
.sp
using dm-writecache (with cachevol):
.P
.EX
# lvs -ao+devices
.P
.nf
LV Pool Type Devices
main [fast_cvol] writecache main_wcorig(0)
[fast_cvol] linear /dev/fast_ssd
[main_wcorig] linear /dev/slow_hhd
.fi
\ LV Pool Type Devices
\ main [fast_cvol] writecache main_wcorig(0)
\ [fast_cvol] linear /dev/fast_ssd
\ [main_wcorig] linear /dev/slow_hhd
.EE
.
.SS 5. Use the main LV
.
@@ -130,36 +146,36 @@ Use the LV until the cache is no longer wanted, or needs to be changed.
To stop caching the main LV and also remove unneeded cache pool,
use the --uncache:
.P
.EX
# lvconvert --uncache vg/main
.P
# lvs -a
.nf
LV VG Attr Type Devices
main vg -wi------- linear /dev/slow_hhd
.fi
\ LV VG Attr Type Devices
\ main vg -wi------- linear /dev/slow_hhd
.EE
.P
To stop caching the main LV, separate the fast LV from the main LV. This
changes the type of the main LV back to what it was before the cache was
attached.
.P
.EX
# lvconvert --splitcache vg/main
.P
# lvs -a
.nf
LV VG Attr Type Devices
fast vg -wi------- linear /dev/fast_ssd
main vg -wi------- linear /dev/slow_hhd
.fi
\ LV VG Attr Type Devices
\ fast vg -wi------- linear /dev/fast_ssd
\ main vg -wi------- linear /dev/slow_hhd
.EE
.
.SS 7. Create a new LV with caching
.
A new LV can be created with caching attached at the time of creation
using the following command:
.P
.nf
.EX
# lvcreate --type cache|writecache -n Name -L Size
--cachedevice /dev/fast_ssd vg /dev/slow_hhd
.fi
.EE
.P
The main LV is created with the specified Name and Size from the slow_hhd.
A hidden fast LV is created on the fast_ssd and is then attached to the
@@ -172,36 +188,37 @@ for the fast LV.
.
.SS option args
.
.B --cachepool
.IR CachePoolLV | LV
.P
Pass this option a cachepool LV or a standard LV. When using a cache
pool, lvm places cache data and cache metadata on different LVs. The two
LVs together are called a cache pool. This has a bit better performance
for dm-cache and permits specific placement and segment type selection
for data and metadata volumes.
.TP
\fB--cachepool\fP \fICachePoolLV\fP|\fILV\fP
Pass this option a cachepool LV or a standard LV.
When using a cache pool,
lvm places cache data and cache metadata on different LVs.
The two LVs together are called a cache pool.
This has a bit better performance for dm-cache and permits specific
placement and segment type selection for data and metadata volumes.
A cache pool is represented as a special type of LV
that cannot be used directly. If a standard LV is passed with this
option, lvm will first convert it to a cache pool by combining it with
another LV to use for metadata. This option can be used with dm-cache.
.P
.B --cachevol
.I LV
.P
Pass this option a fast LV that should be used to hold the cache. With a
cachevol, cache data and metadata are stored in different parts of the
same fast LV. This option can be used with dm-writecache or dm-cache.
.P
.B --cachedevice
.I PV
.P
.
.TP
\fB--cachevol\fP \fILV\fP
Pass this option a fast LV that should be used to hold the cache.
With a cachevol, cache data and metadata are stored in different parts
of the same fast LV.
This option can be used with dm-writecache or dm-cache.
.
.TP
\fB--cachedevice\fP \fIPV\fP
This option can be used in place of --cachevol, in which case a cachevol
LV will be created using the specified device. This option can be
repeated to create a cachevol using multiple devices, or a tag name can be
specified in which case the cachevol will be created using any of the
devices with the given tag. If a named cache device is unused, the entire
device will be used to create the cachevol. To create a cachevol of a
specific size from the cache devices, include the --cachesize option.
LV will be created using the specified device.
This option can be repeated to create a cachevol using multiple devices,
or a tag name can be specified in which case the cachevol will be created
using any of the devices with the given tag.
If a named cache device is unused, the entire device will be used
to create the cachevol.
To create a cachevol of a specific size from the cache devices,
include the --cachesize option.
.
.SS dm-cache block size
.
@@ -230,10 +247,10 @@ fail to mount if writecache block size of 4096 is used in this case.)
.P
Check the xfs sector size while the fs is mounted:
.P
.EX
# xfs_info /dev/vg/main
.nf
Look for sectsz=512 or sectsz=4096
.fi
.EE
.P
The writecache block size should be chosen to match the xfs sectsz value.
.P
@@ -242,18 +259,21 @@ creating the file system. In this case the writecache block size of 4096
can be used.
.P
The writecache block size is displayed by the command:
.br
lvs -o writecacheblocksize VG/LV
.P
.EX
# lvs -o writecacheblocksize VG/LV
.EE
.
.SS dm-writecache memory usage
.P
.
The amount of main system memory used by dm-writecache can be a factor
when selecting the writecache cachevol size and the writecache block size.
.P
.
.IP \[bu] 2
writecache block size 4096: each 100 GiB of writecache cachevol uses
slightly over 2 GiB of system memory.
.IP \[bu] 2
.
.IP \[bu]
writecache block size 512: each 100 GiB of writecache cachevol uses
a little over 16 GiB of system memory.
.
@@ -269,28 +289,28 @@ For example, --cachesettings 'high_watermark=90 writeback_jobs=4'.
.P
To include settings when caching is started, run:
.P
.nf
.EX
# lvconvert --type writecache --cachevol fast \\
--cachesettings 'option=N' vg/main
.fi
.EE
.P
To change settings for an existing writecache, run:
.P
.nf
.EX
# lvchange --cachesettings 'option=N' vg/main
.fi
.EE
.P
To clear all settings that have been applied, run:
.P
.nf
.EX
# lvchange --cachesettings '' vg/main
.fi
.EE
.P
To view the settings that are applied to a writecache LV, run:
.P
.nf
.EX
# lvs -o cachesettings vg/main
.fi
.EE
.P
Tunable settings are:
.
@@ -313,7 +333,7 @@ autocommit_blocks = <count>
When the application writes this amount of blocks without issuing the
FLUSH request, the blocks are automatically committed.
.
.TP
.TP
autocommit_time = <milliseconds>
The data is automatically committed if this time passes and no FLUSH
request is received.
@@ -343,23 +363,26 @@ cleaner mode, and any required flushing is performed in device suspend.
.
.TP
max_age = <milliseconds>
Specifies the maximum age of a block in milliseconds. If a block is stored in
the cache for too long, it will be written to the underlying device and cleaned up.
Specifies the maximum age of a block in milliseconds.
If a block is stored in the cache for too long,
it will be written to the underlying device and cleaned up.
.
.TP
metadata_only = 0|1
Only metadata is promoted to the cache. This option improves performance for
heavier REQ_META workloads.
Only metadata is promoted to the cache. This option improves performance
for heavier REQ_META workloads.
.
.TP
pause_writeback = <milliseconds>
Pause writeback if there was some write I/O redirected to the origin volume in
the last number of milliseconds.
Pause writeback if there was some write I/O redirected to the origin volume
in the last number of milliseconds.
.
.SS dm-writecache using metadata profiles
.
In addition to specifying writecache settings on the command line, they
can also be set in lvm.conf, or in a profile file, using the
In addition to specifying writecache settings on the command line,
they can also be set in
.BR lvm.conf (5),
or in a profile file, using the
allocation/cache_settings/writecache config structure shown below.
.P
It's possible to prepare a number of different profile files in the
@@ -367,7 +390,8 @@ It's possible to prepare a number of different profile files in the
of the profile when starting writecache.
.P
.I Example
.nf
.P
.EX
# cat <<EOF > #DEFAULT_SYS_DIR#/profile/cache_writecache.profile
allocation {
.RS
@@ -385,11 +409,11 @@ writeback_jobs=1024
}
EOF
.P
.
# lvcreate -an -L10G --name fast vg /dev/fast_ssd
# lvcreate --type writecache -L10G --name main --cachevol fast \\
--metadataprofile cache_writecache vg /dev/slow_hdd
.fi
\ --metadataprofile cache_writecache vg /dev/slow_hdd
.EE
.
.SS dm-cache with separate data and metadata LVs
.
@@ -400,27 +424,31 @@ LV that references two sub LVs, one for data and one for metadata.
To create a cache pool of given data size and let lvm2 calculate appropriate
metadata size:
.P
.EX
# lvcreate --type cache-pool -L DataSize -n fast vg /dev/fast_ssd1
.EE
.P
To create a cache pool from separate LV and let lvm2 calculate
appropriate cache metadata size:
.P
.EX
# lvcreate -n fast -L DataSize vg /dev/fast_ssd1
.br
# lvconvert --type cache-pool vg/fast /dev/fast_ssd1
.br
.EE
.P
To create a cache pool from two separate LVs:
.P
.EX
# lvcreate -n fast -L DataSize vg /dev/fast_ssd1
.br
# lvcreate -n fastmeta -L MetadataSize vg /dev/fast_ssd2
.br
# lvconvert --type cache-pool --poolmetadata fastmeta vg/fast
.EE
.P
Then use the cache pool LV to start caching the main LV:
.P
.EX
# lvconvert --type cache --cachepool fast vg/main
.EE
.P
A variation of the same procedure automatically creates a cache pool when
caching is started. To do this, use a standard LV as the --cachepool
@@ -429,12 +457,12 @@ caching is started. To do this, use a standard LV as the --cachepool
cache pool LV from the two specified LVs, and use the cache pool to start
caching the main LV.
.P
.nf
.EX
# lvcreate -n fast -L DataSize vg /dev/fast_ssd1
# lvcreate -n fastmeta -L MetadataSize vg /dev/fast_ssd2
# lvconvert --type cache --cachepool fast \\
--poolmetadata fastmeta vg/main
.fi
\ --poolmetadata fastmeta vg/main
.EE
.
.SS dm-cache cache modes
.
@@ -451,20 +479,22 @@ With the --cachemode option, the cache mode can be set when caching is
started, or changed on an LV that is already cached. The current cache
mode can be displayed with the cache_mode reporting option:
.P
.B lvs -o+cache_mode VG/LV
.EX
# lvs -o+cache_mode VG/LV
.EE
.P
.BR lvm.conf (5)
.B allocation/cache_mode
.br
\(en
defines the default cache mode.
.P
.nf
.EX
# lvconvert --type cache --cachemode writethrough \\
--cachepool fast vg/main
\ --cachepool fast vg/main
.P
# lvconvert --type cache --cachemode writethrough \\
--cachevol fast vg/main
.nf
\ --cachevol fast vg/main
.EE
.
.SS dm-cache chunk size
.
@@ -486,7 +516,9 @@ time searching for chunks, and excessive memory tracking chunks.
.P
Command to display the chunk size:
.P
.B lvs -o+chunksize VG/LV
.EX
# lvs -o+chunksize VG/LV
.EE
.P
.BR lvm.conf (5)
.B allocation/cache_pool_chunk_size
@@ -495,22 +527,26 @@ controls the default chunk size.
.P
The default value is shown by:
.P
.B lvmconfig --type default allocation/cache_pool_chunk_size
.EX
# lvmconfig --type default allocation/cache_pool_chunk_size
.EE
.P
Checking migration threshold (in sectors) of running cached LV:
.br
.B lvs -o+kernel_cache_settings VG/LV
.P
.EX
# lvs -o+kernel_cache_settings VG/LV
.EE
.
.SS dm-cache cache settings
.
To set dm-cache cache setting use:
.P
--cachesettings 'option1=N option2=N ...'
--cachesettings 'option1=N option2=N .\|.\|.'
.P
To unset/drop cache setting and restore its default kernel value
use special keyword 'default' as option parameter:
.P
--cachesettings 'option1=default option2=default ...'
--cachesettings 'option1=default option2=default .\|.\|.'
.
.SS dm-cache migration threshold cache setting
.
@@ -526,17 +562,22 @@ or 8 cache chunks whichever of those two values is larger.
.P
Command to set migration threshold to 2 MiB (4096 sectors):
.P
.B lvcreate --cachesettings 'migration_threshold=4096' VG/LV
.EX
# lvcreate --cachesettings 'migration_threshold=4096' VG/LV
.EE
.P
Command to display the migration threshold:
.P
.B lvs -o+kernel_cache_settings,cache_settings VG/LV
.br
.B lvs -o+chunksize VG/LV
.EX
# lvs -o+kernel_cache_settings,cache_settings VG/LV
# lvs -o+chunksize VG/LV
.EE
.P
Command to restore/revert to default value:
.P
.B lvchange --cachesettings 'migration_threshold=default' VG/LV
.EX
# lvchange --cachesettings 'migration_threshold=default' VG/LV
.EE
.
.SS dm-cache cache policy
.
@@ -561,35 +602,46 @@ cached LV (both options can be used together). The current cache policy
and settings can be displayed with the cache_policy and cache_settings
reporting options:
.P
.B lvs -o+cache_policy,cache_settings VG/LV
.EX
# lvs -o+cache_policy,cache_settings VG/LV
.EE
.P
Change the cache policy and settings of an existing LV.
.nf
.P
.EX
# lvchange --cachepolicy mq --cachesettings \\
\(aqmigration_threshold=2048 random_threshold=4\(aq vg/main
.fi
.EE
.P
.BR lvm.conf (5)
.B allocation/cache_policy
.br
\(en
defines the default cache policy.
.P
.BR lvm.conf (5)
.B allocation/cache_settings
.br
\(en
defines the default cache settings.
.
.SS dm-cache using metadata profiles
.
Cache pools allows to set a variety of options. Lots of these settings
can be specified in lvm.conf or profile settings. You can prepare
a number of different profiles in the \fI#DEFAULT_SYS_DIR#/profile\fP directory
and just specify the metadata profile file name when caching LV or creating cache-pool.
Check the output of \fBlvmconfig --type default --withcomments\fP
a number of different profiles
in the \fI#DEFAULT_SYS_DIR#/profile\fP
directory and just specify the metadata profile file name
when caching LV or creating cache-pool.
Check the output of:
.P
.EX
# lvmconfig --type default --withcomments
.EE
.P
for a detailed description of all individual cache settings.
.P
.I Example
.nf
.P
.EX
# cat <<EOF > #DEFAULT_SYS_DIR#/profile/cache_big_chunk.profile
allocation {
.RS
@@ -611,12 +663,12 @@ migration_threshold=8192
}
EOF
.P
.
# lvcreate --cache -L10G --metadataprofile cache_big_chunk vg/main \\
/dev/fast_ssd
\ /dev/fast_ssd
# lvcreate --cache -L10G vg/main --config \\
'allocation/cache_pool_chunk_size=512' /dev/fast_ssd
.fi
\ 'allocation/cache_pool_chunk_size=512' /dev/fast_ssd
.EE
.
.SS dm-cache spare metadata LV
.
@@ -640,27 +692,27 @@ RAID1 can be used to create the fast LV holding the cache so that it can
tolerate a device failure. (When using dm-cache with separate data
and metadata LVs, each of the sub-LVs can use RAID1.)
.P
.nf
.EX
# lvcreate -n main -L Size vg /dev/slow
# lvcreate --type raid1 -m 1 -n fast -L Size vg /dev/ssd1 /dev/ssd2
# lvconvert --type cache --cachevol fast vg/main
.fi
.EE
.
.SS dm-cache command shortcut
.
A single command can be used to cache main LV with automatic
creation of a cache-pool:
.P
.nf
.EX
# lvcreate --cache --size CacheDataSize VG/LV [FastPVs]
.fi
.EE
.P
or the longer variant
.P
.nf
.EX
# lvcreate --type cache --size CacheDataSize \\
--name NameCachePool VG/LV [FastPVs]
.fi
\ --name NameCachePool VG/LV [FastPVs]
.EE
.P
In this command, the specified LV already exists, and is the main LV to be
cached. The command creates a new cache pool with size and given name
@@ -680,7 +732,7 @@ and the existing main LV is being converted to type cache.)
.SH SEE ALSO
.
.nh
.ad l
.na
.BR lvm.conf (5),
.BR lvchange (8),
.BR lvcreate (8),
@@ -690,6 +742,8 @@ and the existing main LV is being converted to type cache.)
.BR lvrename (8),
.BR lvresize (8),
.BR lvs (8),
.BR lvmraid (7),
.BR lvmthin (7),
.br
.BR vgchange (8),
.BR vgmerge (8),

View File

@@ -1,4 +1,4 @@
lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons, to be phased out) produce
formatted output from the LVM configuration tree. The
sources of the configuration data include \fBlvm.conf\fP(5) and command
lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons,
to be phased out) produce formatted output from the LVM configuration tree.
The sources of the configuration data include \fBlvm.conf\fP(5) and command
line settings from --config.

View File

@@ -1,132 +1,378 @@
.TH LVMCONFIG 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_atversion
.OPA atversion
\fIString\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_file
.OPA f file
\fIString\fP
..
.de O_help
.OPS h help
..
.de O_ignoreadvanced
.OPS ignoreadvanced
..
.de O_ignorelocal
.OPS ignorelocal
..
.de O_ignoreunsupported
.OPS ignoreunsupported
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_list
.OPS l list
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_mergedconfig
.OPS mergedconfig
..
.de O_metadataprofile
.OPA metadataprofile
\fIString\fP
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_showdeprecated
.OPS showdeprecated
..
.de O_showunsupported
.OPS showunsupported
..
.de O_sinceversion
.OPA sinceversion
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_typeconfig
.OPA typeconfig
\%\fBcurrent\fP|\:\
\fBdefault\fP|\:\
\fBdiff\fP|\:\
\fBfull\fP|\:\
\fBlist\fP|\:\
\fBmissing\fP|\:\
\fBnew\fP|\:\
\fBprofilable\fP|\:\
\fBprofilable-command\fP|\:\
\fBprofilable-metadata\fP
..
.de O_unconfigured
.OPS unconfigured
..
.de O_validate
.OPS validate
..
.de O_valuesonly
.OPS valuesonly
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_withcomments
.OPS withcomments
..
.de O_withgeneralpreamble
.OPS withgeneralpreamble
..
.de O_withlocalpreamble
.OPS withlocalpreamble
..
.de O_withspaces
.OPS withspaces
..
.de O_withsummary
.OPS withsummary
..
.de O_withversions
.OPS withversions
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvmconfig \(em Display and manipulate configuration information
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvmconfig\fP
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.br
[ \fIposition_args\fP ]
.br
[ \fIposition_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons, to be phased out) produce
formatted output from the LVM configuration tree. The
sources of the configuration data include \fBlvm.conf\fP(5) and command
lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons,
to be phased out) produce formatted output from the LVM configuration tree.
The sources of the configuration data include \fBlvm.conf\fP(5) and command
line settings from --config.
.
.SH USAGE
.
\fBlvmconfig\fP
.br
.RS 4
.ad l
[ \fB-f\fP|\fB--file\fP \fIString\fP ]
.br
[ \fB-l\fP|\fB--list\fP ]
.br
[ \fB--atversion\fP \fIString\fP ]
.br
[ \fB--typeconfig\fP \c
.nh
\%\fBcurrent\fP|\:\fBdefault\fP|\:\fBdiff\fP|\:\fBfull\fP|\:\fBlist\fP|\:\fBmissing\fP|\:\fBnew\fP|\:\fBprofilable\fP|\:\fBprofilable-command\fP|\:\fBprofilable-metadata\fP
.hy
.na
.B lvmconfig
.RS
[
.O_file
]
.br
[ \fB--ignoreadvanced\fP ]
[
.O_list
]
.br
[ \fB--ignoreunsupported\fP ]
[
.O_atversion
]
.br
[ \fB--ignorelocal\fP ]
[
.O_typeconfig
]
.br
[ \fB--mergedconfig\fP ]
[
.O_ignoreadvanced
]
.br
[ \fB--metadataprofile\fP \fIString\fP ]
[
.O_ignoreunsupported
]
.br
[ \fB--sinceversion\fP \fIString\fP ]
[
.O_ignorelocal
]
.br
[ \fB--showdeprecated\fP ]
[
.O_mergedconfig
]
.br
[ \fB--showunsupported\fP ]
[
.O_metadataprofile
]
.br
[ \fB--validate\fP ]
[
.O_sinceversion
]
.br
[ \fB--valuesonly\fP ]
[
.O_showdeprecated
]
.br
[ \fB--withsummary\fP ]
[
.O_showunsupported
]
.br
[ \fB--withcomments\fP ]
[
.O_validate
]
.br
[ \fB--withgeneralpreamble\fP ]
[
.O_valuesonly
]
.br
[ \fB--withlocalpreamble\fP ]
[
.O_withsummary
]
.br
[ \fB--withspaces\fP ]
[
.O_withcomments
]
.br
[ \fB--unconfigured\fP ]
[
.O_withgeneralpreamble
]
.br
[ \fB--withversions\fP ]
[
.O_withlocalpreamble
]
.br
[
.O_withspaces
]
.br
[
.O_unconfigured
]
.br
[
.O_withversions
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.RS 4
[ \fIString\fP ... ]
.br
[ \fIString\fP\ .\|.\|.\& ]
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--atversion\fP \fIString\fP
.br
.TP
.O_atversion
Specify an LVM version in x.y.z format where x is the major version,
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
When configuration is displayed, the configuration settings recognized
@@ -135,84 +381,72 @@ to display a configuration that a certain LVM version understands and
which does not contain any newer settings for which LVM would
issue a warning message when checking the configuration.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-f\fP|\fB--file\fP \fIString\fP
.br
.TP
.O_file
Write output to the named file.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--ignoreadvanced\fP
.br
.TP
.O_ignoreadvanced
Exclude advanced configuration settings from the output.
.
.HP
\fB--ignorelocal\fP
.br
.TP
.O_ignorelocal
Ignore the local section. The local section should be defined in
the lvmlocal.conf file, and should contain config settings
specific to the local host which should not be copied to
other hosts.
.
.HP
\fB--ignoreunsupported\fP
.br
.TP
.O_ignoreunsupported
Exclude unsupported configuration settings from the output. These settings are
either used for debugging and development purposes only or their support is not
yet complete and they are not meant to be used in production. The \fBcurrent\fP
and \fBdiff\fP types include unsupported settings in their output by default,
all the other types ignore unsupported settings.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -220,26 +454,22 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB-l\fP|\fB--list\fP
.br
.TP
.O_list
List config settings with summarizing comment. This is the same as using
options --typeconfig list --withsummary.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--mergedconfig\fP
.br
.TP
.O_mergedconfig
When the command is run with --config
and/or --commandprofile (or using LVM_COMMAND_PROFILE
environment variable), --profile, or --metadataprofile,
@@ -248,40 +478,34 @@ Without merging, only the configuration at the front of the
cascade is displayed.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB--metadataprofile\fP \fIString\fP
.br
.TP
.O_metadataprofile
The metadata profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--showdeprecated\fP
.br
.TP
.O_showdeprecated
Include deprecated configuration settings in the output. These settings
are deprecated after a certain version. If a concrete version is specified
with --atversion, deprecated settings are automatically included
@@ -289,40 +513,31 @@ if the specified version is lower than the version in which the settings were
deprecated. The current and diff types include deprecated settings
in their output by default, all the other types ignore deprecated settings.
.
.HP
\fB--showunsupported\fP
.br
.TP
.O_showunsupported
Include unsupported configuration settings in the output. These settings
are either used for debugging or development purposes only, or their support
is not yet complete and they are not meant to be used in production. The
current and diff types include unsupported settings in their
output by default, all the other types ignore unsupported settings.
.
.HP
\fB--sinceversion\fP \fIString\fP
.br
.TP
.O_sinceversion
Specify an LVM version in x.y.z format where x is the major version,
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
This option is currently applicable only with --typeconfig new
to display all configuration settings introduced since given version.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
.ad l
\fB--typeconfig\fP \c
.nh
\%\fBcurrent\fP|\:\fBdefault\fP|\:\fBdiff\fP|\:\fBfull\fP|\:\fBlist\fP|\:\fBmissing\fP|\:\fBnew\fP|\:\fBprofilable\fP|\:\fBprofilable-command\fP|\:\fBprofilable-metadata\fP
.hy
.ad b
.br
.TP
.O_typeconfig
\fBcurrent\fP prints the config settings that would be applied
to an lvm command (assuming the command does not override them
on the command line.) This includes:
@@ -356,72 +571,61 @@ with their default values.
\fBprofilable-metadata\fP prints settings with their default values that can be set from a metadata profile.
Also see \fBlvm.conf\fP(5).
.
.HP
\fB--unconfigured\fP
.br
.TP
.O_unconfigured
Internal option used for generating config file during build.
.
.HP
\fB--validate\fP
.br
.TP
.O_validate
Validate current configuration used and exit with appropriate
return code. The validation is done only for the configuration
at the front of the "config cascade". To validate the whole
merged configuration tree, also use --mergedconfig.
The validation is done even if \fBlvm.conf\fP(5) \fBconfig/checks\fP is disabled.
The validation is done even if \fBlvm.conf\fP(5) \fBconfig/checks\fP
is disabled.
.
.HP
\fB--valuesonly\fP
.br
.TP
.O_valuesonly
When printing config settings, print only values without keys.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB--withcomments\fP
.br
.TP
.O_withcomments
Display a full comment for each configuration node. For deprecated
settings, also display comments about deprecation.
.
.HP
\fB--withgeneralpreamble\fP
.br
.TP
.O_withgeneralpreamble
Include general config file preamble.
.
.HP
\fB--withlocalpreamble\fP
.br
.TP
.O_withlocalpreamble
Include local config file preamble.
.
.HP
\fB--withspaces\fP
.br
.TP
.O_withspaces
Where appropriate, add more spaces in output for better readability.
.
.HP
\fB--withsummary\fP
.br
.TP
.O_withsummary
Display a one line comment for each configuration node.
.
.HP
\fB--withversions\fP
.br
.TP
.O_withversions
Also display a comment containing the version of introduction for
each configuration node. If the setting is deprecated, also display
the version since which it is deprecated.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -431,6 +635,7 @@ answer yes. Use with extreme caution.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -454,10 +659,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -6,15 +6,16 @@ lvmdbusd \(em LVM D-Bus daemon
.
.SH SYNOPSIS
.
.ad l
.na
.B lvmdbusd
.RB [ --debug ]
.RB [ --udev ]
.ad b
.ad
.
.SH DESCRIPTION
.
lvmdbusd is a service which provides a D-Bus API to the logical volume manager (LVM).
lvmdbusd is a service which provides a D-Bus API
to the logical volume manager (LVM).
Run
.BR lvmdbusd (8)
as root.
@@ -31,5 +32,8 @@ Use udev events to trigger updates
.
.SH SEE ALSO
.
.BR dbus-send (1),
.BR lvm (8)
.nh
.na
.BR lvm (8),
.P
.BR dbus-send (1)

View File

@@ -71,35 +71,35 @@ Possible device ID types are:
.IP \[bu] 2
.B sys_wwid
uses the wwid reported by the wwid sysfs file. This is the first choice.
.IP \[bu] 2
.IP \[bu]
.B wwid_naa
uses the naa wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B wwid_eui
uses the eui wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B wwid_t10
uses the t10 wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B sys_serial
uses the serial number reported by the serial sysfs file or the vpd_pg80
file. A serial number is used if no wwid is available.
.IP \[bu] 2
.IP \[bu]
.B mpath_uuid
is used for dm multipath devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B crypt_uuid
is used for dm crypt devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B md_uuid
is used for md devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B lvmlv_uuid
is used if a PV is placed on top of an lvm LV, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B loop_file
is used for loop devices, the backing file name reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B devname
the device name is used if no other type applies.
.P
@@ -107,15 +107,15 @@ The default choice for device ID type can be overridden using lvmdevices
--addev --deviceidtype <type>. If the specified type is available for the
device it will be used, otherwise the device will be added using the type
that would otherwise be chosen.
.P
LVM commands run by dmeventd will use the devices file
\fI#DEFAULT_SYS_DIR#/devices/dmeventd.devices\fP if it exists,
otherwise system.devices is used. VGs that require the dmeventd
service should be included in system.devices, even if they are
included in dmeventd.devices.
.
.SS Device ID refresh
.P
.
A machine identifier is saved in the devices file, and is used to detect
when the devices file has been created by a different machine. If the
devices file was created by a different machine, it indicates that PVs may
@@ -126,7 +126,11 @@ existing PVIDs (assuming the original device IDs are also no longer
found.)
.P
The machine identifier used in system.devices will be either the DMI
product_uuid from /sys/devices/virtual/dmi/id/product_uuid, or the
hostname from uname(2). See lvm.conf device_ids_refresh_checks to
product_uuid from
.IR /sys/devices/virtual/dmi/id/product_uuid ,
or the hostname from
.BR uname (2).
See
.BR lvm.conf (5)
.B device_ids_refresh_checks to
configure this.

View File

@@ -1,71 +1,207 @@
.TH LVMDEVICES 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_adddev
.OPA adddev
\fIPV\fP
..
.de O_addpvid
.OPA addpvid
\fIString\fP
..
.de O_check
.OPS check
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_deldev
.OPA deldev
\fIString\fP
..
.de O_delnotfound
.OPS delnotfound
..
.de O_delpvid
.OPA delpvid
\fIString\fP
..
.de O_deviceidtype
.OPA deviceidtype
\fIString\fP
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_refresh
.OPS refresh
..
.de O_test
.OPS t test
..
.de O_update
.OPS update
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvmdevices \(em Manage the devices file
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvmdevices\fP \fIoption_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.P
.ad l
\fB--adddev\fP \fIPV\fP
.na
.RS 5
.if t .ta 3nR +1uL \" PostScript/PDF
.PD 0
.O_adddev
.br
\fB--addpvid\fP \fIString\fP
.O_addpvid
.br
\fB--check\fP
.O_check
.br
\fB--commandprofile\fP \fIString\fP
.O_commandprofile
.br
\fB--config\fP \fIString\fP
.O_config
.br
\fB-d\fP|\fB--debug\fP
.O_debug
.br
\fB--deldev\fP \fIString\fP
.O_deldev
.br
\fB--delnotfound\fP
.O_delnotfound
.br
\fB--delpvid\fP \fIString\fP
.O_delpvid
.br
\fB--deviceidtype\fP \fIString\fP
.O_deviceidtype
.br
\fB--devices\fP \fIPV\fP
.O_devices
.br
\fB--devicesfile\fP \fIString\fP
.O_devicesfile
.br
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.O_driverloaded
.br
\fB-h\fP|\fB--help\fP
.O_help
.br
\fB--journal\fP \fIString\fP
.O_journal
.br
\fB--lockopt\fP \fIString\fP
.O_lockopt
.br
\fB--longhelp\fP
.O_longhelp
.br
\fB--nohints\fP
.O_nohints
.br
\fB--nolocking\fP
.O_nolocking
.br
\fB--profile\fP \fIString\fP
.O_profile
.br
\fB-q\fP|\fB--quiet\fP
.O_quiet
.br
\fB--refresh\fP
.O_refresh
.br
\fB-t\fP|\fB--test\fP
.O_test
.br
\fB--update\fP
.O_update
.br
\fB-v\fP|\fB--verbose\fP
.O_verbose
.br
\fB--version\fP
.O_version
.br
\fB-y\fP|\fB--yes\fP
.ad b
.O_yes
.PD
.if t .ta
.RE
.ad
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -142,35 +278,35 @@ Possible device ID types are:
.IP \[bu] 2
.B sys_wwid
uses the wwid reported by the wwid sysfs file. This is the first choice.
.IP \[bu] 2
.IP \[bu]
.B wwid_naa
uses the naa wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B wwid_eui
uses the eui wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B wwid_t10
uses the t10 wwid decoded from the vpd_pg83 sysfs file.
.IP \[bu] 2
.IP \[bu]
.B sys_serial
uses the serial number reported by the serial sysfs file or the vpd_pg80
file. A serial number is used if no wwid is available.
.IP \[bu] 2
.IP \[bu]
.B mpath_uuid
is used for dm multipath devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B crypt_uuid
is used for dm crypt devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B md_uuid
is used for md devices, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B lvmlv_uuid
is used if a PV is placed on top of an lvm LV, reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B loop_file
is used for loop devices, the backing file name reported by sysfs.
.IP \[bu] 2
.IP \[bu]
.B devname
the device name is used if no other type applies.
.P
@@ -178,15 +314,15 @@ The default choice for device ID type can be overridden using lvmdevices
--addev --deviceidtype <type>. If the specified type is available for the
device it will be used, otherwise the device will be added using the type
that would otherwise be chosen.
.P
LVM commands run by dmeventd will use the devices file
\fI#DEFAULT_SYS_DIR#/devices/dmeventd.devices\fP if it exists,
otherwise system.devices is used. VGs that require the dmeventd
service should be included in system.devices, even if they are
included in dmeventd.devices.
.
.SS Device ID refresh
.P
.
A machine identifier is saved in the devices file, and is used to detect
when the devices file has been created by a different machine. If the
devices file was created by a different machine, it indicates that PVs may
@@ -197,252 +333,279 @@ existing PVIDs (assuming the original device IDs are also no longer
found.)
.P
The machine identifier used in system.devices will be either the DMI
product_uuid from /sys/devices/virtual/dmi/id/product_uuid, or the
hostname from uname(2). See lvm.conf device_ids_refresh_checks to
product_uuid from
.IR /sys/devices/virtual/dmi/id/product_uuid ,
or the hostname from
.BR uname (2).
See
.BR lvm.conf (5)
.B device_ids_refresh_checks to
configure this.
.
.SH USAGE
.
.nh
.na
Print devices in the devices file.
.br
.P
\fBlvmdevices\fP
.br
.RS 4
.ad l
.B lvmdevices
.RS
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Check the devices file and report incorrect values.
.br
.P
\fBlvmdevices\fP \fB--check\fP
.br
.RS 4
.ad l
[ \fB--refresh\fP ]
.B lvmdevices
.O_check
.RS
[
.O_refresh
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Update the devices file to fix incorrect values.
.br
.P
\fBlvmdevices\fP \fB--update\fP
.B lvmdevices
.O_update
.RS
[
.O_delnotfound
]
.br
.RS 4
.ad l
[ \fB--delnotfound\fP ]
.br
[ \fB--refresh\fP ]
[
.O_refresh
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Add a device to the devices file.
.br
.P
\fBlvmdevices\fP \fB--adddev\fP \fIPV\fP
.br
.RS 4
.ad l
[ \fB--deviceidtype\fP \fIString\fP ]
.B lvmdevices
.O_adddev
.RS
[
.O_deviceidtype
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Remove a device from the devices file.
.br
.P
\fBlvmdevices\fP \fB--deldev\fP \fIString\fP|\fIPV\fP
.br
.RS 4
.ad l
[ \fB--deviceidtype\fP \fIString\fP ]
.B lvmdevices
.O_deldev
.RS
[
.O_deviceidtype
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Find the device with the given PVID and add it to the devices file.
.br
.P
\fBlvmdevices\fP \fB--addpvid\fP \fIString\fP
.br
.RS 4
.ad l
[ \fB--deviceidtype\fP \fIString\fP ]
.B lvmdevices
.O_addpvid
.RS
[
.O_deviceidtype
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Remove the devices file entry for the given PVID.
.br
.P
\fBlvmdevices\fP \fB--delpvid\fP \fIString\fP
.br
.RS 4
.ad l
.B lvmdevices
.O_delpvid
.RS
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--adddev\fP \fIPV\fP
.br
.TP
.O_adddev
Add a device to the devices file.
.
.HP
\fB--addpvid\fP \fIString\fP
.br
.TP
.O_addpvid
Find a device with the PVID and add the device to the devices file.
.
.HP
\fB--check\fP
.br
.TP
.O_check
Checks the content of the devices file.
Reports incorrect device names or PVIDs for entries.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--deldev\fP \fIString\fP
.br
.TP
.O_deldev
Remove a device from the devices file.
When used alone, --deldev specifies a device name.
When used with --deviceidtype, --deldev specifies a device id.
.
.HP
\fB--delnotfound\fP
.br
.TP
.O_delnotfound
Remove devices file entries with no matching device.
.
.HP
\fB--delpvid\fP \fIString\fP
.br
.TP
.O_delpvid
Remove a device with the PVID from the devices file.
.
.HP
\fB--deviceidtype\fP \fIString\fP
.br
.TP
.O_deviceidtype
The type of device ID to use for the device.
If the specified type is available for the device,
then it will override the default type that lvm would use.
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -450,45 +613,38 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--refresh\fP
.br
.TP
.O_refresh
Search for missing PVs on new devices, and update the devices file
with new device IDs for the PVs if they are found on new devices.
This is useful if PVs have been moved to new devices with new WWIDs,
@@ -499,34 +655,29 @@ correct device ID with the clone/snapshot device ID, and lvm would begin
using the wrong device for the PV. Use deldev/adddev to safely change
a PV device ID in this scenario.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB--update\fP
.br
.TP
.O_update
Update the content of the devices file.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -536,6 +687,7 @@ answer yes. Use with extreme caution.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -559,10 +711,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,119 @@
.TH LVMDISKSCAN 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_lvmpartition
.OPS l lvmpartition
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_readonly
.OPS readonly
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvmdiskscan \(em List devices that may be used as physical volumes
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvmdiskscan\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -22,114 +126,145 @@ This command is deprecated, use \fBpvs\fP instead.
.
.SH USAGE
.
\fBlvmdiskscan\fP
.nh
.na
.B lvmdiskscan
.RS
[
.O_lvmpartition
]
.br
.RS 4
.ad l
[ \fB-l\fP|\fB--lvmpartition\fP ]
.br
[ \fB--readonly\fP ]
[
.O_readonly
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -137,76 +272,64 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB-l\fP|\fB--lvmpartition\fP
.br
.TP
.O_lvmpartition
Only report PVs.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--readonly\fP
.br
.TP
.O_readonly
Prevent the command from making changes, including activation and
metadata updates. (See --permission r for read only LVs.)
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -216,6 +339,7 @@ answer yes. Use with extreme caution.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -239,10 +363,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,12 +1,26 @@
.TH LVMDUMP 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. nh
. na
. \}
..
.
.SH NAME
.
lvmdump \(em create lvm2 information dumps for diagnostic purposes
.
.SH SYNOPSIS
.
.B lvmdump
.NSY lvmdump 1
.RB [ -a ]
.RB [ -c ]
.RB [ -d
@@ -18,6 +32,10 @@ lvmdump \(em create lvm2 information dumps for diagnostic purposes
.RB [ -s ]
.RB [ -u ]
.
.PD
.ad
.hy
.
.SH DESCRIPTION
.
lvmdump is a tool to dump various information concerning LVM2.
@@ -25,7 +43,7 @@ By default, it creates a tarball suitable for submission along
with a problem report.
.P
The content of the tarball is as follows:
.ad l
.
.PD 0
.IP \[bu] 2
dmsetup info
@@ -44,7 +62,9 @@ list of files present \fI/sys/devices/virtual/block\fP
.IP \[bu]
if enabled with -m, metadata dump will be also included
.IP \[bu]
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 -a, debug output of vgscan,
pvscan and list of all available volume groups,
physical volumes and logical volumes will be included
.IP \[bu]
if enabled with -l, lvmetad state if running
.IP \[bu]
@@ -54,42 +74,50 @@ if enabled with -s, system info and context
.IP \[bu]
if enabled with -u, udev info and context
.PD
.ad b
.
.SH OPTIONS
.
.TP
.B -a
Advanced collection.
\fBWARNING\fR: if lvm is already hung, then this script may hang as well
if \fB-a\fR is used.
.br
\fBWARNING\fP: if lvm is already hung, then this script may hang as well
if \fB-a\fP is used.
.
.TP
.B -d \fIdirectory
\fB-d\fP \fIdirectory\fP
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 \fIdirectory\fP.
.
.TP
.B -h
Print help message
.
.TP
.B -l
Include \fBlvmetad\fP(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.
.
.TP
.B -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.
.
.TP
.B -p
Include \fBlvmpolld\fP(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.
Include
.BR 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.
.
.TP
.B -s
Gather system info and context. Currently, this encompasses info gathered
@@ -97,11 +125,17 @@ 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.
.
.TP
.B -u
Gather udev info and context: \fI/etc/udev/udev.conf\fP file, udev daemon version
(output of 'udevadm info --version' command), udev rules currently used in the system
(content of \fI/lib/udev/rules.d\fP and \fI/etc/udev/rules.d\fP directory),
Gather udev info and context: \fI/etc/udev/udev.conf\fP file,
udev daemon version (output of 'udevadm info --version' command),
udev rules currently used in the system
(content of
.I /lib/udev/rules.d
and
.I /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).
.
@@ -111,7 +145,9 @@ database content (the output of 'udevadm info --export-db' command).
.B LVM_BINARY
The LVM2 binary to use.
Defaults to "\fBlvm\fP".
Sometimes you might need to set this to "\fI#LVM_PATH#.static\fP", for example.
Sometimes you might need to set this to "\fI#LVM_PATH#.static\fP",
for example.
.
.TP
.B DMSETUP_BINARY
The dmsetup binary to use.
@@ -119,8 +155,11 @@ Defaults to "\fBdmsetup\fP".
.
.SH SEE ALSO
.
.na
.nh
.BR lvm (8),
.BR lvmpolld (8),
.BR dmsetup (8),
.P
.BR udev (8),
.BR udevadm (8)

View File

@@ -1,4 +1,4 @@
.TH "LVMLOCKCTL" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMLOCKCTL" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.SH NAME
.
@@ -6,7 +6,8 @@ lvmlockctl \(em Control for lvmlockd
.
.SH SYNOPSIS
.
.BR lvmlockctl " [" \fIoptions ]
.B lvmlockctl
.RI [ Ioptions ]
.
.SH DESCRIPTION
.
@@ -40,19 +41,19 @@ Wait option for other commands.
Force option for other commands.
.
.TP
.BR -k | --kill " " \fIvgname
\fB-k\fP|\fB--kill\fP \fIvgname\fP
Kill access to the VG when sanlock cannot renew lease.
.
.TP
.BR -r | --drop " " \fIvgname
\fB-r\fP|\fB--drop\fP \fIvgname\fP
Clear locks for the VG when it is unused after kill (-k).
.
.TP
.BR -E | --gl-enable " " \fIvgname
\fB-E\fP|\fB--gl-enable\fP \fIvgname\fP
Tell lvmlockd to enable the global lock in a sanlock VG.
.
.TP
.BR -D | --gl-disable " " \fIvgname
\fB-D\fP|\fB--gl-disable\fP \fIvgname\fP
Tell lvmlockd to disable the global lock in a sanlock VG.
.
.TP

View File

@@ -1,4 +1,13 @@
.TH "LVMLOCKD" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMLOCKD" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.SH NAME
.
@@ -6,33 +15,35 @@ lvmlockd \(em LVM locking daemon
.
.SH SYNOPSIS
.
.BR lvmlockd " [" \fIoptions ]
.B lvmlockd
.RI [ options ]
.
.SH DESCRIPTION
.
LVM commands use lvmlockd to coordinate access to shared storage.
.br
.P
When LVM is used on devices shared by multiple hosts, locks will:
.br
\[bu]
.PD 0
.IP \[bu] 2
coordinate reading and writing of LVM metadata
.br
\[bu]
.IP \[bu]
validate caching of LVM metadata
.br
\[bu]
.IP \[bu]
prevent conflicting activation of logical volumes
.br
.PD
.P
lvmlockd uses an external lock manager to perform basic locking.
.P
Lock manager (lock type) options are:
.br
\[bu]
sanlock: places locks on disk within LVM storage.
.br
\[bu]
dlm: uses network communication and a cluster manager.
.br
.
.TP 8
.B sanlock
\(en places locks on disk within LVM storage.
.
.TP
.B dlm
\(en uses network communication and a cluster manager.
.PD
.
.SH OPTIONS
.
@@ -57,15 +68,17 @@ Don't fork.
Don't fork and print debugging to stdout.
.
.TP
.BR -p | --pid-file " " \fIpath
.BR -p | --pid-file\ \c
.I path
Set path to the pid file.
.
.TP
.BR -s | --socket-path " " \fIpath
.BR -s | --socket-path\ \c
.I path
Set path to the socket to listen on.
.
.TP
.B --adopt-file \fIpath
\fB--adopt-file\fP \fIpath\fP
Set path to the adopt file.
.
.TP
@@ -77,15 +90,18 @@ Write log messages from this level up to syslog.
Set global lock type to be sanlock or dlm.
.
.TP
.BR -i | --host-id " " \fInum
.BR -i | --host-id\ \c
.I num
Set the local sanlock host id.
.
.TP
.BR -F | --host-id-file " " \fIpath
.BR -F | --host-id-file\ \c
.I path
A file containing the local sanlock host_id.
.
.TP
.BR -o | --sanlock-timeout " " \fIseconds
.BR -o | --sanlock-timeout\ \c
.I seconds
Override the default sanlock I/O timeout.
.
.TP
@@ -101,56 +117,65 @@ some one time set up steps:
.
.SS 1. choose a lock manager
.
.I dlm
.br
.TP 8
.B sanlock
Choose sanlock if dlm/corosync are not otherwise required.
sanlock does not depend on any clustering software or configuration.
.
.TP
.B dlm
If dlm (or corosync) are already being used by other cluster
software, then select dlm. dlm uses corosync which requires additional
configuration beyond the scope of this document. See corosync and dlm
documentation for instructions on configuration, set up and usage.
.P
.I sanlock
.br
Choose sanlock if dlm/corosync are not otherwise required.
sanlock does not depend on any clustering software or configuration.
.
.SS 2. configure hosts to use lvmlockd
.
On all hosts running lvmlockd, configure lvm.conf:
.nf
use_lvmlockd = 1
.fi
On all hosts running lvmlockd, configure
.BR lvm.conf (5):
.P
.I sanlock
.br
.EX
use_lvmlockd = 1
.EE
.
.TP 8
.B sanlock
Assign each host a unique host_id in the range 1-2000 by setting
.br
#DEFAULT_SYS_DIR#/lvmlocal.conf local/host_id
.I #DEFAULT_SYS_DIR#/lvmlocal.conf
local/host_id
.
.SS 3. start lvmlockd
.
Start the lvmlockd daemon.
.br
Use systemctl, a cluster resource agent, or run directly, e.g.
.br
.P
.EX
systemctl start lvmlockd
.EE
.
.SS 4. start lock manager
.
.I sanlock
.br
.TP 8
.B sanlock
Start the sanlock and wdmd daemons.
.br
Use systemctl or run directly, e.g.
.br
.sp
.EX
systemctl start wdmd sanlock
.P
.I dlm
.br
.EE
.
.TP
.B dlm
Start the dlm and corosync daemons.
.br
Use systemctl, a cluster resource agent, or run directly, e.g.
.br
.sp
.EX
systemctl start corosync dlm
.EE
.
.SS 5. create VG on shared devices
.
@@ -162,7 +187,9 @@ and lvmlockd uses the chosen lock manager.
.
.SS 6. start VG on all hosts
.
.EX
vgchange --lockstart
.EE
.P
Shared VGs must be started before they are used. Starting the VG performs
lock manager initialization that is necessary to begin using locks (i.e.
@@ -185,33 +212,30 @@ multiple hosts.)
After initial set up, start up and shut down include the following steps.
They can be performed directly or may be automated using systemd or a
cluster resource manager/agents. When using lvmlockd.service, daemon
options can be set in /etc/sysconfig/lvmlockd as OPTIONS='-x1 -y2'.
.P
\[bu]
options can be set in
.I /etc/sysconfig/lvmlockd
as OPTIONS='-x1 -y2'.
.
.IP \[bu] 2
start lvmlockd
.br
\[bu]
.
.IP \[bu]
start lock manager
.br
\[bu]
.
.IP \[bu]
vgchange --lockstart
.br
\[bu]
.
.IP \[bu]
activate LVs in shared VGs
.br
.P
The shut down sequence is the reverse:
.P
\[bu]
.IP \[bu] 2
deactivate LVs in shared VGs
.br
\[bu]
.IP \[bu]
vgchange --lockstop
.br
\[bu]
.IP \[bu]
stop lock manager
.br
\[bu]
.IP \[bu]
stop lvmlockd
.
.SH TOPICS
@@ -220,36 +244,38 @@ stop lvmlockd
.
The following terms are used to describe the different ways of accessing
VGs on shared devices.
.P
.I "shared VG"
.P
.
.TP
.I shared VG
A shared VG exists on shared storage that is visible to multiple hosts.
LVM acquires locks through lvmlockd to coordinate access to shared VGs.
A shared VG has lock_type "dlm" or "sanlock", which specifies the lock
manager lvmlockd will use.
.P
.sp
When the lock manager for the lock type is not available (e.g. not started
or failed), lvmlockd is unable to acquire locks for LVM commands. In this
situation, LVM commands are only allowed to read and display the VG;
changes and activation will fail.
.P
.I "local VG"
.P
.
.TP
.I local VG
A local VG is meant to be used by a single host. It has no lock type or
lock type "none". A local VG typically exists on local (non-shared)
devices and cannot be used concurrently from different hosts.
.P
.sp
If a local VG does exist on shared devices, it should be owned by a single
host by having the system ID set, see
.BR lvmsystemid (7).
The host with a matching system ID can use the local VG and other hosts
will ignore it. A VG with no lock type and no system ID should be
excluded from all but one host using lvm.conf filters. Without any of
these protections, a local VG on shared devices can be easily damaged or
destroyed.
.P
.I "clvm VG"
.P
excluded from all but one host using
.BR lvm.conf (5)
filters.
Without any of these protections, a local VG on shared devices
can be easily damaged or destroyed.
.
.TP
.I clvm VG
A clvm VG (or clustered VG) is a VG on shared storage (like a shared VG)
that requires clvmd for clustering and locking. See below for converting
a clvm/clustered VG to a shared VG.
@@ -267,9 +293,11 @@ does for foreign VGs.
.
.SS Creating the first sanlock VG
.
When use_lvmlockd is first enabled in lvm.conf, and before the first
sanlock VG is created, no global lock will exist. In this initial state,
LVM commands try and fail to acquire the global lock, producing a warning,
When use_lvmlockd is first enabled in
.BR lvm.conf (5),
and before the first sanlock VG is created, no global lock will exist.
In this initial state, LVM commands try
and fail to acquire the global lock, producing a warning,
and some commands are disallowed. Once the first sanlock VG is created,
the global lock will be available, and LVM will be fully operational.
.P
@@ -282,7 +310,7 @@ special attention. This is because sanlock locks exist on storage within
the VG, so they are not available until after the VG is created. The
first sanlock VG that is created will automatically contain the "global
lock". Be aware of the following special considerations:
.P
.
.IP \[bu] 2
The first vgcreate command needs to be given the path to a device that has
not yet been initialized with pvcreate. The pvcreate initialization will
@@ -301,10 +329,17 @@ See below for more information about managing the sanlock global lock.
.
.SS Using shared VGs
.
In the 'vgs' command, shared VGs are indicated by "s" (for shared) in
the sixth attr field, and by "shared" in the "--options shared" report
field. The specific lock type and lock args for a shared VG can be
displayed with 'vgs -o+locktype,lockargs'.
In the
.BR vgs (8)
command, shared VGs are indicated by "s" (for shared)
in the sixth attr field,
and by "shared" in the "--options shared" report field.
The specific lock type and lock args for a shared VG can be
displayed with:
.P
.EX
# vgs -o+locktype,lockargs
.EE
.P
Shared VGs need to be "started" and "stopped", unlike other types of VGs.
See the following section for a full description of starting and stopping.
@@ -345,10 +380,11 @@ the VG's devices are visible on the system
A shared VG can be stopped if all LVs are deactivated.
.P
All shared VGs can be started/stopped using:
.br
vgchange --lockstart
.br
vgchange --lockstop
.P
.EX
# vgchange --lockstart
# vgchange --lockstop
.EE
.P
Individual VGs can be started/stopped using:
.br
@@ -364,36 +400,37 @@ lvmlockd can be asked directly to stop all lockspaces:
.br
lvmlockctl -S|--stop-lockspaces
.P
To start only selected shared VGs, use the lvm.conf
activation/lock_start_list. When defined, only VG names in this list are
To start only selected shared VGs, use the
.BR lvm.conf (5)
\fBactivation/lock_start_list\fP.
When defined, only VG names in this list are
started by vgchange. If the list is not defined (the default), all
visible shared VGs are started. To start only "vg1", use the following
lvm.conf configuration:
.BR lvm.conf (5)
configuration:
.P
.nf
.EX
activation {
lock_start_list = [ "vg1" ]
...
\ lock_start_list = [ "vg1" ]
\ \&...
}
.fi
.EE
.
.SS Internal command locking
.
To optimize the use of LVM with lvmlockd, be aware of the three kinds of
locks and when they are used:
.P
.
.TP
.I Global lock
.P
The global lock is associated with global information, which is
information not isolated to a single VG. This includes:
.P
\[bu]
.RS
.IP \[bu] 2
The global VG namespace.
.br
\[bu]
.IP \[bu]
The set of orphan PVs and unused devices.
.br
\[bu]
.IP \[bu]
The properties of orphan PVs, e.g. PV size.
.P
The global lock is acquired in shared mode by commands that read this
@@ -406,28 +443,29 @@ takes a PV from the list of unused PVs.
When an LVM command is given a tag argument, or uses select, it must read
all VGs to match the tag or selection, which causes the global lock to be
acquired.
.P
.RE
.
.TP
.I VG lock
.P
A VG lock is associated with each shared VG. The VG lock is acquired in
shared mode to read the VG and in exclusive mode to change the VG or
activate LVs. This lock serializes access to a VG with all other LVM
commands accessing the VG from all hosts.
.P
.sp
The command 'vgs <vgname>' does not acquire the global lock (it does not
need the list of all VG names), but will acquire the VG lock on each VG
name argument.
.P
.
.TP
.I LV lock
.P
An LV lock is acquired before the LV is activated, and is released after
the LV is deactivated. If the LV lock cannot be acquired, the LV is not
activated. (LV locks are persistent and remain in place when the
activation command is done. Global and VG locks are transient, and are
held only while an LVM command is running.)
.P
.
.TP
.I lock retries
.P
If a request for a global or VG lock fails due to a lock conflict with
another host, lvmlockd automatically retries for a short time before
returning a failure to the LVM command. If those retries are
@@ -457,8 +495,8 @@ vgcreate determines that it's creating the first sanlock VG when no other
sanlock VGs are visible on the system. It is possible that other sanlock
VGs do exist, but are not visible when vgcreate checks for them. In this
case, vgcreate will create a new sanlock VG with the global lock enabled.
When the another VG containing a global lock appears, lvmlockd will then
see more than one VG with a global lock enabled. LVM commands will report
When another VG containing a global lock appears, lvmlockd will then see
more than one VG with a global lock enabled. LVM commands will report
that there are duplicate global locks.
.P
If the situation arises where more than one sanlock VG contains a global
@@ -495,7 +533,7 @@ device, then use vgextend to add other devices.
.
In a shared VG, LV activation involves locking through lvmlockd, and the
following values are possible with lvchange/vgchange -a:
.P
.
.IP \fBy\fP|\fBey\fP
The command activates the LV in exclusive mode, allowing a single host
to activate the LV. Before activating the LV, the command uses lvmlockd
@@ -536,9 +574,13 @@ In a sanlock VG, the sanlock locks are held on the hidden "lvmlock" LV.
If the PV holding this LV is lost, a new lvmlock LV needs to be created.
To do this, ensure no hosts are using the VG, then forcibly change the
lock type to "none" (see above). Then change the lock type back to
"sanlock" with the normal command for changing the lock type: vgchange
--locktype sanlock VG. This recreates the internal lvmlock LV with the
necessary locks.
"sanlock" with the normal command for changing the lock type:
.P
.EX
# vgchange --locktype sanlock VG
.EE
.P
This recreates the internal lvmlock LV with the necessary locks.
.
.SS Locking system failures
.
@@ -549,7 +591,7 @@ in the lock manager. Orphaned locks must be cleared or adopted before the
associated resources can be accessed normally. If lock adoption is
enabled, lvmlockd keeps a record of locks in the adopt-file. A subsequent
instance of lvmlockd will then adopt locks orphaned by the previous
instance. Adoption must be enabled in both instances (--adopt|-A 1).
instance. Adoption must be enabled in both instances (-A|--adopt 1).
Without adoption, the lock manager or host would require a reset to clear
orphaned lock state.
.P
@@ -596,8 +638,10 @@ When the sanlock daemon detects that the lease storage is lost, it runs
the command lvmlockctl --kill <vgname>. This lvmlockctl command can be
configured to run another command to forcibly deactivate LVs, taking the
place of the manual process described above. The other command is
configured in the lvm.conf lvmlockctl_kill_command setting. The VG name
is appended to the end of the command specified.
configured in the
.BR lvm.conf (5)
\fBlvmlockctl_kill_command\fP setting.
The VG name is appended to the end of the command specified.
.P
The lvmlockctl_kill_command should forcibly deactivate LVs in the VG,
ensuring that existing writes to LVs in the VG are complete and that
@@ -609,23 +653,28 @@ equivalent of running lvmlockctl --drop). If this completes in time, a
machine reset can be avoided.
.P
One possible option is to create a script my_vg_kill_script.sh:
.nf
#!/bin/bash
VG=$1
# replace dm table with the error target for top level LVs
dmsetup wipe_table -S "uuid=~LVM && vgname=$VG && lv_layer=\\"\\""
# check that the error target is in place
dmsetup table -c -S "uuid=~LVM && vgname=$VG && lv_layer=\\"\\"" |grep -vw error
if [[ $? -ne 0 ]] ; then
exit 0
fi
exit 1
.fi
.P
Set in lvm.conf:
.nf
lvmlockctl_kill_command="/usr/sbin/my_vg_kill_script.sh"
.fi
.EX
#!/bin/bash
VG=$1
.P
# replace dm table with the error target for top level LVs
dmsetup wipe_table -S "uuid=~LVM && vgname=$VG && lv_layer=\\"\\""
.P
# check that the error target is in place
dmsetup table -c -S "uuid=~LVM && vgname=$VG && lv_layer=\\"\\"" |grep -vw error
if [[ $? -ne 0 ]] ; then
\ exit 0
fi
exit 1
.EE
.P
Set in
.BR lvm.conf (5):
.P
.EX
lvmlockctl_kill_command="/usr/sbin/my_vg_kill_script.sh"
.EE
.P
(The script and dmsetup commands should be tested with the actual VG to
ensure that all top level LVs are properly disabled.)
@@ -649,12 +698,14 @@ cluster name changes, or the VG is moved to a new cluster, the dlm cluster
name saved in the VG must also be changed.
.P
To see the dlm cluster name saved in the VG, use the command:
.br
vgs -o+locktype,lockargs <vgname>
.P
.EX
# vgs -o+locktype,lockargs <vgname>
.EE
.P
To change the dlm cluster name in the VG when the VG is still used by the
original cluster:
.P
.
.IP \[bu] 2
Start the VG on the host changing the lock type
.br
@@ -739,7 +790,7 @@ vgchange --locktype sanlock|dlm \-\-lockopt force <vgname>
.SS Changing a shared VG to a local VG
.
All LVs must be inactive to change the lock type.
.P
.
.IP \[bu] 2
Start the VG on the host making the change:
.br
@@ -802,17 +853,17 @@ operation.
.SS Limitations of shared VGs
.
Commands that cannot be run on shared VGs:
.br
\[bu]
.
.IP \[bu] 2
splitting snapshots from LVs
.br
\[bu]
.
.IP \[bu]
splitting mirrors in sanlock VGs
.br
\[bu]
.
.IP \[bu]
pvmove of entire PVs, or under LVs activated with shared locks
.br
\[bu]
.
.IP \[bu]
vgmerge
.
.SS lvmlockd changes from clvmd
@@ -827,7 +878,9 @@ Visible usage differences between shared VGs (using lvmlockd) and
clvm/clustered VGs (using clvmd):
.
.IP \[bu] 2
lvm.conf is configured to use lvmlockd by setting use_lvmlockd=1.
.BR lvm.conf (5)
is configured to use lvmlockd by setting \fBuse_lvmlockd=1\fP.
.br
clvmd used locking_type=3.
.
.IP \[bu]
@@ -873,8 +926,9 @@ lvmlockd includes VG reporting options lock_type and lock_args, and LV
reporting option lock_args to view the corresponding metadata fields.
.
.IP \[bu]
In the 'vgs' command's sixth VG attr field, "s" for "shared" is displayed
for shared VGs.
In the
.BR vgs (8)
command's sixth VG attr field, "s" for "shared" is displayed for shared VGs.
.
.IP \[bu]
If lvmlockd fails or is killed while in use, locks it held remain but are
@@ -882,10 +936,18 @@ orphaned in the lock manager. lvmlockd can be restarted with an option to
adopt the orphan locks from the previous instance of lvmlockd.
.
.IP \[bu]
The 'lvs' command does not report any remote state, because lvmlockd is
The
.BR lvs (8)
command does not report any remote state, because lvmlockd is
unable to passively check the remote active or lock state of an LV.
.
.SH SEE ALSO
.
.nh
.na
.BR lvm (8),
.BR lvmlockctl (8)
.BR lvmlockctl (8),
.BR lvchange (8),
.BR lvgs (8),
.BR vgs (8),
.BR lvm.conf (5)

View File

@@ -1,32 +1,45 @@
.TH LVMPOLLD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
.
.de NSY
. ie t .SY \\$1
. el \{\
. ie \\n(.$>1 \{\
. PD 0
. TP \\w'\\$1\ 'u
. \}
. el .TP
. B \\$1
. na
. nh
. \}
..
.
.SH NAME
.
lvmpolld \(em LVM poll daemon
.
.SH SYNOPSIS
.
.B lvmpolld
.nh
.ad l
.RB [ -l | --log
.BR all | wire | debug ]
.RB [ -p | --pidfile
.IR pidfile_path ]
.RB [ -s | --socket
.IR socket_path ]
.RB [ -B | --binary
.IR lvm_binary_path ]
.RB [ -t | --timeout
.IR timeout_value ]
.NSY lvmpolld 1
.RB [ -B | --binary\ \c
.IR lvm_bi\%nary_path ]
.RB [ -f | --foreground ]
.RB [ -h | --help ]
.RB [ -l | --log\ \c
.BR all |\: wire | debug ]
.RB [ -p | --pidfile\ \c
.IR pidfile_path ]
.RB [ -s | --socket\ \c
.IR socket_path ]
.RB [ -t | --timeout\ \c
.IR timeout_value ]
.RB [ -V | --version ]
.ad b
.hy
.P
.B lvmpolld
.sp
.NSY lvmpolld
.RB [ --dump ]
.ad
.hy
.PD
.
.SH DESCRIPTION
.
@@ -51,8 +64,20 @@ To run the daemon in a test environment both the pidfile_path and the
socket_path should be changed from the defaults.
.
.TP
\fB-B\fP|\fB--binary\fP \fIlvm_binary_path\fP
Optional path to alternative LVM binary
(default: \fI#LVM_PATH#\fP).
Use for testing purposes only.
.
.TP
.B --dump
Contact the running lvmpolld daemon to obtain the complete state
and print it out in a raw format.
.
.TP
.BR -f | --foreground
Don't fork, but run in the foreground.
.
.TP
.BR -h | --help
Show help information.
@@ -62,39 +87,34 @@ Show help information.
Select the type of log messages to generate.
Messages are logged by syslog.
Additionally, when \fB-f\fP is given they are also sent to standard error.
There are two classes of messages: wire and debug. Selecting '\fBall\fP' supplies both
There are two classes of messages: wire and debug.
Selecting '\fBall\fP' supplies both
and is equivalent to a comma-separated list \fB-l wire,debug\fP.
.
.TP
.BR -p | --pidfile " " \fIpidfile_path
\fB-p\fP|\fB--pidfile\fP \fIpidfile_path\fP
Path to the pidfile. This overrides both the built-in default
(\fI#DEFAULT_PID_DIR#/lvmpolld.pid\fP) and the environment variable
\fBLVM_LVMPOLLD_PIDFILE\fP. This file is used to prevent more
than one instance of the daemon running simultaneously.
(\fI#DEFAULT_PID_DIR#/lvmpolld.pid\fP)
and the environment variable
\fBLVM_LVMPOLLD_PIDFILE\fP.
This file is used to prevent more than one instance
of the daemon running simultaneously.
.
.TP
.BR -s | --socket " " \fIsocket_path
\fB-s\fP|\fB--socket\fP \fIsocket_path\fP
Path to the socket file. This overrides both the built-in default
(\fI#DEFAULT_RUN_DIR#/lvmpolld.socket\fP) and the environment variable
\fBLVM_LVMPOLLD_SOCKET\fP.
.
.TP
.BR -t | --timeout " " \fItimeout_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.
.
.TP
.BR -B | --binary " " \fIlvm_binary_path
Optional path to alternative LVM binary (default: \fI#LVM_PATH#\fP). Use for
testing purposes only.
\fB-t\fP|\fB--timeout\fP \fItimeout_value\fP
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.
.
.TP
.BR -V | --version
Display the version of lvmpolld daemon.
.TP
.B --dump
Contact the running lvmpolld daemon to obtain the complete state and print it
out in a raw format.
.
.SH ENVIRONMENT VARIABLES
.
@@ -109,4 +129,8 @@ Path for the socket file.
.SH SEE ALSO
.
.BR lvm (8),
.BR lvm.conf (5)
.BR lvm.conf (5),
.BR lvchange (8),
.BR lvconvert (8),
.BR pvmove (8),
.BR vgchange (8)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
.TH "LVMSADC" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMSADC" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.SH NAME
.

View File

@@ -1,4 +1,4 @@
.TH "LVMSAR" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMSAR" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.SH NAME
.

View File

@@ -1,4 +1,13 @@
.TH "LVMSYSTEMID" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMSYSTEMID" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc"
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.SH NAME
.
@@ -160,96 +169,89 @@ system ID:
.
.TP
.B none
.br
LVM will not use a system ID. LVM is allowed to access VGs without a
system ID, and will create new VGs without a system ID. An undefined
system_id_source is equivalent to none.
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "none"
\ system_id_source = "none"
}
.fi
.EE
.
.TP
.B appmachineid
.br
An LVM-specific derivation of /etc/machine-id is used as the system ID.
See
.BR machine-id (5)
to check if machine-id is available on the host.
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "appmachineid"
\ system_id_source = "appmachineid"
}
.fi
.EE
.
.TP
.B machineid
.br
The content of /etc/machine-id is used as the system ID if available.
(appmachineid is recommended to avoid exposing the confidential
machine-id.)
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "machineid"
\ system_id_source = "machineid"
}
.fi
.EE
.
.TP
.B uname
.br
The string utsname.nodename from
.BR uname (2)
is used as the system ID. A uname beginning with "localhost"
is ignored and equivalent to none.
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "uname"
\ system_id_source = "uname"
}
.fi
.EE
.
.TP
.B lvmlocal
.br
The system ID is defined in lvmlocal.conf local/system_id.
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "lvmlocal"
\ system_id_source = "lvmlocal"
}
.fi
.EE
.sp
.I lvmlocal.conf
.nf
.EX
local {
system_id = "example_name"
\ system_id = "example_name"
}
.fi
.EE
.
.TP
.B file
.br
The system ID is defined in a file specified by lvm.conf
global/system_id_file.
.sp
.I lvm.conf
.nf
.EX
global {
system_id_source = "file"
system_id_file = "/path/to/file"
\ system_id_source = "file"
\ system_id_file = "/path/to/file"
}
.fi
.LP
.EE
.P
Changing system_id_source will likely cause the system ID of the host to
change, which will prevent the host from using VGs that it previously used
(see extra_system_ids below to handle this.)
@@ -268,11 +270,11 @@ with other system IDs, those other system IDs can be listed in
lvmlocal.conf local/extra_system_ids.
.P
.I lvmlocal.conf
.nf
.EX
local {
extra_system_ids = [ "my_other_name" ]
\ extra_system_ids = [ "my_other_name" ]
}
.fi
.EE
.P
A safer option may be configuring the extra values as needed on the
command line as:
@@ -281,16 +283,17 @@ command line as:
.
.SS vgcreate
.
In vgcreate, the host running the command assigns its own system ID to the
new VG. To override this and set another system ID:
In vgcreate, the host running the command assigns its own system ID
to the new VG.
To override this and set another system ID:
.P
.B vgcreate --systemid
.I SystemID VG PVs
.P
Overriding the host's system ID makes it possible for a host to create a
VG that it may not be able to use. Another host with a system ID matching
the one specified may not recognize the new VG without manually rescanning
devices.
Overriding the host's system ID makes it possible for a host to create
a VG that it may not be able to use.
Another host with a system ID matching the one specified
may not recognize the new VG without manually rescanning devices.
.P
If the --systemid argument is an empty string (""), the VG is created with
no system ID, making it accessible to other hosts (see warnings above.)
@@ -367,7 +370,7 @@ system ID. The same is true of any block device that is not a PV.
.SH SEE ALSO
.
.nh
.ad l
.na
.BR vgcreate (8),
.BR vgchange (8),
.BR vgimport (8),
@@ -375,5 +378,6 @@ system ID. The same is true of any block device that is not a PV.
.BR vgs (8),
.BR lvmlockd (8),
.BR lvm.conf (5),
.P
.BR machine-id (5),
.BR uname (2)

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,13 @@
.TH "LVMVDO" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
.TH "LVMVDO" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.
.if !dEX \{\
.de EX
.nf
..
.de EE
.fi
..
\}
.
.SH NAME
.
@@ -18,8 +27,8 @@ physical blocks. Thin provisioning manages the mapping from logical blocks
presented by VDO to where the data has actually been physically stored,
and also eliminates any blocks of all zeroes.
.P
With deduplication, instead of writing the same data more than once, VDO detects and records each
duplicate block as a reference to the original
With deduplication, instead of writing the same data more than once,
VDO detects and records each duplicate block as a reference to the original
block. VDO maintains a mapping from Logical Block Addresses (LBA) (used by the
storage layer above VDO) to physical block addresses (used by the storage
layer under VDO). After deduplication, multiple logical block addresses
@@ -52,30 +61,20 @@ for extracting statistics from VDO volumes.
.SH VDO TERMS
.
.TP
VDODataLV
.br
VDO data LV
.br
A large hidden LV with the _vdata suffix. It is created in a VG
.br
used by the VDO kernel target to store all data and metadata blocks.
.B VDODataLV
VDO data LV is large hidden LV with the _vdata suffix.
It is created in a VG used by the VDO kernel target
to store all data and metadata blocks.
.
.TP
VDOPoolLV
.br
VDO pool LV
.br
A pool for virtual VDOLV(s), which are the size of used VDODataLV.
.br
.B VDOPoolLV
VDO pool LV is pool for virtual VDOLV(s),
which are the size of used VDODataLV.
Only a single VDOLV is currently supported.
.
.TP
VDOLV
.br
VDO LV
.br
Created from VDOPoolLV.
.br
.B VDOLV
VDO LV is a virtual LV created from VDOPoolLV.
Appears blank after creation.
.
.SH VDO USAGE
@@ -86,7 +85,8 @@ The primary methods for using VDO with lvm2:
.SS \n[step]. Create a VDOPoolLV and a VDOLV
.
Create a VDOPoolLV that will hold VDO data, and a
virtual size VDOLV that the user can use. If you do not specify the virtual size,
virtual size VDOLV that the user can use.
If you do not specify the virtual size,
then the VDOLV is created with the maximum size that
always fits into data volume even if no
deduplication or compression can happen
@@ -96,19 +96,25 @@ the sequence of vpool0, vpool1 ...
.P
Note: The performance of TRIM/Discard operations is slow for large
volumes of VDO type. Please try to avoid sending discard requests unless
necessary because it might take considerable amount of time to finish the discard
operation.
necessary because it might take considerable amount of time
to finish the discard operation.
.P
.nf
.B lvcreate --type vdo -n VDOLV -L DataSize -V LargeVirtualSize VG/VDOPoolLV
.B lvcreate --vdo -L DataSize VG
.fi
.B lvcreate --type vdo -n
.I VDOLV
.B -L
.I DataSize
.B -V
.I LargeVirtualSize VG/VDOPoolLV
.br
.B lvcreate --vdo -L
.I DataSize VG
.P
.I Example
.nf
.P
.EX
# lvcreate --type vdo -n vdo0 -L 10G -V 100G vg/vdopool0
# mkfs.ext4 -E nodiscard /dev/vg/vdo0
.fi
.EE
.
.SS \n+[step]. Convert an existing LV into VDOPoolLV
.
@@ -121,40 +127,51 @@ specify the virtual size of the VDOLV associated with this VDOPoolLV.
If you do not specify the virtual size, it will be set to the maximum size
that can keep 100% incompressible data there.
.P
.nf
.B lvconvert --type vdo-pool -n VDOLV -V VirtualSize VG/VDOPoolLV
.B lvconvert --vdopool VG/VDOPoolLV
.fi
.B lvconvert --type vdo-pool -n
.I VDOLV
.B -V
.I VirtualSize VG/VDOPoolLV
.br
.B lvconvert --vdopool
.I VG/VDOPoolLV
.P
.I Example
.nf
.P
.EX
# lvconvert --type vdo-pool -n vdo0 -V10G vg/ExistingLV
.fi
.EE
.
.SS \n+[step]. Change the compression and deduplication of a VDOPoolLV
.
Disable or enable the compression and deduplication for VDOPoolLV
(the volume that maintains all VDO LV(s) associated with it).
.P
.B lvchange --compression y|n --deduplication y|n VG/VDOPoolLV
.B lvchange --compression
.BR y | n
.B --deduplication
.BR y | n
.I VG/VDOPoolLV
.P
.I Example
.nf
.P
.EX
# lvchange --compression n vg/vdopool0
# lvchange --deduplication y vg/vdopool1
.fi
.EE
.
.SS \n+[step]. Change the default settings used for creating a VDOPoolLV
.
VDO allows to set a large variety of options. Lots of these settings
can be specified in lvm.conf or profile settings. You can prepare
a number of different profiles in the \fI#DEFAULT_SYS_DIR#/profile\fP directory
and just specify the profile file name.
a number of different profiles in the
\fI#DEFAULT_SYS_DIR#/profile\fP
directory and just specify the profile file name.
Check the output of \fBlvmconfig --type default --withcomments\fP
for a detailed description of all individual VDO settings.
.P
.I Example
.nf
.P
.EX
# cat <<EOF > #DEFAULT_SYS_DIR#/profile/vdo_create.profile
allocation {
.RS
@@ -180,7 +197,7 @@ EOF
.P
# lvcreate --vdo -L10G --metadataprofile vdo_create vg/vdopool0
# lvcreate --vdo -L10G --config 'allocation/vdo_cpu_threads=4' vg/vdopool1
.fi
.EE
.
.SS \n+[step]. Set or change VDO settings with option --vdosettings
.
@@ -193,17 +210,18 @@ So i.e. vdo_use_deduplication=1 and deduplication=1 are equivalent.
To change the option for an already existing VDOPoolLV use
.BR lvchange (8)
command. However not all option can be changed.
Only compression and deduplication options can be also changed for an active VDO LV.
Only compression and deduplication options can be also changed
for an active VDO LV.
Lowest priority options are specified with configuration file,
then with --vdosettings and highest are explicit option --compression
and --deduplication.
.P
.I Example
.P
.nf
.EX
# lvcreate --vdo -L10G --vdosettings 'ack_threads=1 hash_zone_threads=2' vg/vdopool0
# lvchange --vdosettings 'bio_threads=2 deduplication=1' vg/vdopool0
.fi
.EE
.
.SS \n+[step]. Checking the usage of VDOPoolLV
.
@@ -213,26 +231,28 @@ in the content of the virtual data for the VDOLV and how much space is already
consumed with all the data and metadata blocks in the VDOPoolLV.
For a detailed description, use the \fBvdostats\fP(8) command.
.P
Note: \fBvdostats\fP(8) currently understands only \fI/dev/mapper\fP device names.
Note: \fBvdostats\fP(8) currently understands only
\fI/dev/mapper\fP device names.
.P
.I Example
.nf
.P
.EX
# lvcreate --type vdo -L10G -V20G -n vdo0 vg/vdopool0
# mkfs.ext4 -E nodiscard /dev/vg/vdo0
# lvs -a vg
.P
LV VG Attr LSize Pool Origin Data%
vdo0 vg vwi-a-v--- 20.00g vdopool0 0.01
vdopool0 vg dwi-ao---- 10.00g 30.16
[vdopool0_vdata] vg Dwi-ao---- 10.00g
\ LV VG Attr LSize Pool Origin Data%
\ vdo0 vg vwi-a-v--- 20.00g vdopool0 0.01
\ vdopool0 vg dwi-ao---- 10.00g 30.16
\ [vdopool0_vdata] vg Dwi-ao---- 10.00g
.P
# vdostats --all /dev/mapper/vg-vdopool0-vpool
/dev/mapper/vg-vdopool0 :
version : 30
release version : 133524
data blocks used : 79
...
.fi
\ version : 30
\ release version : 133524
\ data blocks used : 79
\ ...
.EE
.
.SS \n+[step]. Extending the VDOPoolLV size
.
@@ -248,13 +268,15 @@ with the \fBactivation/vdo_pool_autoextend_percent\fP and
.P
Note: You cannot reduce the size of a VDOPoolLV.
.P
.B lvextend -L+AddingSize VG/VDOPoolLV
.B lvextend -L+\c
.I AddingSize VG/VDOPoolLV
.P
.I Example
.nf
.P
.EX
# lvextend -L+50G vg/vdopool0
# lvresize -L300G vg/vdopool1
.fi
.EE
.
.SS \n+[step]. Extending or reducing the VDOLV size
.
@@ -265,30 +287,36 @@ Note: The reduction needs to process TRIM for reduced disk area
to unmap used data blocks from the VDOPoolLV, which might take
a long time.
.P
.B lvextend -L+AddingSize VG/VDOLV
.B lvextend -L+\c
.I AddingSize VG/VDOLV
.br
.B lvreduce -L-ReducingSize VG/VDOLV
.B lvreduce -L-\c
.I ReducingSize VG/VDOLV
.P
.I Example
.nf
.P
.EX
# lvextend -L+50G vg/vdo0
# lvreduce -L-50G vg/vdo1
# lvresize -L200G vg/vdo2
.fi
.EE
.
.SS \n+[step]. Component activation of a VDODataLV
.
You can activate a VDODataLV separately as a component LV for examination
purposes. The activation of the VDODataLV activates the data LV in read-only mode,
purposes.
The activation of the VDODataLV activates the data LV in read-only mode,
and the data LV cannot be modified.
If the VDODataLV is active as a component, any upper LV using this volume CANNOT
be activated. You have to deactivate the VDODataLV first to continue to use the VDOPoolLV.
If the VDODataLV is active as a component,
any upper LV using this volume CANNOT be activated.
You have to deactivate the VDODataLV first to continue to use the VDOPoolLV.
.P
.I Example
.nf
.P
.EX
# lvchange -ay vg/vpool0_vdata
# lvchange -an vg/vpool0_vdata
.fi
.EE
.
.SH VDO TOPICS
.
@@ -307,21 +335,23 @@ with thin-pool named after original LV name LV_tpool0.
See \fBlvmthin\fP(7) for more details.
.P
.I Example
.nf
.P
.EX
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvconvert --type thin vg/vdo1
# lvcreate -V20 vg/vdo1_tpool0
.fi
.EE
.
.SS \n+[step]. VDOPoolLV on top of raid
.
Using a raid type LV for a VDODataLV.
.P
.I Example
.nf
.P
.EX
# lvcreate --type raid1 -L 5G -n vdopool vg
# lvconvert --type vdo-pool -V 10G vg/vdopool
.fi
.EE
.
.SS \n+[step]. Caching a VDOPoolLV
.
@@ -330,12 +360,13 @@ to accelerate reads and writes of already compressed and deduplicated
data blocks together with VDO metadata.
.P
.I Example
.nf
.P
.EX
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvcreate --type cache-pool -L 1G -n cachepool vg
# lvconvert --cache --cachepool vg/cachepool vg/vdopool
# lvconvert --uncache vg/vdopool
.fi
.EE
.
.SS \n+[step]. Caching a VDOLV
.
@@ -343,12 +374,13 @@ VDO LV cache allow you to 'cache' a device for better performance before
it hits the processing of the VDO Pool LV layer.
.P
.I Example
.nf
.P
.EX
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvcreate --type cache-pool -L 1G -n cachepool vg
# lvconvert --cache --cachepool vg/cachepool vg/vdo1
# lvconvert --uncache vg/vdo1
.fi
.EE
.
.SS \n+[step]. Usage of Discard/TRIM with a VDOLV
.
@@ -359,28 +391,29 @@ Unless you really need it, you should avoid using discard.
.P
When a block device is going to be rewritten,
its blocks will be automatically reused for new data.
Discard is useful in situations when user knows that the given portion of a VDO LV
is not going to be used and the discarded space can be used for block
provisioning in other regions of the VDO LV.
Discard is useful in situations when user knows that the given portion of
a VDO LV is not going to be used and the discarded space
can be used for block provisioning in other regions of the VDO LV.
For the same reason, you should avoid using mkfs with discard for
a freshly created VDO LV to save a lot of time that this operation would
take otherwise as device is already expected to be empty.
.
.SS \n+[step]. Memory usage
.
The VDO target requires 38 MiB of RAM and several variable amounts:
The VDO target requires 38\ MiB of RAM and several variable amounts:
.
.IP \(bu 2
1.15 MiB of RAM for each 1 MiB of configured block map cache size.
The block map cache requires a minimum of 150 MiB RAM.
.br
1.15\ MiB of RAM for each 1\ MiB of configured block map cache size.
The block map cache requires a minimum of 150\ MiB RAM.
.
.IP \(bu
1.6 MiB of RAM for each 1 TiB of logical space.
.br
1.6\ MiB of RAM for each 1\ TiB of logical space.
.
.IP \(bu
268 MiB of RAM for each 1 TiB of physical storage managed by the volume.
.br
268\ MiB of RAM for each 1\ TiB of physical storage managed by the volume.
.
.P
UDS requires a minimum of 250 MiB of RAM,
UDS requires a minimum of 250\ MiB of RAM,
which is also the default amount that deduplication uses.
.P
The memory required for the UDS index is determined by the index type
@@ -398,35 +431,40 @@ For most workloads, given the same amount of memory,
the difference in deduplication rates between dense
and sparse indexes is negligible.
.P
A dense index with 1 GiB of RAM maintains a 1 TiB deduplication window,
while a sparse index with 1 GiB of RAM maintains a 10 TiB deduplication window.
In general, 1 GiB is sufficient for 4 TiB of physical space with
a dense index and 40 TiB with a sparse index.
A dense index with 1\ GiB of RAM maintains a 1\ TiB deduplication window,
while a sparse index with 1\ GiB of RAM maintains
a 10\ TiB deduplication window.
In general, 1\ GiB is sufficient for 4\ TiB of physical space with
a dense index and 40\ TiB with a sparse index.
.
.SS \n+[step]. Storage space requirements
.
You can configure a VDOPoolLV to use up to 256 TiB of physical storage.
You can configure a VDOPoolLV to use up to 256\ TiB of physical storage.
Only a certain part of the physical storage is usable to store data.
This section provides the calculations to determine the usable size
of a VDO-managed volume.
.P
The VDO target requires storage for two types of VDO metadata and for the UDS index:
The VDO target requires storage for two types of VDO metadata
and for the UDS index:
.
.IP \(bu 2
The first type of VDO metadata uses approximately 1 MiB for each 4 GiB
of physical storage plus an additional 1 MiB per slab.
The first type of VDO metadata uses approximately 1\ MiB for each 4\ GiB
of physical storage plus an additional 1\ MiB per slab.
.
.IP \(bu
The second type of VDO metadata consumes approximately 1.25 MiB
for each 1 GiB of logical storage, rounded up to the nearest slab.
The second type of VDO metadata consumes approximately 1.25\ MiB
for each 1\ GiB of logical storage, rounded up to the nearest slab.
.
.IP \(bu
The amount of storage required for the UDS index depends on the type of index
and the amount of RAM allocated to the index. For each 1 GiB of RAM,
a dense UDS index uses 17 GiB of storage and a sparse UDS index will use
170 GiB of storage.
and the amount of RAM allocated to the index. For each 1\ GiB of RAM,
a dense UDS index uses 17\ GiB of storage and a sparse UDS index will use
170\ GiB of storage.
.
.SH SEE ALSO
.
.nh
.ad l
.na
.BR lvm (8),
.BR lvm.conf (5),
.BR lvmconfig (8),

View File

@@ -1,15 +1,152 @@
.TH LVREDUCE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_extents
.OPA l extents
[\fB-\fP]\fINumber\fP[PERCENT]
..
.de O_force
.OPA f force
\&\.\|.\|.\&
..
.de O_fs
.OPA fs
\fIString\fP
..
.de O_fsmode
.OPA fsmode
\fIString\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nofsck
.OPS n nofsck
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_noudevsync
.OPS noudevsync
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_resizefs
.OPS r resizefs
..
.de O_size
.OPA L size
[\fB-\fP]\fISize\fP[m|\:UNIT]
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvreduce \(em Reduce the size of a logical volume
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvreduce\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -34,129 +171,177 @@ the options section.
.
.SH USAGE
.
\fBlvreduce\fP \fB-L\fP|\fB--size\fP [\fB-\fP]\fISize\fP[m|UNIT] \fILV\fP
.nh
.na
.B lvreduce
.O_size
\fILV\fP
.RS
[
.O_extents
]
.br
.RS 4
.ad l
[ \fB-l\fP|\fB--extents\fP [\fB-\fP]\fINumber\fP[PERCENT] ]
[
.O_autobackup
]
.br
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
[
.O_force
]
.br
[ \fB-f\fP|\fB--force\fP ]
[
.O_nofsck
]
.br
[ \fB-n\fP|\fB--nofsck\fP ]
[
.O_resizefs
]
.br
[ \fB-r\fP|\fB--resizefs\fP ]
[
.O_noudevsync
]
.br
[ \fB--noudevsync\fP ]
[
.O_reportformat
]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_fs
]
.br
[ \fB--fs\fP \fIString\fP ]
.br
[ \fB--fsmode\fP \fIString\fP ]
[
.O_fsmode
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-l\fP|\fB--extents\fP [\fB-\fP]\fINumber\fP[PERCENT]
.br
.TP
.O_extents
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
@@ -176,15 +361,13 @@ When the plus \fB+\fP or minus \fB-\fP prefix is used,
the value is not an absolute size, but is relative and added or subtracted
from the current size.
.
.HP
\fB-f\fP|\fB--force\fP ...
.br
.TP
.O_force
Override various checks, confirmations and protections.
Use with extreme caution.
.
.HP
\fB--fs\fP \fIString\fP
.br
.TP
.O_fs
Control file system resizing when resizing an LV.
\fBchecksize\fP: 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
@@ -199,9 +382,8 @@ file systems that are unmounted (or mounted if prompts are skipped.)
\fBignore\fP: Resize the LV without checking for or handling a file system.
Warning: using ignore when reducing the LV size may destroy the file system.
.
.HP
\fB--fsmode\fP \fIString\fP
.br
.TP
.O_fsmode
Control file system mounting behavior for fs resize.
\fBmanage\fP: Mount or unmount the fs as needed to resize the fs,
and attempt to restore the original mount state at the end.
@@ -212,14 +394,12 @@ the command.
is unmounted. If mounting is required to resize the fs, then do not resize
the fs or the LV and fail the command.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -227,58 +407,49 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB-n\fP|\fB--nofsck\fP
.br
.TP
.O_nofsck
Do not perform fsck when resizing the file system with --resizefs.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--noudevsync\fP
.br
.TP
.O_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.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -288,17 +459,15 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-r\fP|\fB--resizefs\fP
.br
.TP
.O_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.)
.
.HP
\fB-L\fP|\fB--size\fP [\fB-\fP]\fISize\fP[m|UNIT]
.br
.TP
.O_size
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
@@ -307,29 +476,25 @@ When the plus \fB+\fP or minus \fB-\fP prefix is used,
the value is not an absolute size, but is relative and added or subtracted
from the current size.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -340,9 +505,11 @@ answer yes. Use with extreme caution.
.I LV
Logical Volume name. See \fBlvm\fP(8) for valid names.
An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -366,10 +533,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,137 @@
.TH LVREMOVE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_force
.OPA f force
\&\.\|.\|.\&
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nohistory
.OPS nohistory
..
.de O_nolocking
.OPS nolocking
..
.de O_noudevsync
.OPS noudevsync
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_select
.OPA S select
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvremove \(em Remove logical volume(s) from the system
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvremove\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -42,134 +164,173 @@ former LV completely.
.
.SH USAGE
.
\fBlvremove\fP \fIVG\fP|\fILV\fP|\fITag\fP|\fISelect\fP ...
.nh
.na
.B lvremove
\fIVG\fP|\fILV\fP|\fITag\fP|\fISelect\fP\ .\|.\|.\&
.RS
[
.O_autobackup
]
.br
.RS 4
.ad l
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
[
.O_force
]
.br
[ \fB-f\fP|\fB--force\fP ]
[
.O_select
]
.br
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
[
.O_nohistory
]
.br
[ \fB--nohistory\fP ]
[
.O_noudevsync
]
.br
[ \fB--noudevsync\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_reportformat
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-f\fP|\fB--force\fP ...
.br
.TP
.O_force
Override various checks, confirmations and protections.
Use with extreme caution.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -177,60 +338,51 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nohistory\fP
.br
.TP
.O_nohistory
Do not record history of LVs being removed.
This has no effect unless the configuration setting
metadata/record_lvs_history is enabled.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--noudevsync\fP
.br
.TP
.O_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.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -240,41 +392,38 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-S\fP|\fB--select\fP \fIString\fP
.br
.TP
.O_select
Select objects for processing and reporting based on specified criteria.
The criteria syntax is described by \fB--select help\fP and \fBlvmreport\fP(7).
For reporting commands, one row is displayed for each object matching the criteria.
The criteria syntax is described by \fB--select help\fP
and \fBlvmreport\fP(7).
For reporting commands, one row is displayed
for each object matching the criteria.
See \fB--options help\fP 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.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -284,22 +433,27 @@ answer yes. Use with extreme caution.
.TP
.I VG
Volume Group name. See \fBlvm\fP(8) for valid names.
.
.TP
.I LV
Logical Volume name. See \fBlvm\fP(8) for valid names.
An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.
.
.TP
.I Tag
Tag name. See \fBlvm\fP(8) for information about tag names and using tags
in place of a VG, LV or PV.
.
.TP
.I Select
Select indicates that a required positional parameter can
be omitted if the \fB--select\fP option is used.
No arg appears in this position.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -323,10 +477,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,126 @@
.TH LVRENAME 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_noudevsync
.OPS noudevsync
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvrename \(em Rename a logical volume
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvrename\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -18,136 +129,169 @@ historical LV information.)
.
.SH USAGE
.
\fBlvrename\fP \fIVG\fP \fILV\fP \fILV\fP\fI_new\fP
.br
.RS 4
.ad l
.nh
.na
.B lvrename
\fIVG\fP \fILV\fP \fILV\fP\fI_new\fP
.RS
[ COMMON_OPTIONS ]
.RE
.
.P
\(em
.P
.
.B lvrename
\fILV\fP \fILV\fP\fI_new\fP
.RS
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\fBlvrename\fP \fILV\fP \fILV\fP\fI_new\fP
.br
.RS 4
.ad l
[ COMMON_OPTIONS ]
.ad b
.RE
\(em
.P
Common options for command:
.
.RS 4
.ad l
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
.RS
[
.O_autobackup
]
.br
[ \fB--noudevsync\fP ]
[
.O_noudevsync
]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
.ad b
[
.O_reportformat
]
.RE
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -155,53 +299,45 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--noudevsync\fP
.br
.TP
.O_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.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -211,29 +347,25 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -243,13 +375,16 @@ answer yes. Use with extreme caution.
.TP
.I VG
Volume Group name. See \fBlvm\fP(8) for valid names.
.
.TP
.I LV
Logical Volume name. See \fBlvm\fP(8) for valid names.
An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -273,10 +408,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

File diff suppressed because it is too large Load Diff

View File

@@ -2,82 +2,110 @@
.SH NOTES
.
The lv_attr bits are:
.
.IP 1 3
Volume type: (\fBC\fP)ache, (\fBm\fP)irrored, (\fBM\fP)irrored without initial sync, (\fBo\fP)rigin,
(\fBO\fP)rigin with merging snapshot, inte(\fBg\fP)rity, (\fBr\fP)aid, (\fBR\fP)aid without initial sync,
(\fBs\fP)napshot, merging (\fBS\fP)napshot, (\fBp\fP)vmove, (\fBv\fP)irtual,
mirror or raid (\fBi\fP)mage, mirror or raid (\fBI\fP)mage out-of-sync, mirror (\fBl\fP)og device,
under (\fBc\fP)onversion, thin (\fBV\fP)olume, (\fBt\fP)hin pool, (\fBT\fP)hin pool data,
Volume type: (\fBC\fP)ache, (\fBm\fP)irrored,
(\fBM\fP)irrored without initial sync,
(\fBo\fP)rigin, (\fBO\fP)rigin with merging snapshot, inte(\fBg\fP)rity,
(\fBr\fP)aid, (\fBR\fP)aid without initial sync, (\fBs\fP)napshot,
merging (\fBS\fP)napshot, (\fBp\fP)vmove, (\fBv\fP)irtual,
mirror or raid (\fBi\fP)mage, mirror or raid (\fBI\fP)mage out-of-sync,
mirror (\fBl\fP)og device, under (\fBc\fP)onversion, thin (\fBV\fP)olume,
(\fBt\fP)hin pool, (\fBT\fP)hin pool data,
v(\fBd\fP)o pool, v(\fBD\fP)o pool data,
raid or pool m(\fBe\fP)tadata or pool metadata spare.
.IP 2 3
Permissions: (\fBw\fP)riteable, (\fBr\fP)ead-only, (\fBR\fP)ead-only activation of non-read-only
volume
.IP 3 3
Allocation policy: (\fBa\fP)nywhere, (\fBc\fP)ontiguous, (\fBi\fP)nherited, c(\fBl\fP)ing, (\fBn\fP)ormal
.
.IP 2
Permissions: (\fBw\fP)riteable, (\fBr\fP)ead-only, (\fBR\fP)ead-only activation
of non-read-only volume
.
.IP 3
Allocation policy: (\fBa\fP)nywhere, (\fBc\fP)ontiguous, (\fBi\fP)nherited,
c(\fBl\fP)ing, (\fBn\fP)ormal
This is capitalised if the volume is currently locked against allocation
changes, for example during
.BR pvmove (8).
.IP 4 3
.
.IP 4
fixed (\fBm\fP)inor
.IP 5 3
State: (\fBa\fP)ctive, (\fBh\fP)istorical, (\fBs\fP)uspended, (\fBI\fP)nvalid snapshot,
invalid (\fBS\fP)uspended snapshot, snapshot (\fBm\fP)erge failed,
suspended snapshot (\fBM\fP)erge failed, mapped (\fBd\fP)evice present without tables,
mapped device present with (\fBi\fP)nactive table, thin-pool (\fBc\fP)heck needed,
.
.IP 5
State: (\fBa\fP)ctive, (\fBh\fP)istorical, (\fBs\fP)uspended,
(\fBI\fP)nvalid snapshot, invalid (\fBS\fP)uspended snapshot,
snapshot (\fBm\fP)erge failed, suspended snapshot (\fBM\fP)erge failed,
mapped (\fBd\fP)evice present without tables,
mapped device present with (\fBi\fP)nactive table,
thin-pool (\fBc\fP)heck needed,
suspended thin-pool (\fBC\fP)heck needed, (\fBX\fP) unknown
.IP 6 3
.
.IP 6
device (\fBo\fP)pen, (\fBX\fP) unknown
.IP 7 3
Target type: (\fBC\fP)ache, (\fBm\fP)irror, (\fBr\fP)aid, (\fBs\fP)napshot, (\fBt\fP)hin, (\fBu\fP)nknown, (\fBv\fP)irtual.
.
.IP 7
Target type: (\fBC\fP)ache, (\fBm\fP)irror, (\fBr\fP)aid,
(\fBs\fP)napshot, (\fBt\fP)hin, (\fBu\fP)nknown, (\fBv\fP)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
(\fBm\fP) if they use the original device-mapper mirror kernel driver; whereas the raid
equivalents using the md raid kernel driver all appear as (\fBr\fP).
Snapshots using the original device-mapper driver appear as (\fBs\fP); whereas
snapshots of thin volumes using the new thin provisioning driver appear as (\fBt\fP).
.IP 8 3
Newly-allocated data blocks are overwritten with blocks of (\fBz\fP)eroes before use.
.IP 9 3
(\fBm\fP) if they use the original device-mapper mirror kernel driver;
whereas the raid equivalents using the md raid kernel driver
all appear as (\fBr\fP).
Snapshots using the original device-mapper driver appear as (\fBs\fP);
whereas snapshots of thin volumes using the new thin provisioning
driver appear as (\fBt\fP).
.
.IP 8
Newly-allocated data blocks are overwritten with blocks
of (\fBz\fP)eroes before use.
.
.IP 9
Volume Health, where there are currently three groups of attributes identified:
.
.IP
Common ones for all Logical Volumes: (\fBp\fP)artial, (\fBX\fP) unknown.
.br
(\fBp\fP)artial signifies that one or more of the Physical Volumes this Logical
Volume uses is missing from the system. (\fBX\fP) unknown signifies the status
is unknown.
.
.IP
Related to RAID Logical Volumes: (\fBr\fP)efresh needed, (\fBm\fP)ismatches exist, (\fBw\fP)ritemostly.
Related to RAID Logical Volumes: (\fBr\fP)efresh needed,
(\fBm\fP)ismatches exist, (\fBw\fP)ritemostly.
.br
(\fBr\fP)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. (\fBm\fP)ismatches signifies that the
RAID logical volume has portions of the array that are not coherent.
(\fBr\fP)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. (\fBm\fP)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.) (\fBw\fP)ritemostly signifies the
devices in a RAID 1 logical volume that have been marked write-mostly.
Re(\fBs\fP)haping signifies a RAID Logical Volume is either undergoing a stripe
addition/removal, a stripe size or RAID algorithm change.
Re(\fBs\fP)haping signifies a RAID Logical Volume is either undergoing
a stripe addition/removal, a stripe size or RAID algorithm change.
(\fBR\fP)emove after reshape signifies freed striped raid images to be removed.
.
.IP
Related to Thin pool Logical Volumes: (\fBF\fP)ailed, out of (\fBD\fP)ata space,
(\fBM\fP)etadata read only.
.br
(\fBF\fP)ailed is set if thin pool encounters serious failures and hence no further I/O
is permitted at all. The out of (\fBD\fP)ata space is set if thin pool has run out of
data space. (\fBM\fP)etadata read only signifies that thin pool encounters certain
(\fBF\fP)ailed is set if thin pool encounters serious failures
and hence no further I/O is permitted at all.
The out of (\fBD\fP)ata space is set if thin pool has run out of data space.
(\fBM\fP)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.
.
.IP
Related to Thin Logical Volumes: (\fBF\fP)ailed.
.br
(\fBF\fP)ailed is set when related thin pool enters Failed state and no further I/O
is permitted at all.
(\fBF\fP)ailed is set when related thin pool enters Failed state and
no further I/O is permitted at all.
.
.IP
Related to writecache logical volumes: (\fBE\fP)rror.
.br
(\fBE\fP)rror is set dm-writecache reports an error.
.IP 10 3
.
.IP 10
s(\fBk\fP)ip activation: this volume is flagged to be skipped during activation.

View File

@@ -1,17 +1,226 @@
.TH LVS 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_aligned
.OPS aligned
..
.de O_all
.OPS a all
..
.de O_binary
.OPS binary
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_configreport
.OPA configreport
\%\fBlog\fP|\:\
\fBvg\fP|\:\
\fBlv\fP|\:\
\fBpv\fP|\:\
\fBpvseg\fP|\:\
\fBseg\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_foreign
.OPS foreign
..
.de O_headings
.OPA headings
\%\fBnone\fP|\:\
\fBabbrev\fP|\:\
\fBfull\fP|\:\
\fB0\fP|\:\
\fB1\fP|\:\
\fB2\fP
..
.de O_help
.OPS h help
..
.de O_history
.OPS H history
..
.de O_ignorelockingfailure
.OPS ignorelockingfailure
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_logonly
.OPS logonly
..
.de O_longhelp
.OPS longhelp
..
.de O_nameprefixes
.OPS nameprefixes
..
.de O_noheadings
.OPS noheadings
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_nosuffix
.OPS nosuffix
..
.de O_options
.OPA o options
\fIString\fP
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_readonly
.OPS readonly
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_rows
.OPS rows
..
.de O_segments
.OPS segments
..
.de O_select
.OPA S select
\fIString\fP
..
.de O_separator
.OPA separator
\fIString\fP
..
.de O_shared
.OPS shared
..
.de O_sort
.OPA O sort
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_unbuffered
.OPS unbuffered
..
.de O_units
.OPA units
\%[\fINumber\fP]\fBr\fP|\:\
\fBR\fP|\:\
\fBh\fP|\:\
\fBH\fP|\:\
\fBb\fP|\:\
\fBB\fP|\:\
\fBs\fP|\:\
\fBS\fP|\:\
\fBk\fP|\:\
\fBK\fP|\:\
\fBm\fP|\:\
\fBM\fP|\:\
\fBg\fP|\:\
\fBG\fP|\:\
\fBt\fP|\:\
\fBT\fP|\:\
\fBp\fP|\:\
\fBP\fP|\:\
\fBe\fP|\:\
\fBE\fP
..
.de O_unquoted
.OPS unquoted
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvs \(em Display information about logical volumes
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvs\fP
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.br
[ \fIposition_args\fP ]
.br
[ \fIposition_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -19,216 +228,278 @@ lvs produces formatted output about LVs.
.
.SH USAGE
.
\fBlvs\fP
.br
.RS 4
.ad l
[ \fB-H\fP|\fB--history\fP ]
.br
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
.br
[ \fB-a\fP|\fB--all\fP ]
.br
[ \fB-o\fP|\fB--options\fP \fIString\fP ]
.br
[ \fB-O\fP|\fB--sort\fP \fIString\fP ]
.br
[ \fB--segments\fP ]
.br
[ \fB--configreport\fP \fBlog\fP|\fBvg\fP|\fBlv\fP|\fBpv\fP|\fBpvseg\fP|\fBseg\fP ]
.br
[ \fB--foreign\fP ]
.br
[ \fB--ignorelockingfailure\fP ]
.br
[ \fB--logonly\fP ]
.br
[ \fB--readonly\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
.br
[ \fB--shared\fP ]
.br
[ \fB--units\fP \c
.nh
\%[\fINumber\fP]\fBr\fP|\:\fBR\fP|\:\fBh\fP|\:\fBH\fP|\:\fBb\fP|\:\fBB\fP|\:\fBs\fP|\:\fBS\fP|\:\fBk\fP|\:\fBK\fP|\:\fBm\fP|\:\fBM\fP|\:\fBg\fP|\:\fBG\fP|\:\fBt\fP|\:\fBT\fP|\:\fBp\fP|\:\fBP\fP|\:\fBe\fP|\:\fBE\fP
.hy
.na
.B lvs
.RS
[
.O_history
]
.br
[ \fB--aligned\fP ]
[
.O_select
]
.br
[ \fB--binary\fP ]
[
.O_all
]
.br
[ \fB--headings\fP \fBnone\fP|\fBabbrev\fP|\fBfull\fP|\fB0\fP|\fB1\fP|\fB2\fP ]
[
.O_options
]
.br
[ \fB--nameprefixes\fP ]
[
.O_sort
]
.br
[ \fB--noheadings\fP ]
[
.O_segments
]
.br
[ \fB--nosuffix\fP ]
[
.O_configreport
]
.br
[ \fB--rows\fP ]
[
.O_foreign
]
.br
[ \fB--separator\fP \fIString\fP ]
[
.O_ignorelockingfailure
]
.br
[ \fB--unbuffered\fP ]
[
.O_logonly
]
.br
[ \fB--unquoted\fP ]
[
.O_readonly
]
.br
[
.O_reportformat
]
.br
[
.O_shared
]
.br
[
.O_units
]
.br
[
.O_aligned
]
.br
[
.O_binary
]
.br
[
.O_headings
]
.br
[
.O_nameprefixes
]
.br
[
.O_noheadings
]
.br
[
.O_nosuffix
]
.br
[
.O_rows
]
.br
[
.O_separator
]
.br
[
.O_unbuffered
]
.br
[
.O_unquoted
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.RS 4
[ \fIVG\fP|\fILV\fP|\fITag\fP ... ]
.br
[ \fIVG\fP|\fILV\fP|\fITag\fP\ .\|.\|.\& ]
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.TP
.O_aligned
Use with --separator to align the output columns.
.
.HP
\fB--aligned\fP
.br
Use with --separator to align the output columns
.
.HP
\fB-a\fP|\fB--all\fP
.br
.TP
.O_all
Show information about internal LVs.
These are components of normal LVs, such as mirrors,
which are not independently accessible, e.g. not mountable.
.
.HP
\fB--binary\fP
.br
.TP
.O_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).
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB--configreport\fP \fBlog\fP|\fBvg\fP|\fBlv\fP|\fBpv\fP|\fBpvseg\fP|\fBseg\fP
.br
.TP
.O_configreport
See \fBlvmreport\fP(7).
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB--foreign\fP
.br
.TP
.O_foreign
Report/display foreign VGs that would otherwise be skipped.
See \fBlvmsystemid\fP(7) for more information about foreign VGs.
.
.HP
\fB--headings\fP \fBnone\fP|\fBabbrev\fP|\fBfull\fP|\fB0\fP|\fB1\fP|\fB2\fP
.br
.TP
.O_headings
Type of headings to use in report output.
\fBnone\fP or \fB0\fP: No headings.
\fBabbrev\fP or \fB1\fP: Column name abbreviations.
\fBfull\fP or \fB2\fP: Full column names.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB-H\fP|\fB--history\fP
.br
.TP
.O_history
Include historical LVs in the output.
(This has no effect unless LVs were removed while
\fBlvm.conf\fP(5) \fBmetadata/record_lvs_history\fP was enabled.
.
.HP
\fB--ignorelockingfailure\fP
.br
.TP
.O_ignorelockingfailure
Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -236,65 +507,57 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--logonly\fP
.br
.TP
.O_logonly
Suppress command report and display only log report.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nameprefixes\fP
.br
.TP
.O_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).
.
.HP
\fB--noheadings\fP
.br
.TP
.O_noheadings
Suppress the headings line that is normally the first line of output.
Useful if grepping the output.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--nosuffix\fP
.br
.TP
.O_nosuffix
Suppress the suffix on output sizes. Use with --units
(except h and H) if processing the output.
.
.HP
\fB-o\fP|\fB--options\fP \fIString\fP
.br
.TP
.O_options
Comma-separated, ordered list of fields to display in columns.
String arg syntax is: [\fB+\fP|\fB-\fP|\fB#\fP]\fIField1\fP[\fB,\fP\fIField2\fP ...]
String arg syntax is:
[\fB+\fP|\fB-\fP|\fB#\fP]\fIField1\fP[\fB,\fP\fIField2\fP ...]
The prefix \fB+\fP will append the specified fields to the default fields,
\fB-\fP will remove the specified fields from the default fields, and
\fB#\fP will compact specified fields (removing them when empty for all rows.)
Use \fB-o help\fP 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.
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 \fBlv_all\fP to view all LV fields,
\fBvg_all\fP all VG fields,
@@ -305,27 +568,23 @@ Use field name \fBlv_all\fP to view all LV fields,
See the \fBlvm.conf\fP(5) report section for more config options.
See \fBlvmreport\fP(7) for more information about reporting.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--readonly\fP
.br
.TP
.O_readonly
Prevent the command from making changes, including activation and
metadata updates. (See --permission r for read only LVs.)
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -335,68 +594,56 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB--rows\fP
.br
.TP
.O_rows
Output columns as rows.
.
.HP
\fB--segments\fP
.br
.TP
.O_segments
Use default columns that emphasize segment information.
.
.HP
\fB-S\fP|\fB--select\fP \fIString\fP
.br
.TP
.O_select
Select objects for processing and reporting based on specified criteria.
The criteria syntax is described by \fB--select help\fP and \fBlvmreport\fP(7).
For reporting commands, one row is displayed for each object matching the criteria.
The criteria syntax is described by \fB--select help\fP
and \fBlvmreport\fP(7).
For reporting commands, one row is displayed
for each object matching the criteria.
See \fB--options help\fP 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.
.
.HP
\fB--separator\fP \fIString\fP
.br
.TP
.O_separator
String to use to separate each column. Useful if grepping the output.
.
.HP
\fB--shared\fP
.br
.TP
.O_shared
Report/display shared VGs that would otherwise be skipped when
lvmlockd is not being used on the host.
See \fBlvmlockd\fP(8) for more information about shared VGs.
.
.HP
\fB-O\fP|\fB--sort\fP \fIString\fP
.br
.TP
.O_sort
Comma-separated ordered list of columns to sort by. Replaces the default
selection. Precede any column with \fB-\fP for a reverse sort on that column.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB--unbuffered\fP
.br
.TP
.O_unbuffered
Produce output immediately without sorting or aligning the columns properly.
.
.HP
.ad l
\fB--units\fP \c
.nh
\%[\fINumber\fP]\fBr\fP|\:\fBR\fP|\:\fBh\fP|\:\fBH\fP|\:\fBb\fP|\:\fBB\fP|\:\fBs\fP|\:\fBS\fP|\:\fBk\fP|\:\fBK\fP|\:\fBm\fP|\:\fBM\fP|\:\fBg\fP|\:\fBG\fP|\:\fBt\fP|\:\fBT\fP|\:\fBp\fP|\:\fBP\fP|\:\fBe\fP|\:\fBE\fP
.hy
.ad b
.br
.TP
.O_units
All sizes are output in these units:
human-(r)eadable with '<' rounding indicator,
(h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes,
@@ -404,26 +651,22 @@ human-(r)eadable with '<' rounding indicator,
Capitalise to use multiples of 1000 (S.I.) instead of 1024.
Custom units can be specified, e.g. --units 3M.
.
.HP
\fB--unquoted\fP
.br
.TP
.O_unquoted
When used with --nameprefixes, output values in the field=value
pairs are not quoted.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -433,17 +676,21 @@ answer yes. Use with extreme caution.
.TP
.I VG
Volume Group name. See \fBlvm\fP(8) for valid names.
.
.TP
.I LV
Logical Volume name. See \fBlvm\fP(8) for valid names.
An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.
.
.TP
.I Tag
Tag name. See \fBlvm\fP(8) for information about tag names and using tags
in place of a VG, LV or PV.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -467,10 +714,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,131 @@
.TH LVSCAN 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_all
.OPS a all
..
.de O_blockdevice
.OPS b blockdevice
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_ignorelockingfailure
.OPS ignorelockingfailure
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_readonly
.OPS readonly
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
lvscan \(em List all logical volumes in all volume groups
.
.SH SYNOPSIS
.
.nh
.TP
\fBlvscan\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -21,138 +137,172 @@ comprehensive information about LVs.
.
.SH USAGE
.
\fBlvscan\fP
.nh
.na
.B lvscan
.RS
[
.O_all
]
.br
.RS 4
.ad l
[ \fB-a\fP|\fB--all\fP ]
[
.O_blockdevice
]
.br
[ \fB-b\fP|\fB--blockdevice\fP ]
[
.O_ignorelockingfailure
]
.br
[ \fB--ignorelockingfailure\fP ]
[
.O_readonly
]
.br
[ \fB--readonly\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_reportformat
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB-a\fP|\fB--all\fP
.br
.TP
.O_all
Show information about internal LVs.
These are components of normal LVs, such as mirrors,
which are not independently accessible, e.g. not mountable.
.
.HP
\fB-b\fP|\fB--blockdevice\fP
.br
.TP
.O_blockdevice
No longer used.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--ignorelockingfailure\fP
.br
.TP
.O_ignorelockingfailure
Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -160,51 +310,43 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--readonly\fP
.br
.TP
.O_readonly
Prevent the command from making changes, including activation and
metadata updates. (See --permission r for read only LVs.)
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -214,29 +356,25 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -246,6 +384,7 @@ answer yes. Use with extreme caution.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -269,10 +408,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,153 @@
.TH PVCHANGE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_addtag
.OPA addtag
\fITag\fP
..
.de O_all
.OPS a all
..
.de O_allocatable
.OPA x allocatable
\fBy\fP|\fBn\fP
..
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_deltag
.OPA deltag
\fITag\fP
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_force
.OPA f force
\&\.\|.\|.\&
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_metadataignore
.OPA metadataignore
\fBy\fP|\fBn\fP
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_select
.OPA S select
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_uuid
.OPS u uuid
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
pvchange \(em Change attributes of physical volume(s)
.
.SH SYNOPSIS
.
.nh
.TP
\fBpvchange\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -20,199 +158,225 @@ others are optional.
.
.SH USAGE
.
.nh
.na
Change properties of all PVs.
.br
.P
\fBpvchange\fP \fB-a\fP|\fB--all\fP
.RS 4
( \fB-x\fP|\fB--allocatable\fP \fBy\fP|\fBn\fP
.B pvchange
.O_all
.RS
(
.O_allocatable
.in +2n
.O_uuid
.br
\fB-u\fP|\fB--uuid\fP
.O_addtag
.br
\fB--addtag\fP \fITag\fP
.O_deltag
.br
\fB--deltag\fP \fITag\fP
.br
\fB--metadataignore\fP \fBy\fP|\fBn\fP )
.RE
.br
.RS 4
.ad l
.O_metadataignore
)
.in
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Change properties of specified PVs.
.br
.P
\fBpvchange\fP
.RS 4
( \fB-x\fP|\fB--allocatable\fP \fBy\fP|\fBn\fP
.B pvchange
.RS
(
.O_allocatable
.in +2n
.O_uuid
.br
\fB-u\fP|\fB--uuid\fP
.O_addtag
.br
\fB--addtag\fP \fITag\fP
.O_deltag
.br
\fB--deltag\fP \fITag\fP
.O_metadataignore
)
.in
\fIPV\fP|\fISelect\fP\ .\|.\|.\&
.br
\fB--metadataignore\fP \fBy\fP|\fBn\fP )
.RE
.RS 4
\fIPV\fP|\fISelect\fP ...
.RE
.br
.RS 4
.ad l
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
[
.O_select
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for command:
.
.RS 4
.ad l
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
.RS
[
.O_autobackup
]
.br
[ \fB-f\fP|\fB--force\fP ]
[
.O_force
]
.br
[ \fB-u\fP|\fB--uuid\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
.ad b
[
.O_reportformat
]
.RE
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--addtag\fP \fITag\fP
.br
.TP
.O_addtag
Adds a tag to a PV, VG or LV. This option can be repeated to add
multiple tags at once. See \fBlvm\fP(8) for information about tags.
.
.HP
\fB-a\fP|\fB--all\fP
.br
.TP
.O_all
Change all visible PVs.
.
.HP
\fB-x\fP|\fB--allocatable\fP \fBy\fP|\fBn\fP
.br
.TP
.O_allocatable
Enable or disable allocation of physical extents on this PV.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--deltag\fP \fITag\fP
.br
.TP
.O_deltag
Deletes a tag from a PV, VG or LV. This option can be repeated to delete
multiple tags at once. See \fBlvm\fP(8) for information about tags.
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-f\fP|\fB--force\fP ...
.br
.TP
.O_force
Override various checks, confirmations and protections.
Use with extreme caution.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -220,53 +384,45 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--metadataignore\fP \fBy\fP|\fBn\fP
.br
.TP
.O_metadataignore
Specifies the metadataignore property of a PV.
If yes, metadata areas on the PV are ignored, and lvm will
not store metadata in the metadata areas of the PV.
If no, lvm will store metadata on the PV.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -276,46 +432,42 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-S\fP|\fB--select\fP \fIString\fP
.br
.TP
.O_select
Select objects for processing and reporting based on specified criteria.
The criteria syntax is described by \fB--select help\fP and \fBlvmreport\fP(7).
For reporting commands, one row is displayed for each object matching the criteria.
The criteria syntax is described by \fB--select help\fP
and \fBlvmreport\fP(7).
For reporting commands, one row is displayed
for each object matching the criteria.
See \fB--options help\fP 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.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-u\fP|\fB--uuid\fP
.br
.TP
.O_uuid
Generate new random UUID for specified PVs.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -329,16 +481,23 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I Select
Select indicates that a required positional parameter can
be omitted if the \fB--select\fP option is used.
No arg appears in this position.
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -362,10 +521,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,7 +1,7 @@
pvck checks and repairs LVM metadata on PVs.
.P
.SS Dump options
.P
.
.SS Dump options
.
.B headers
.br
Print LVM on-disk headers and structures: label_header, pv_header,
@@ -42,15 +42,16 @@ metadata versions.
.B metadata_area
.br
Save the entire text metadata area to a file without processing.
.P
.
.SS Repair options
.P
.
.B --repair
.br
Repair headers and metadata on a PV. This uses a metadata input file that
was extracted by --dump, or a backup file (from \fI#DEFAULT_BACKUP_DIR#\fP). When
possible, use metadata saved by --dump from another PV in the same VG (or
from a second metadata area on the PV).
was extracted by --dump, or a backup file
(from \fI#DEFAULT_BACKUP_DIR#\fP).
When possible, use metadata saved by --dump from another PV
in the same VG (or from a second metadata area on the PV).
.P
There are cases where the PV UUID needs to be specified for the PV being
repaired. It is specified using --settings "pv_uuid=<UUID>". In
@@ -87,9 +88,9 @@ correct (having been undamaged or already repaired).
.br
Repairs label_header fields, leaving the pv_header (in the same sector)
unchanged. (repairtype pv_header should usually be used instead.)
.P
.
.SS Settings
.P
.
The --settings option controls or overrides certain dump or repair
behaviors. All offset and size values in settings are in bytes (units are
not recognized.) These settings are subject to change.

View File

@@ -1,77 +1,210 @@
.TH PVCK 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_dump
.OPA dump
\%\fBheaders\fP|\:\
\fBmetadata\fP|\:\
\fBmetadata_all\fP|\:\
\fBmetadata_search\fP
..
.de O_file
.OPA f file
\fIString\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_labelsector
.OPA labelsector
\fINumber\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_pvmetadatacopies
.OPA \fP[\fBpv\fP]\fBmetadatacopies
\fB0\fP|\fB1\fP|\fB2\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_repair
.OPS repair
..
.de O_repairtype
.OPA repairtype
\%\fBpv_header\fP|\:\
\fBmetadata\fP|\:\
\fBlabel_header\fP
..
.de O_settings
.OPA settings
\fIString\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
pvck \(em Check metadata on physical volumes
.
.SH SYNOPSIS
.
\fBpvck\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
.P
.ad l
\fB--commandprofile\fP \fIString\fP
.br
\fB--config\fP \fIString\fP
.br
\fB-d\fP|\fB--debug\fP
.br
\fB--devices\fP \fIPV\fP
.br
\fB--devicesfile\fP \fIString\fP
.br
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
\fB--dump\fP \c
.nh
\%\fBheaders\fP|\:\fBmetadata\fP|\:\fBmetadata_all\fP|\:\fBmetadata_search\fP
.TP
\fBpvck\fP \fIoption_args\fP \fIposition_args\fP
[ \fIoption_args\fP ]
.P
.na
.RS 5
.if t .ta 3nR +1uL \" PostScript/PDF
.PD 0
.O_commandprofile
.br
.O_config
.br
.O_debug
.br
.O_devices
.br
.O_devicesfile
.br
.O_driverloaded
.br
.O_dump
.br
.O_file
.br
.O_help
.br
.O_journal
.br
.O_labelsector
.br
.O_lockopt
.br
.O_longhelp
.br
.O_nohints
.br
.O_nolocking
.br
.O_profile
.br
.O_pvmetadatacopies
.br
.O_quiet
.br
.O_repair
.br
.O_repairtype
.br
.O_settings
.br
.O_test
.br
.O_verbose
.br
.O_version
.br
.O_yes
.PD
.if t .ta
.RE
.ad
.hy
.br
\fB-f\fP|\fB--file\fP \fIString\fP
.br
\fB-h\fP|\fB--help\fP
.br
\fB--journal\fP \fIString\fP
.br
\fB--labelsector\fP \fINumber\fP
.br
\fB--lockopt\fP \fIString\fP
.br
\fB--longhelp\fP
.br
\fB--nohints\fP
.br
\fB--nolocking\fP
.br
\fB--profile\fP \fIString\fP
.br
\fB--\fP[\fBpv\fP]\fBmetadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP
.br
\fB-q\fP|\fB--quiet\fP
.br
\fB--repair\fP
.br
\fB--repairtype\fP \fBpv_header\fP|\fBmetadata\fP|\fBlabel_header\fP
.br
\fB--settings\fP \fIString\fP
.br
\fB-t\fP|\fB--test\fP
.br
\fB-v\fP|\fB--verbose\fP
.br
\fB--version\fP
.br
\fB-y\fP|\fB--yes\fP
.ad b
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
pvck checks and repairs LVM metadata on PVs.
.P
.SS Dump options
.P
.
.SS Dump options
.
.B headers
.br
Print LVM on-disk headers and structures: label_header, pv_header,
@@ -112,15 +245,16 @@ metadata versions.
.B metadata_area
.br
Save the entire text metadata area to a file without processing.
.P
.
.SS Repair options
.P
.
.B --repair
.br
Repair headers and metadata on a PV. This uses a metadata input file that
was extracted by --dump, or a backup file (from \fI#DEFAULT_BACKUP_DIR#\fP). When
possible, use metadata saved by --dump from another PV in the same VG (or
from a second metadata area on the PV).
was extracted by --dump, or a backup file
(from \fI#DEFAULT_BACKUP_DIR#\fP).
When possible, use metadata saved by --dump from another PV
in the same VG (or from a second metadata area on the PV).
.P
There are cases where the PV UUID needs to be specified for the PV being
repaired. It is specified using --settings "pv_uuid=<UUID>". In
@@ -157,9 +291,9 @@ correct (having been undamaged or already repaired).
.br
Repairs label_header fields, leaving the pv_header (in the same sector)
unchanged. (repairtype pv_header should usually be used instead.)
.P
.
.SS Settings
.P
.
The --settings option controls or overrides certain dump or repair
behaviors. All offset and size values in settings are in bytes (units are
not recognized.) These settings are subject to change.
@@ -207,178 +341,207 @@ extent (data), which follows the first metadata area.
.
.SH USAGE
.
Check for metadata on a device
.br
.P
\fBpvck\fP \fIPV\fP ...
.br
.RS 4
.ad l
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Check and print LVM headers and metadata on a device
.br
.P
\fBpvck\fP \fB--dump\fP \c
.nh
\%\fBheaders\fP|\:\fBmetadata\fP|\:\fBmetadata_all\fP|\:\fBmetadata_search\fP
.hy
.na
Check for metadata on a device
.P
.B pvck
\fIPV\fP\ .\|.\|.\&
.RS
[ COMMON_OPTIONS ]
.RE
.
.P
\(em
.P
.
Check and print LVM headers and metadata on a device
.P
.B pvck
.O_dump
\fIPV\fP
.RS
[
.O_file
]
.br
.RS 4
.ad l
[ \fB-f\fP|\fB--file\fP \fIString\fP ]
[
.O_settings
]
.br
[ \fB--settings\fP \fIString\fP ]
.br
[ \fB--\fP[\fBpv\fP]\fBmetadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP ]
[
.O_pvmetadatacopies
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Repair LVM headers or metadata on a device
.br
.P
\fBpvck\fP \fB--repairtype\fP \fBpv_header\fP|\fBmetadata\fP|\fBlabel_header\fP \fIPV\fP
.B pvck
.O_repairtype
\fIPV\fP
.RS
[
.O_file
]
.br
.RS 4
.ad l
[ \fB-f\fP|\fB--file\fP \fIString\fP ]
.br
[ \fB--settings\fP \fIString\fP ]
[
.O_settings
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.
.P
\(em
.P
.
Repair LVM headers and metadata on a device
.br
.P
\fBpvck\fP \fB--repair\fP \fB-f\fP|\fB--file\fP \fIString\fP \fIPV\fP
.br
.RS 4
.ad l
[ \fB--settings\fP \fIString\fP ]
.B pvck
.O_repair
.O_file
\fIPV\fP
.RS
[
.O_settings
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for command:
.
.RS 4
.ad l
[ \fB--labelsector\fP \fINumber\fP ]
.ad b
.RS
[
.O_labelsector
]
.RE
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
.ad l
\fB--dump\fP \c
.nh
\%\fBheaders\fP|\:\fBmetadata\fP|\:\fBmetadata_all\fP|\:\fBmetadata_search\fP
.hy
.ad b
.br
.TP
.O_dump
Dump headers and metadata from a PV for debugging and repair.
Option values include: \fBheaders\fP to print and check LVM headers,
\fBmetadata\fP to print or save the current text metadata,
@@ -387,19 +550,16 @@ Option values include: \fBheaders\fP to print and check LVM headers,
searching standard locations in case of damaged headers,
\fBmetadata_area\fP to save an entire text metadata area to a file.
.
.HP
\fB-f\fP|\fB--file\fP \fIString\fP
.br
.TP
.O_file
Metadata file to read or write.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -407,47 +567,40 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--labelsector\fP \fINumber\fP
.br
.TP
.O_labelsector
By default the PV is labelled with an LVM2 identifier in its second
sector (sector 1). This lets you use a different sector near the
start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS
in the source). Use with care.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB--\fP[\fBpv\fP]\fBmetadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP
.br
.TP
.O_pvmetadatacopies
The number of metadata areas to set aside on a PV for storing VG metadata.
When 2, one copy of the VG metadata is stored at the front of the PV
and a second copy is stored at the end.
@@ -456,52 +609,44 @@ When 0, no copies of the VG metadata are stored on the given PV.
This may be useful in VGs containing many PVs (this places limitations
on the ability to use vgsplit later.)
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--repair\fP
.br
.TP
.O_repair
Repair headers and metadata on a PV.
.
.HP
\fB--repairtype\fP \fBpv_header\fP|\fBmetadata\fP|\fBlabel_header\fP
.br
.TP
.O_repairtype
Repair headers and metadata on a PV. See command description.
.
.HP
\fB--settings\fP \fIString\fP
.br
.TP
.O_settings
Specifies command specific settings in "Key = Value" form.
Combine multiple settings in quotes, or repeat the settings
option for each.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -515,11 +660,17 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -543,10 +694,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -17,12 +17,12 @@ The LVM disk label begins 512 bytes from the start of the device, and is
512 bytes in size.
.P
The LVM metadata area begins at an offset (from the start of the device)
equal to the page size of the machine creating the PV (often 4 KiB.) The
equal to the page size of the machine creating the PV (often 4\~KiB.) The
metadata area contains a 512 byte header and a multi-KiB circular buffer
that holds text copies of the VG metadata.
.P
With default settings, the first physical extent (PE), which contains LV
data, is 1 MiB from the start of the device. This location is controlled
data, is 1\~MiB from the start of the device. This location is controlled
by \fBdefault_data_alignment\fP in lvm.conf, which is set to 1 (MiB) by
default. The pe_start will be a multiple of this many MiB. This location
can be checked with:
@@ -31,8 +31,8 @@ can be checked with:
.I PV
.P
The size of the LVM metadata area is the space between the start of
the metadata area and the first PE. When metadata begins at 4 KiB and the
first PE is at 1024 KiB, the metadata area size is 1020 KiB. This can be
the metadata area and the first PE. When metadata begins at 4\~KiB and the
first PE is at 1024\~KiB, the metadata area size is 1020\~KiB. This can be
checked with:
.br
.B pvs -o mda_size
@@ -49,10 +49,11 @@ is around half the mda_size. This can be checked with:
A larger metadata area can be set with --metadatasize. The resulting
mda_size may be larger than specified due to default_data_alignment
placing pe_start on a MiB boundary, and the fact that the metadata area
extends to the first PE. With metadata starting at 4 KiB and
extends to the first PE. With metadata starting at 4\~KiB and
default_data_alignment 1 (MiB), setting --metadatasize 2048k results in
pe_start of 3 MiB and mda_size of 3068 KiB. Alternatively, --metadatasize
2044k results in pe_start at 2 MiB and mda_size of 2044 KiB.
pe_start of 3\~MiB and mda_size of 3068\~KiB.
Alternatively, --metadatasize 2044k results in pe_start at 2\~MiB
and mda_size of 2044\~KiB.
.P
The alignment of pe_start described above may be automatically overridden
based on md device properties or device i/o properties reported in sysfs.
@@ -65,10 +66,10 @@ because the metadata area size also determines the location of pe_start.
When using these two options together, pe_start is calculated as:
metadata area start (page size), plus the specified --metadatasize,
rounded up to the next multiple of --dataalignment.
With metadata starting at 4 KiB, --metadatasize 2048k, and --dataalignment 128k,
pe_start is 2176 KiB and mda_size is 2172 KiB.
The pe_start of 2176 KiB is the nearest even multiple of 128 KiB that
provides at least 2048 KiB of metadata space.
With metadata starting at 4\~KiB, --metadatasize 2048k,
and --dataalignment 128k, pe_start is 2176\~KiB and mda_size is 2172\~KiB.
The pe_start of 2176\~KiB is the nearest even multiple of 128\~KiB that
provides at least 2048\~KiB of metadata space.
Always check the resulting alignment and metadata size when using
these options.
.P

View File

@@ -1,15 +1,174 @@
.TH PVCREATE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_bootloaderareasize
.OPA bootloaderareasize
\fISize\fP[m|\:UNIT]
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_dataalignment
.OPA dataalignment
\fISize\fP[k|\:UNIT]
..
.de O_dataalignmentoffset
.OPA dataalignmentoffset
\fISize\fP[k|\:UNIT]
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_force
.OPA f force
\&\.\|.\|.\&
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_labelsector
.OPA labelsector
\fINumber\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_metadataignore
.OPA metadataignore
\fBy\fP|\fBn\fP
..
.de O_metadatasize
.OPA metadatasize
\fISize\fP[m|\:UNIT]
..
.de O_metadatatype
.OPA M metadatatype
\fBlvm2\fP
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_norestorefile
.OPS norestorefile
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_pvmetadatacopies
.OPA \fP[\fBpv\fP]\fBmetadatacopies
\fB0\fP|\fB1\fP|\fB2\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_restorefile
.OPA restorefile
\fIString\fP
..
.de O_setphysicalvolumesize
.OPA setphysicalvolumesize
\fISize\fP[m|\:UNIT]
..
.de O_test
.OPS t test
..
.de O_uuid
.OPA u uuid
\fIString\fP
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.de O_zero
.OPA Z zero
\fBy\fP|\fBn\fP
..
.
.SH NAME
.
pvcreate \(em Initialize physical volume(s) for use by LVM
.
.SH SYNOPSIS
.
.nh
.TP
\fBpvcreate\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -32,12 +191,12 @@ The LVM disk label begins 512 bytes from the start of the device, and is
512 bytes in size.
.P
The LVM metadata area begins at an offset (from the start of the device)
equal to the page size of the machine creating the PV (often 4 KiB.) The
equal to the page size of the machine creating the PV (often 4\~KiB.) The
metadata area contains a 512 byte header and a multi-KiB circular buffer
that holds text copies of the VG metadata.
.P
With default settings, the first physical extent (PE), which contains LV
data, is 1 MiB from the start of the device. This location is controlled
data, is 1\~MiB from the start of the device. This location is controlled
by \fBdefault_data_alignment\fP in lvm.conf, which is set to 1 (MiB) by
default. The pe_start will be a multiple of this many MiB. This location
can be checked with:
@@ -46,8 +205,8 @@ can be checked with:
.I PV
.P
The size of the LVM metadata area is the space between the start of
the metadata area and the first PE. When metadata begins at 4 KiB and the
first PE is at 1024 KiB, the metadata area size is 1020 KiB. This can be
the metadata area and the first PE. When metadata begins at 4\~KiB and the
first PE is at 1024\~KiB, the metadata area size is 1020\~KiB. This can be
checked with:
.br
.B pvs -o mda_size
@@ -64,10 +223,11 @@ is around half the mda_size. This can be checked with:
A larger metadata area can be set with --metadatasize. The resulting
mda_size may be larger than specified due to default_data_alignment
placing pe_start on a MiB boundary, and the fact that the metadata area
extends to the first PE. With metadata starting at 4 KiB and
extends to the first PE. With metadata starting at 4\~KiB and
default_data_alignment 1 (MiB), setting --metadatasize 2048k results in
pe_start of 3 MiB and mda_size of 3068 KiB. Alternatively, --metadatasize
2044k results in pe_start at 2 MiB and mda_size of 2044 KiB.
pe_start of 3\~MiB and mda_size of 3068\~KiB.
Alternatively, --metadatasize 2044k results in pe_start at 2\~MiB
and mda_size of 2044\~KiB.
.P
The alignment of pe_start described above may be automatically overridden
based on md device properties or device i/o properties reported in sysfs.
@@ -80,10 +240,10 @@ because the metadata area size also determines the location of pe_start.
When using these two options together, pe_start is calculated as:
metadata area start (page size), plus the specified --metadatasize,
rounded up to the next multiple of --dataalignment.
With metadata starting at 4 KiB, --metadatasize 2048k, and --dataalignment 128k,
pe_start is 2176 KiB and mda_size is 2172 KiB.
The pe_start of 2176 KiB is the nearest even multiple of 128 KiB that
provides at least 2048 KiB of metadata space.
With metadata starting at 4\~KiB, --metadatasize 2048k,
and --dataalignment 128k, pe_start is 2176\~KiB and mda_size is 2172\~KiB.
The pe_start of 2176\~KiB is the nearest even multiple of 128\~KiB that
provides at least 2048\~KiB of metadata space.
Always check the resulting alignment and metadata size when using
these options.
.P
@@ -94,92 +254,157 @@ pe_start value.
.
.SH USAGE
.
\fBpvcreate\fP \fIPV\fP ...
.nh
.na
.B pvcreate
\fIPV\fP\ .\|.\|.\&
.RS
[
.O_force
]
.br
.RS 4
.ad l
[ \fB-f\fP|\fB--force\fP ]
[
.O_metadatatype
]
.br
[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ]
[
.O_uuid
]
.br
[ \fB-u\fP|\fB--uuid\fP \fIString\fP ]
[
.O_zero
]
.br
[ \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP ]
[
.O_dataalignment
]
.br
[ \fB--dataalignment\fP \fISize\fP[k|UNIT] ]
[
.O_dataalignmentoffset
]
.br
[ \fB--dataalignmentoffset\fP \fISize\fP[k|UNIT] ]
[
.O_bootloaderareasize
]
.br
[ \fB--bootloaderareasize\fP \fISize\fP[m|UNIT] ]
[
.O_labelsector
]
.br
[ \fB--labelsector\fP \fINumber\fP ]
[
.O_pvmetadatacopies
]
.br
[ \fB--\fP[\fBpv\fP]\fBmetadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP ]
[
.O_metadatasize
]
.br
[ \fB--metadatasize\fP \fISize\fP[m|UNIT] ]
[
.O_metadataignore
]
.br
[ \fB--metadataignore\fP \fBy\fP|\fBn\fP ]
[
.O_norestorefile
]
.br
[ \fB--norestorefile\fP ]
[
.O_setphysicalvolumesize
]
.br
[ \fB--setphysicalvolumesize\fP \fISize\fP[m|UNIT] ]
[
.O_reportformat
]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
.br
[ \fB--restorefile\fP \fIString\fP ]
[
.O_restorefile
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--bootloaderareasize\fP \fISize\fP[m|UNIT]
.br
.TP
.O_bootloaderareasize
Reserve space for the bootloader between the LVM metadata area and the first PE.
The bootloader area is reserved for bootloaders to embed their own data or
metadata; LVM will not use it.
@@ -192,77 +417,66 @@ due to the alignment, but it's never less than the requested size.
To see the bootloader area start and size of
an existing PV use pvs -o +pv_ba_start,pv_ba_size.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB--dataalignment\fP \fISize\fP[k|UNIT]
.br
.TP
.O_dataalignment
Align the start of a PV data area with a multiple of this number.
To see the location of the first Physical Extent (PE) of an existing PV,
use pvs -o +pe_start. In addition, it may be shifted by an alignment offset,
see --dataalignmentoffset.
Also specify an appropriate PE size when creating a VG.
.
.HP
\fB--dataalignmentoffset\fP \fISize\fP[k|UNIT]
.br
.TP
.O_dataalignmentoffset
Shift the start of the PV data area by this additional offset.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-f\fP|\fB--force\fP ...
.br
.TP
.O_force
Override various checks, confirmations and protections.
Use with extreme caution.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -270,74 +484,63 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--labelsector\fP \fINumber\fP
.br
.TP
.O_labelsector
By default the PV is labelled with an LVM2 identifier in its second
sector (sector 1). This lets you use a different sector near the
start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS
in the source). Use with care.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--metadataignore\fP \fBy\fP|\fBn\fP
.br
.TP
.O_metadataignore
Specifies the metadataignore property of a PV.
If yes, metadata areas on the PV are ignored, and lvm will
not store metadata in the metadata areas of the PV.
If no, lvm will store metadata on the PV.
.
.HP
\fB--metadatasize\fP \fISize\fP[m|UNIT]
.br
.TP
.O_metadatasize
The approximate amount of space used for each VG metadata area.
The size may be rounded.
.
.HP
\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP
.br
.TP
.O_metadatatype
Specifies the type of on-disk metadata to use.
\fBlvm2\fP (or just \fB2\fP) is the current, standard format.
\fBlvm1\fP (or just \fB1\fP) is no longer used.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--norestorefile\fP
.br
.TP
.O_norestorefile
In conjunction with --uuid, this allows a uuid to be specified
without also requiring that a backup of the metadata be provided.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB--\fP[\fBpv\fP]\fBmetadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP
.br
.TP
.O_pvmetadatacopies
The number of metadata areas to set aside on a PV for storing VG metadata.
When 2, one copy of the VG metadata is stored at the front of the PV
and a second copy is stored at the end.
@@ -346,15 +549,13 @@ When 0, no copies of the VG metadata are stored on the given PV.
This may be useful in VGs containing many PVs (this places limitations
on the ability to use vgsplit later.)
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -364,9 +565,8 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB--restorefile\fP \fIString\fP
.br
.TP
.O_restorefile
In conjunction with --uuid, this reads the file (produced by
vgcfgbackup), extracts the location and size of the data on the PV,
and ensures that the metadata produced by the program is consistent
@@ -375,24 +575,21 @@ the same place and not be overwritten by new metadata. This provides
a mechanism to upgrade the metadata format or to add/remove metadata
areas. Use with care.
.
.HP
\fB--setphysicalvolumesize\fP \fISize\fP[m|UNIT]
.br
.TP
.O_setphysicalvolumesize
Overrides the automatically detected size of the PV.
Use with care, or prior to reducing the physical size of the device.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-u\fP|\fB--uuid\fP \fIString\fP
.br
.TP
.O_uuid
Specify a UUID for the device.
Without this option, a random UUID is generated.
This option is needed before restoring a backup of LVM metadata
@@ -402,27 +599,23 @@ All PVs must have unique UUIDs, and LVM will prevent certain operations
if multiple devices are seen with the same UUID.
See \fBvgimportclone\fP(8) for more information.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
.
.HP
\fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP
.br
.TP
.O_zero
Controls if the first 4 sectors (2048 bytes) of the device are wiped.
The default is to wipe these sectors unless either or both of
--restorefile or --uuid are specified.
@@ -436,11 +629,17 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -464,10 +663,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,154 @@
.TH PVMOVE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_abort
.OPS abort
..
.de O_alloc
.OPA alloc
\%\fBcontiguous\fP|\:\
\fBcling\fP|\:\
\fBcling_by_tags\fP|\:\
\fBnormal\fP|\:\
\fBanywhere\fP|\:\
\fBinherit\fP
..
.de O_atomic
.OPS atomic
..
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_background
.OPS b background
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_interval
.OPA i interval
\fINumber\fP
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_name
.OPA n name
\fIString\fP
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_noudevsync
.OPS noudevsync
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
pvmove \(em Move extents from one physical volume to another
.
.SH SYNOPSIS
.
.nh
.TP
\fBpvmove\fP \fIposition_args\fP
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.br
[ \fIposition_args\fP ]
.br
[ \fIposition_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -33,120 +170,158 @@ in the process of being changed, so some data might not get moved.
.
.SH USAGE
.
Move PV extents.
.br
.P
\fBpvmove\fP \fIPV\fP
.br
.RS 4
.ad l
[ \fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP ]
.br
[ \fB-n\fP|\fB--name\fP \fILV\fP ]
.br
[ \fB--alloc\fP \c
.nh
\%\fBcontiguous\fP|\:\fBcling\fP|\:\fBcling_by_tags\fP|\:\fBnormal\fP|\:\fBanywhere\fP|\:\fBinherit\fP
.hy
.na
Move PV extents.
.P
.B pvmove
\fIPV\fP
.RS
[
.O_autobackup
]
.br
[ \fB--atomic\fP ]
[
.O_name
]
.br
[ \fB--noudevsync\fP ]
[
.O_alloc
]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_atomic
]
.br
[
.O_noudevsync
]
.br
[
.O_reportformat
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.RS 4
[ \fIPV\fP ... ]
.br
[ \fIPV\fP\ .\|.\|.\& ]
.RE
.
.P
\(em
.P
.
Continue or abort existing pvmove operations.
.br
.P
\fBpvmove\fP
.br
.RS 4
.ad l
.B pvmove
.RS
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for command:
.
.RS 4
.ad l
[ \fB-b\fP|\fB--background\fP ]
.RS
[
.O_background
]
.br
[ \fB-i\fP|\fB--interval\fP \fINumber\fP ]
[
.O_interval
]
.br
[ \fB--abort\fP ]
.ad b
[
.O_abort
]
.RE
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--abort\fP
.br
.TP
.O_abort
Abort any pvmove operations in progress. If a pvmove was started
with the --atomic option, then all LVs will remain on the source PV.
Otherwise, segments that have been moved will remain on the
destination PV, while unmoved segments will remain on the source PV.
.
.HP
.ad l
\fB--alloc\fP \c
.nh
\%\fBcontiguous\fP|\:\fBcling\fP|\:\fBcling_by_tags\fP|\:\fBnormal\fP|\:\fBanywhere\fP|\:\fBinherit\fP
.hy
.ad b
.br
.TP
.O_alloc
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
@@ -164,81 +339,70 @@ Optional positional PV args on the command line can also be used to limit
which PVs the command will use for allocation.
See \fBlvm\fP(8) for more information about allocation.
.
.HP
\fB--atomic\fP
.br
.TP
.O_atomic
Makes a pvmove operation atomic, ensuring that all affected LVs are
moved to the destination PV, or none are if the operation is aborted.
.
.HP
\fB-A\fP|\fB--autobackup\fP \fBy\fP|\fBn\fP
.br
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised! See \fBvgcfgbackup\fP(8) for more information.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB-b\fP|\fB--background\fP
.br
.TP
.O_background
If the operation requires polling, this option causes the command to
return before the operation is complete, and polling is done in the
background.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB-i\fP|\fB--interval\fP \fINumber\fP
.br
.TP
.O_interval
Report progress at regular intervals.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -246,58 +410,49 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB-n\fP|\fB--name\fP \fIString\fP
.br
.TP
.O_name
Move only the extents belonging to the named LV.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--noudevsync\fP
.br
.TP
.O_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.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -307,29 +462,25 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -343,11 +494,17 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -371,10 +528,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,123 @@
.TH PVREMOVE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_force
.OPA f force
\&\.\|.\|.\&
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
pvremove \(em Remove LVM label(s) from physical volume(s)
.
.SH SYNOPSIS
.
.nh
.TP
\fBpvremove\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -23,120 +131,151 @@ an existing VG. Normally, \fBvgreduce\fP(8) should be used instead.
.
.SH USAGE
.
\fBpvremove\fP \fIPV\fP ...
.nh
.na
.B pvremove
\fIPV\fP\ .\|.\|.\&
.RS
[
.O_force
]
.br
.RS 4
.ad l
[ \fB-f\fP|\fB--force\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_reportformat
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-f\fP|\fB--force\fP ...
.br
.TP
.O_force
Override various checks, confirmations and protections.
Use with extreme caution.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -144,45 +283,38 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -192,29 +324,25 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -228,11 +356,17 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -256,10 +390,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

View File

@@ -1,15 +1,127 @@
.TH PVRESIZE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.
.ie t \{\
.\" PostScript/PDF with tabs
. ds TT \t
. ds DTT \t\t
.\}
.el \{\
. ds TT \&
. ds DTT \0\0\0
.\}
.
.de OPT
.ie \\n(.$>1 \\*[TT]\fB-\\$1\fP|\\*[TT]\fB--\\$2\fP\c
.el \\*[DTT]\fB--\\$1\fP\c
..
.
.de OPA
.OPT \\$*
\ \c
..
.de OPS
.OPT \\$*
\&
..
.
.
.\"List of all options as O_string.
.
.de O_autobackup
.OPA A autobackup
\fBy\fP|\fBn\fP
..
.de O_commandprofile
.OPA commandprofile
\fIString\fP
..
.de O_config
.OPA config
\fIString\fP
..
.de O_debug
.OPA d debug
\&\.\|.\|.\&
..
.de O_devices
.OPA devices
\fIPV\fP
..
.de O_devicesfile
.OPA devicesfile
\fIString\fP
..
.de O_driverloaded
.OPA driverloaded
\fBy\fP|\fBn\fP
..
.de O_help
.OPS h help
..
.de O_journal
.OPA journal
\fIString\fP
..
.de O_lockopt
.OPA lockopt
\fIString\fP
..
.de O_longhelp
.OPS longhelp
..
.de O_nohints
.OPS nohints
..
.de O_nolocking
.OPS nolocking
..
.de O_profile
.OPA profile
\fIString\fP
..
.de O_quiet
.OPA q quiet
\&\.\|.\|.\&
..
.de O_reportformat
.OPA reportformat
\%\fBbasic\fP|\:\
\fBjson\fP|\:\
\fBjson_std\fP
..
.de O_setphysicalvolumesize
.OPA setphysicalvolumesize
\fISize\fP[m|\:UNIT]
..
.de O_test
.OPS t test
..
.de O_verbose
.OPA v verbose
\&\.\|.\|.\&
..
.de O_version
.OPS version
..
.de O_yes
.OPS y yes
..
.
.SH NAME
.
pvresize \(em Resize physical volume(s)
.
.SH SYNOPSIS
.
.nh
.TP
\fBpvresize\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIoption_args\fP ]
.hy
.
.ds TT \&
.ds DTT \&
.
.
.SH DESCRIPTION
.
@@ -18,114 +130,156 @@ LVs allocated on it.
.
.SH USAGE
.
\fBpvresize\fP \fIPV\fP ...
.nh
.na
.B pvresize
\fIPV\fP\ .\|.\|.\&
.RS
[
.O_autobackup
]
.br
.RS 4
.ad l
[ \fB--setphysicalvolumesize\fP \fISize\fP[m|UNIT] ]
[
.O_setphysicalvolumesize
]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP ]
[
.O_reportformat
]
.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
\(em
.P
Common options for lvm:
.
.RS 4
.ad l
[ \fB-d\fP|\fB--debug\fP ]
.RS
[
.O_debug
]
.br
[ \fB-h\fP|\fB--help\fP ]
[
.O_help
]
.br
[ \fB-q\fP|\fB--quiet\fP ]
[
.O_quiet
]
.br
[ \fB-t\fP|\fB--test\fP ]
[
.O_test
]
.br
[ \fB-v\fP|\fB--verbose\fP ]
[
.O_verbose
]
.br
[ \fB-y\fP|\fB--yes\fP ]
[
.O_yes
]
.br
[ \fB--commandprofile\fP \fIString\fP ]
[
.O_commandprofile
]
.br
[ \fB--config\fP \fIString\fP ]
[
.O_config
]
.br
[ \fB--devices\fP \fIPV\fP ]
[
.O_devices
]
.br
[ \fB--devicesfile\fP \fIString\fP ]
[
.O_devicesfile
]
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
[
.O_driverloaded
]
.br
[ \fB--journal\fP \fIString\fP ]
[
.O_journal
]
.br
[ \fB--lockopt\fP \fIString\fP ]
[
.O_lockopt
]
.br
[ \fB--longhelp\fP ]
[
.O_longhelp
]
.br
[ \fB--nohints\fP ]
[
.O_nohints
]
.br
[ \fB--nolocking\fP ]
[
.O_nolocking
]
.br
[ \fB--profile\fP \fIString\fP ]
[
.O_profile
]
.br
[ \fB--version\fP ]
.ad b
[
.O_version
]
.RE
.hy
.ad
.
.SH OPTIONS
.
.TP
.O_autobackup
Specifies if metadata should be backed up automatically after a change.
Enabling this is strongly advised!
See \fBvgcfgbackup\fP(8) for more information.
.
.HP
\fB--commandprofile\fP \fIString\fP
.br
.TP
.O_commandprofile
The command profile to use for command configuration.
See \fBlvm.conf\fP(5) for more information about profiles.
.
.HP
\fB--config\fP \fIString\fP
.br
.TP
.O_config
Config settings for the command. These override \fBlvm.conf\fP(5) settings.
The String arg uses the same format as \fBlvm.conf\fP(5),
or may use section/field syntax.
See \fBlvm.conf\fP(5) for more information about config.
.
.HP
\fB-d\fP|\fB--debug\fP ...
.br
.TP
.O_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).
.
.HP
\fB--devices\fP \fIPV\fP
.br
.TP
.O_devices
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.
.
.HP
\fB--devicesfile\fP \fIString\fP
.br
.TP
.O_devicesfile
A file listing devices that LVM should use.
The file must exist in \fI#DEFAULT_SYS_DIR#/devices/\fP and is managed
with the \fBlvmdevices\fP(8) command.
This overrides the \fBlvm.conf\fP(5) \fBdevices/devicesfile\fP and
\fBdevices/use_devicesfile\fP settings.
.
.HP
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
.TP
.O_driverloaded
If set to no, the command will not attempt to use device-mapper.
For testing and debugging.
.
.HP
\fB-h\fP|\fB--help\fP
.br
.TP
.O_help
Display help text.
.
.HP
\fB--journal\fP \fIString\fP
.br
.TP
.O_journal
Record information in the systemd journal.
This information is in addition to information
enabled by the lvm.conf log/journal setting.
@@ -133,45 +287,38 @@ command: record information about the command.
output: record the default command output.
debug: record full command debugging.
.
.HP
\fB--lockopt\fP \fIString\fP
.br
.TP
.O_lockopt
Used to pass options for special cases to lvmlockd.
See \fBlvmlockd\fP(8) for more information.
.
.HP
\fB--longhelp\fP
.br
.TP
.O_longhelp
Display long help text.
.
.HP
\fB--nohints\fP
.br
.TP
.O_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.
.
.HP
\fB--nolocking\fP
.br
.TP
.O_nolocking
Disable locking. Use with caution, concurrent commands may produce
incorrect results.
.
.HP
\fB--profile\fP \fIString\fP
.br
.TP
.O_profile
An alias for --commandprofile or --metadataprofile, depending
on the command.
.
.HP
\fB-q\fP|\fB--quiet\fP ...
.br
.TP
.O_quiet
Suppress output and log messages. Overrides --debug and --verbose.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
\fB--reportformat\fP \fBbasic\fP|\fBjson\fP|\fBjson_std\fP
.br
.TP
.O_reportformat
Overrides current output format for reports which is defined globally by
the report/output_format setting in \fBlvm.conf\fP(5).
\fBbasic\fP is the original format with columns and rows.
@@ -181,35 +328,30 @@ output in JSON format. \fBjson_std\fP produces report output in
JSON format which is more compliant with JSON standard.
See \fBlvmreport\fP(7) for more information.
.
.HP
\fB--setphysicalvolumesize\fP \fISize\fP[m|UNIT]
.br
.TP
.O_setphysicalvolumesize
Overrides the automatically detected size of the PV.
Use with care, or prior to reducing the physical size of the device.
.
.HP
\fB-t\fP|\fB--test\fP
.br
.TP
.O_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.
.
.HP
\fB-v\fP|\fB--verbose\fP ...
.br
.TP
.O_verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail
of messages sent to stdout and stderr.
.
.HP
\fB--version\fP
.br
.TP
.O_version
Display version information.
.
.HP
\fB-y\fP|\fB--yes\fP
.br
.TP
.O_yes
Do not prompt for confirmation interactively but always assume the
answer yes. Use with extreme caution.
(For automatic no, see -qq.)
@@ -223,11 +365,17 @@ 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): \fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]...
Start and length range (counting from 0): \fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]...
.br
Start and end range (inclusive):
\fIPV\fP[\fB:\fP\fIPE\fP\fB-\fP\fIPE\fP]\ .\|.\|.\&
.br
Start and length range (counting from 0):
\fIPV\fP[\fB:\fP\fIPE\fP\fB+\fP\fIPE\fP]\ .\|.\|.\&
.
.TP
.I String
See the option description for information about the string content.
.
.TP
.IR Size [UNIT]
Size is an input number that accepts an optional unit.
@@ -251,10 +399,11 @@ is TiB,
is PiB,
.BR e | E
is EiB.
(This should not be confused with the output control --units, where
capital letters mean multiple of 1000.)
(This should not be confused with the output control --units,
where capital letters mean multiple of 1000.)
.
.SH ENVIRONMENT VARIABLES
.
See \fBlvm\fP(8) for information about environment variables used by lvm.
For example, LVM_VG_NAME can generally be substituted for a required VG parameter.
For example, \fBLVM_VG_NAME\fP can generally be substituted
for a required VG parameter.

Some files were not shown because too many files have changed in this diff Show More