1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
David Teigland ef96186add device usage based on devices file
The devices file /etc/lvm/devices/system.devices is a list of
devices that lvm can use.  This is the default system devices
file, which is specified in lvm.conf devices/devicesfile.

The command option --devicesfile <filename> allows lvm to be
used with a different set of devices.  This allows different
applications to use lvm on different sets of devices, e.g.
system devices do not need to be exposed to an application
using lvm on its own devices, and application devices do not
need to be exposed to the system.

In most cases (with limited exceptions), lvm will not read or
use a device not listed in the devices file.  When the devices
file is used, the regex filter is not used, and the filter
settings in lvm.conf are ignored.  filter-deviceid is used
when the devices file is enabled, and rejects any device that
does not match an entry in the devices file.

Set use_devicesfile=0 in lvm.conf or set --devicesfile ""
on the command line to disable the use of a devices file.
When disabled, lvm will see and use any device on the system
that passes the regex filter (and other standard filters.)

A device ID, e.g. wwid or serial number from sysfs, is a
unique ID that identifies a device.  The device ID is
generally independent of the device content, and lvm can
get the device ID without reading the device.
The device ID is used in the devices file as the primary
method of identifying device entries, and is also included
in VG metadata for PVs.

Each device_id has a device_id_type which indicates where
the device_id comes from, e.g. "sys_wwid" means the device_id
comes from the sysfs wwid file.  Others are sys_serial,
mpath_uuid, loop_file, md_uuid, devname.  (devname is the
device path, which is a fallback when no other proper
device_id_type is available.)

filter-deviceid permits lvm to use only devices on the system
that have a device_id matching a devices file entry.  Using
the device_id, lvm can determine the set of devices to use
without reading any devices, so the devices file will constrain
lvm in two ways:
1. it limits the devices that lvm will read.
2. it limits the devices that lvm will use.

In some uncommon cases, e.g. when devices have no unique ID
and device_id has to fall back to using the devname, lvm may
need to read all devices on the system to determine which
ones correspond to the devices file entries.  In this case,
the devices file does not limit the devices that lvm reads,
but it does limit the devices that lvm uses.

pvcreate/vgcreate/vgextend are not constrained by the devices
file, and will look outside it to find the new PV.  They assign
the new PV a device_id and add it to the devices file.  It is
also possible to explicitly add new PVs to the devices file before
using them in pvcreate/etc, in which case these commands would not
need to look outside the devices file for the new device.

vgimportdevices VG looks at all devices on the system to find an
existing VG and add its devices to the devices file.  The command
is not limited by an existing devices file.  The command will also
add device_ids to the VG metadata if the VG does not yet include
device_ids.  vgimportdevices -a imports devices for all accessible
VGs.  Since vgimportdevices does not limit itself to devices in
an existing devices file, the lvm.conf regex filter applies.
Adding --foreign will import devices for foreign VGs, but device_ids
are not added to foreign VGs.  Incomplete VGs are not imported.

The lvmdevices command manages the devices file.  The primary
purpose is to edit the devices file, but it will read PV headers
to find/check PVIDs.  (It does not read, process or modify VG
metadata.)

lvmdevices
. Displays devices file entries.
lvmdevices --check
. Checks devices file entries.
lvmdevices --update
. Updates devices file entries.
lvmdevices --adddev <devname>
. Adds devices_file entry (reads pv header).
lvmdevices --deldev <devname>
. Removes devices file entry.
lvmdevices --addpvid <pvid>
. Reads pv header of all devices to find <pvid>,
  and if found adds devices file entry.
lvmdevices --delpvid <pvid>
. Removes devices file entry.

The vgimportclone command has a new option --importdevices
that does the equivalent of vgimportdevices with the cloned
devices that are being imported.  The devices are "uncloned"
(new vgname and pvids) while at the same time adding the
devices to the devices file.  This allows cloned PVs to be
imported without duplicate PVs ever appearing on the system.

