1PVSCAN(8)                   System Manager's Manual                  PVSCAN(8)
2
3
4

NAME

6       pvscan - List all physical volumes
7

SYNOPSIS

9       pvscan option_args
10           [ option_args ]
11           [ position_args ]
12

DESCRIPTION

14       pvscan scans all supported LVM block devices in the system for PVs.
15
16       Scanning with lvmetad
17
18       pvscan operates differently when used with the lvmetad(8) daemon.
19
20       Scanning  disks  is required to read LVM metadata and identify LVM PVs.
21       Once read, lvmetad caches the metadata so that LVM commands can read it
22       without  repeatedly  scanning  disks.  This is helpful because scanning
23       disks is time consuming, and frequent scanning may interfere  with  the
24       normal work of the system and disks.
25
26       When lvmetad is not used, LVM commands revert to scanning disks to read
27       metadata.  Any LVM command that needs metadata will scan disks for  it;
28       running  the  pvscan command is not necessary for the sake of other LVM
29       commands.
30
31       When lvmetad is used, LVM commands  avoid  scanning  disks  by  reading
32       metadata  from lvmetad.  When new disks appear, they must be scanned so
33       their metadata can be cached in lvmetad.  This is done by  the  command
34       pvscan --cache, which scans disks and passes the metadata to lvmetad.
35
36       The  pvscan  --cache  command  is typically run automatically by system
37       services when a new device appears.  Users do not generally need to run
38       this command if the system and lvmetad are running properly.
39
40       Many  scripts  contain unnecessary pvscan (or vgscan) commands for his‐
41       torical reasons.  To avoid disrupting the system with  extraneous  disk
42       scanning,  an  ordinary pvscan (without --cache) will simply read meta‐
43       data from lvmetad like other LVM commands.  It  does  not  do  anything
44       beyond displaying the current state of the cache.
45
46       · When  given  specific device name arguments, pvscan --cache will only
47         read the named devices.
48
49       · LVM udev rules and systemd services are used  to  initiate  automatic
50         device scanning.
51
52       · To  prevent devices from being scanned by pvscan --cache, add them to
53         lvm.conf(5) devices/global_filter.  The devices/filter  setting  does
54         not apply to system level scanning.  For more information, see:
55         lvmconfig --withcomments devices/global_filter
56
57       · If  lvmetad  is started or restarted after devices are visible, or if
58         the global_filter has changed, then all devices must be rescanned for
59         metadata with the command pvscan --cache.
60
61       · lvmetad does not cache older metadata formats, e.g. lvm1, and will be
62         temporarily disabled if they are seen.
63
64       · To notify lvmetad about a device that is no longer present, the major
65         and minor numbers must be given, not the path.
66
67       Automatic activation
68
69       When  event-driven  system  services detect a new LVM device, the first
70       step is to automatically scan and cache the metadata from  the  device.
71       This  is  done  by  pvscan  --cache.  A second step is to automatically
72       activate LVs that are present on the new device.  This  auto-activation
73       is  done  by the same pvscan --cache command when the option --activate
74       ay is included.
75
76       Auto-activation of VGs or LVs can be enabled/disabled using:
77       lvm.conf(5) activation/auto_activation_volume_list
78
79       For more information, see:
80       lvmconfig --withcomments activation/auto_activation_volume_list
81
82       When this setting is undefined, all LVs are auto-activated (when lvm is
83       fully integrated with the event-driven system services.)
84
85       When  a  VG  or  LV is not auto-activated, traditional activation using
86       vgchange or lvchange --activate is needed.
87
88       · pvscan auto-activation can be only done in combination with --cache.
89
90       · Auto-activation is designated by the "a" argument in  --activate  ay.
91         This  is meant to distinguish system generated commands from explicit
92         user commands, although it can be used  in  any  activation  command.
93         Whenever it is used, the auto_activation_volume_list is applied.
94
95       · Auto-activation is not yet supported for LVs that are part of partial
96         or clustered volume groups.
97

USAGE

99       Display PV information.
100
101       pvscan
102           [ -e|--exported ]
103           [ -n|--novolumegroup ]
104           [ -s|--short ]
105           [ -u|--uuid ]
106           [ COMMON_OPTIONS ]
107
108       Populate the lvmetad cache by scanning PVs.
109
110       pvscan --cache
111           [ -b|--background ]
112           [ -a|--activate ay ]
113           [ -j|--major Number ]
114           [    --minor Number ]
115           [ COMMON_OPTIONS ]
116           [ String|PV ... ]
117
118       Common options for command:
119           [    --ignorelockingfailure ]
120           [    --reportformat basic|json ]
121
122       Common options for lvm:
123           [ -d|--debug ]
124           [ -h|--help ]
125           [ -q|--quiet ]
126           [ -t|--test ]
127           [ -v|--verbose ]
128           [ -y|--yes ]
129           [    --commandprofile String ]
130           [    --config String ]
131           [    --driverloaded y|n ]
132           [    --lockopt String ]
133           [    --longhelp ]
134           [    --profile String ]
135           [    --version ]
136

OPTIONS

