1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
David Teigland 83fe6e720f device usage based on devices file
The LVM devices file lists devices that lvm can use.  The default
file is /etc/lvm/devices/system.devices, and the lvmdevices(8)
command is used to add or remove device entries.  If the file
does not exist, or if lvm.conf includes use_devicesfile=0, then
lvm will not use a devices file.  When the devices file is in use,
the regex filter is not used, and the filter settings in lvm.conf
or on the command line are ignored.

LVM records devices in the devices file using hardware-specific
IDs, such as the WWID, and attempts to use subsystem-specific
IDs for virtual device types.  These device IDs are also written
in the VG metadata.  When no hardware or virtual ID is available,
lvm falls back using the unstable device name as the device ID.
When devnames are used, lvm performs extra scanning to find
devices if their devname changes, e.g. after reboot.

When proper device IDs are used, an lvm command will not look
at devices outside the devices file, but when devnames are used
as a fallback, lvm will scan devices outside the devices file
to locate PVs on renamed devices.  A config setting
search_for_devnames can be used to control the scanning for
renamed devname entries.

Related to the devices file, the new command option
--devices <devnames> allows a list of devices to be specified for
the command to use, overriding the devices file.  The listed
devices act as a sort of devices file in terms of limiting which
devices lvm will see and use.  Devices that are not listed will
appear to be missing to the lvm command.

Multiple devices files can be kept in /etc/lvm/devices, which
allows lvm to be used with different sets of devices, e.g.
system devices do not need to be exposed to a specific application,
and the application can use lvm on its own set of devices that are
not exposed to the system.  The option --devicesfile <filename> is
used to select the devices file to use with the command.  Without
the option set, the default system devices file is used.

Setting --devicesfile "" causes lvm to not use a devices file.

An existing, empty devices file means lvm will see no devices.

The new command vgimportdevices adds PVs from a VG to the devices
file and updates the VG metadata to include the device IDs.
vgimportdevices -a will import all VGs into the system devices file.

LVM commands run by dmeventd not use a devices file by default,
and will look at all devices on the system.  A devices file can
be created for dmeventd (/etc/lvm/devices/dmeventd.devices)  If
this file exists, lvm commands run by dmeventd will use it.

Internal implementaion:

- device_ids_read - read the devices file
  . add struct dev_use (du) to cmd->use_devices for each devices file entry
- dev_cache_scan - get /dev entries
  . add struct device (dev) to dev_cache for each device on the system
- device_ids_match - match devices file entries to /dev entries
  . match each du on cmd->use_devices to a dev in dev_cache, using device ID
  . on match, set du->dev, dev->id, dev->flags MATCHED_USE_ID
- label_scan - read lvm headers and metadata from devices
  . filters are applied, those that do not need data from the device
  . filter-deviceid skips devs without MATCHED_USE_ID, i.e.
    skips /dev entries that are not listed in the devices file
  . read lvm label from dev
  . filters are applied, those that use data from the device
  . read lvm metadata from dev
  . add info/vginfo structs for PVs/VGs (info is "lvmcache")
- device_ids_find_renamed_devs - handle devices with unstable devname ID
  where devname changed
  . this step only needed when devs do not have proper device IDs,
    and their dev names change, e.g. after reboot sdb becomes sdc.
  . detect incorrect match because PVID in the devices file entry
    does not match the PVID found when the device was read above
  . undo incorrect match between du and dev above
  . search system devices for new location of PVID
  . update devices file with new devnames for PVIDs on renamed devices
  . label_scan the renamed devs
- continue with command processing
2021-02-23 16:43:32 -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-23 16:43:32 -06:00
device_mapper device_mapper: simplify line emitter checking 2021-02-10 15:39:03 +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-23 16:43:32 -06:00
libdaemon cov: drop checking for EWOULDBLOCK 2020-09-12 13:24:03 +02:00
libdm libdm: simplify line emitter checking 2021-02-10 15:39:03 +01:00
man device usage based on devices file 2021-02-23 16:43:32 -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: avoid access to unbound variable 2021-02-23 14:56:47 +01:00
spec device usage based on devices file 2021-02-23 16:43:32 -06:00
test tests: remove local setting of LVM_BINARY 2021-02-23 14:56:47 +01:00
tools device usage based on devices file 2021-02-23 16:43:32 -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 WHATS_NEW: updates 2021-02-23 15:01:05 +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.