The command option --devices <devnames> allows a specific
list of devices to be exposed to the lvm command, overriding
the devices file.
2021-02-17 15:17:12 -06:00
autoconf autoconf: Fix py-compile permissions 2016-02-18 01:05:05 +00:00
base cleanup: better expressing passing key arg to _hash 2020-09-01 17:57:50 +02:00
conf thin: improve 16g support for thin pool metadata 2021-02-01 12:06:13 +01:00
coverity cov: drop model for origin_from_cow 2020-09-12 13:23:49 +02:00
daemons device usage based on devices file 2021-02-17 15:17:12 -06:00
device_mapper thin: improve 16g support for thin pool metadata 2021-02-01 12:06:13 +01:00
doc Merge branch 'master' into 2018-05-11-fork-libdm 2018-06-01 13:04:12 +01:00
include configure: check for BLKZEROOUT support 2020-10-02 20:48:41 +02:00
lib device usage based on devices file 2021-02-17 15:17:12 -06:00
libdaemon cov: drop checking for EWOULDBLOCK 2020-09-12 13:24:03 +02:00
libdm libdm: add dm_tree_node_add_thin_pool_target_v1 2021-02-01 14:52:32 +01:00
man device usage based on devices file 2021-02-17 15:17:12 -06:00
nix lockd: Clean up spec 2015-07-04 14:36:57 +02:00
po doc: change fsf address 2016-01-21 12:11:37 +01:00
scripts fsadm: fix unbound variable usage 2020-12-08 20:32:34 +01:00
spec rpm: bare words are no longer supported 2020-10-02 22:27:00 +02:00
test cachevol: allow forced detaching of damaged or invalid cachevol 2021-02-02 14:31:23 -06:00
tools device usage based on devices file 2021-02-17 15:17:12 -06:00
udev udev rule: remove lvmetad comments 2020-11-25 16:57:54 -06:00
.gitignore gitignore: ignore gcov files 2020-10-15 11:13:13 +02:00
acinclude.m4 [build] uncomment 'serial 3' in an m4 file. 2018-04-30 09:44:27 +01:00
aclocal.m4 configure: update 2020-12-11 12:16:16 +01:00
configure configure: update 2020-12-11 12:16:16 +01:00
configure.ac configure: use our ordered list of python names 2020-10-02 20:52:38 +02:00
COPYING doc: change fsf address 2016-01-21 12:11:37 +01:00
COPYING.BSD Add BSD 2-Clause License 2018-07-27 17:09:46 +02:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in lvm: add readline alternative editline 2020-09-29 10:13:24 +02:00
Makefile.in makefiles: correcting login of makefile 2018-12-17 10:55:20 +01:00
README Update README 2020-08-12 12:05:36 +02:00
TESTING docs: Add TESTING file 2017-12-14 16:45:47 +01:00
VERSION post-release 2021-01-08 10:08:36 +01:00
VERSION_DM post-release 2021-01-08 10:08:36 +01:00
WHATS_NEW lvcreate: use lv_passes_readonly_filter 2021-02-02 21:23:39 +01:00
WHATS_NEW_DM libdm: add dm_tree_node_add_thin_pool_target_v1 2021-02-01 14:52:32 +01:00

This tree contains the LVM2 and device-mapper tools and libraries.

This is development branch, for stable 2.02 release see stable-2.02 branch.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sourceware.org/pub/lvm2/
  https://github.com/lvmteam/lvm2/releases

The source code is stored in git:
  https://sourceware.org/git/?p=lvm2.git
  git clone git://sourceware.org/git/lvm2.git
mirrored to:
  https://github.com/lvmteam/lvm2
  git clone https://github.com/lvmteam/lvm2.git
  git clone git@github.com:lvmteam/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

Website:
  https://sourceware.org/lvm2/

Report upstream bugs at:
  https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper
or open issues at:
  https://github.com/lvmteam/lvm2/issues

The source code repository used until 7th June 2012 is accessible using CVS:

  cvs -d :pserver:cvs@sourceware.org:/cvs/lvm2 login cvs
  cvs -d :pserver:cvs@sourceware.org:/cvs/lvm2 checkout LVM2

The password is cvs.