138       -a|--activate y|n|ay
139              Auto-activate LVs in a VG when the PVs scanned have completed
140              the VG.  (Only ay is applicable.)
141
142       -b|--background
143              If the operation requires polling, this option causes the com‐
144              mand to return before the operation is complete, and polling is
145              done in the background.
146
147       --cache
148              Scan one or more devices and send the metadata to lvmetad.
149
150       --commandprofile String
151              The command profile to use for command configuration.  See
152              lvm.conf(5) for more information about profiles.
153
154       --config String
155              Config settings for the command. These override lvm.conf set‐
156              tings.  The String arg uses the same format as lvm.conf, or may
157              use section/field syntax.  See lvm.conf(5) for more information
158              about config.
159
160       -d|--debug ...
161              Set debug level. Repeat from 1 to 6 times to increase the detail
162              of messages sent to the log file and/or syslog (if configured).
163
164       --driverloaded y|n
165              If set to no, the command will not attempt to use device-mapper.
166              For testing and debugging.
167
168       -e|--exported
169              Only show PVs belonging to exported VGs.
170
171       -h|--help
172              Display help text.
173
174       --ignorelockingfailure
175              Allows a command to continue with read-only metadata operations
176              after locking failures.
177
178       --lockopt String
179              Used to pass options for special cases to lvmlockd.  See lvm‐
180              lockd(8) for more information.
181
182       --longhelp
183              Display long help text.
184
185       -j|--major Number
186              The major number of a device.
187
188       --minor Number
189              The minor number of a device.
190
191       -n|--novolumegroup
192              Only show PVs not belonging to any VG.
193
194       --profile String
195              An alias for --commandprofile or --metadataprofile, depending on
196              the command.
197
198       -q|--quiet ...
199              Suppress output and log messages. Overrides --debug and --ver‐
200              bose.  Repeat once to also suppress any prompts with answer
201              'no'.
202
203       --reportformat basic|json
204              Overrides current output format for reports which is defined
205              globally by the report/output_format setting in lvm.conf.  basic
206              is the original format with columns and rows.  If there is more
207              than one report per command, each report is prefixed with the
208              report name for identification. json produces report output in
209              JSON format. See lvmreport(7) for more information.
210
211       -s|--short
212              Short listing format.
213
214       -t|--test
215              Run in test mode. Commands will not update metadata.  This is
216              implemented by disabling all metadata writing but nevertheless
217              returning success to the calling function. This may lead to
218              unusual error messages in multi-stage operations if a tool
219              relies on reading back metadata it believes has changed but
220              hasn't.
221
222       -u|--uuid
223              Show UUIDs in addition to device names.
224
225       -v|--verbose ...
226              Set verbose level. Repeat from 1 to 4 times to increase the
227              detail of messages sent to stdout and stderr.
228
229       --version
230              Display version information.
231
232       -y|--yes
233              Do not prompt for confirmation interactively but always assume
234              the answer yes. Use with extreme caution.  (For automatic no,
235              see -qq.)
236

VARIABLES

238       PV
239              Physical  Volume  name,  a device path under /dev.  For commands
240              managing physical extents, a PV positional arg generally accepts
241              a  suffix  indicating  a  range (or multiple ranges) of physical
242              extents (PEs). When the first PE is omitted, it defaults to  the
243              start of the device, and when the last PE is omitted it defaults
244              to end.  Start and end range (inclusive):  PV[:PE-PE]...   Start
245              and length range (counting from 0): PV[:PE+PE]...
246
247       String
248              See the option description for information about the string con‐
249              tent.
250
251       Size[UNIT]
252              Size is an input number that accepts an  optional  unit.   Input
253              units are always treated as base two values, regardless of capi‐
254              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
255              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
256              resents other possible input units:  bBsSkKmMgGtTpPeE.   b|B  is
257              bytes,  s|S  is  sectors  of 512 bytes, k|K is kilobytes, m|M is
258              megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
259              e|E  is  exabytes.  (This should not be confused with the output
260              control --units, where capital letters mean multiple of 1000.)
261

ENVIRONMENT VARIABLES

263       See lvm(8) for information about environment  variables  used  by  lvm.
264       For example, LVM_VG_NAME can generally be substituted for a required VG
265       parameter.
266

SEE ALSO

268       lvm(8) lvm.conf(5) lvmconfig(8)
269
270       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
271       pvresize(8) pvs(8) pvscan(8)
272
273       vgcfgbackup(8)  vgcfgrestore(8)  vgchange(8) vgck(8) vgcreate(8) vgcon‐
274       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
275       clone(8)  vgmerge(8)  vgmknodes(8)  vgreduce(8) vgremove(8) vgrename(8)
276       vgs(8) vgscan(8) vgsplit(8)
277
278       lvcreate(8) lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8)  lvre‐
279       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
280
281       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
282       vate(8) lvmdump(8)
283
284       dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8)  lvmlockctl(8)  clvmd(8)
285       cmirrord(8) lvmdbusd(8)
286
287       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
288
289
290
291Red Hat, Inc.      LVM TOOLS 2.02.180(2)-RHEL7 (2018-07-20)          PVSCAN(8)
Impressum