1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

52 Commits

Author SHA1 Message Date
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
Marian Csontos
b20b23dfc6 spec: Fix lvm2-activation-generator man page handling
lvm2-activation-generator is not installed when systemd is not in the
system.
2019-10-04 16:29:38 +02:00
Marian Csontos
3ce0dc59f2 spec: Move blkdeactivate to device-mapper 2019-09-20 10:59:59 +02:00
Zdenek Kabelac
2a45ef0300 rpm: package lvmvdo man page 2019-01-22 14:35:47 +01:00
Marian Csontos
21784e94d6 udev: 69-dm-lvm-metad.rules is still needed 2018-12-06 10:50:42 +01:00
Zdenek Kabelac
6a4a6a7cd7 rpm: install lvm2-pvscan again
Let's repeat history once more 13d5c78a8d.
2018-11-30 13:10:00 +01:00
Marian Csontos
11d4e63888 spec: No %ghost for dirs at tmpfiles.d
%ghost should not be used for directories created by systemd-tmpfiles.

This may prevent package from working right after installation without
invoking systemd-tmpfiles.

See: https://pagure.io/packaging-committee/issue/439
2018-10-03 20:05:37 +02:00
Marian Csontos
ccb08dfa1d spec: Remove lvmconf refernces
Fixes: 81ca0cb161
2018-09-14 13:49:51 +02:00
David Teigland
19a59cc53c More cleanup needed for dropped scripts
and drop the lvm2 prefix from lvmlockd service
2018-09-13 11:09:25 -05:00
Marian Csontos
706606627f spec: Fix conditional 2018-07-24 16:22:23 +02:00
Marian Csontos
279f3bfdc0 spec: Add vdo files 2018-07-24 15:41:30 +02:00
Marian Csontos
bf4be80669 spec: Remove lvmetad 2018-07-24 14:50:52 +02:00
Zdenek Kabelac
27c647d6ce rpm: drop no longer present clvmd, lvm2app 2018-06-15 00:47:35 +02:00
David Teigland
a5256d1353 spec: rename lockd to lvmlockd 2017-04-18 11:22:07 -05:00
Marian Csontos
162552041f spec: Add dmfilemapd 2017-03-28 21:52:50 +02:00
Marian Csontos
cf0bf4b314 spec: Profiles are not %config(noreplace)
These files are just examples and should not be edited by user.
2017-03-16 13:02:24 +01:00
Marian Csontos
2fd5c8e908 spec: lvmchange is built-in command 2017-03-16 11:44:10 +01:00
Peter Rajnoha
5c55c4ac18 spec: move dmeventd -R from post to posttrans script for device-mapper-event package
See also https://bugzilla.redhat.com/show_bug.cgi?id=1382688.
2016-10-12 13:52:13 +02:00
Zdenek Kabelac
5bf1778e33 rpm: install lvmreport.7 2016-09-12 16:51:53 +02:00
Zdenek Kabelac
ca7921f54b rpm: build with raid man page 2016-09-09 20:59:22 +02:00
Marian Csontos
e30fb19030 spec: Add new files 2016-08-11 14:10:59 +02:00
Marian Csontos
e72184bb76 spec: Fix gobject dependency
Use python3-gobject-base instead of python3-gobject requiring xorg

(cherry picked from commit d929d82116759f53484e662b967165ef4fe4257c)
2016-03-09 14:00:05 +01:00
Marian Csontos
d7ca164597 spec: Add missing dependency for dbusd
(cherry picked from commit 7435de21492f6b37ac7664d1f27b4a8dcc4d0dd4)
2016-03-09 10:58:21 +01:00
Marian Csontos
04ab1fa572 spec: Update python bindings and dbus-service
The workaround for python3 is no longer needed.
2016-02-18 20:46:03 +01:00
Marian Csontos
89574055f7 spec: Add python bindings 2015-11-02 12:42:32 +01:00
Zdenek Kabelac
0889cff5d5 spec: upgrade
Upgrade spec rules to be in touch with recent code.
Provide services and proper postin/preun/postun scriplets.
2015-09-10 17:28:47 +02:00
Zdenek Kabelac
0ec64370b2 specs: install lvmlockctl only when built
Move install line into proper section.
2015-09-07 23:27:50 +02:00
Zdenek Kabelac
330cad1567 specs: package lvmlockctl man page 2015-09-07 17:44:08 +02:00
Marian Csontos
bfb58b7e1c spec: Add cache-*.profile 2015-08-14 21:45:11 +02:00
Alasdair G Kergon
41001dbfdd dmsetup: Also install dmstats. 2015-08-10 00:35:15 +01:00
Marian Csontos
8bc90a25c2 spec: lockd_dlm requires dlm-lib instead of dlm 2015-07-30 20:39:38 +02:00
Marian Csontos
d9d47b7b88 spec: Move lvm2-lockd into separate package 2015-07-07 16:53:19 +02:00
Marian Csontos
5fb71bd530 lockd: Clean up spec 2015-07-04 14:36:57 +02:00
David Teigland
fe70b03de2 Add lvmlockd 2015-07-02 15:42:26 -05:00
Zdenek Kabelac
190e91231c spec: new man page 2015-05-15 21:31:28 +02:00
Zdenek Kabelac
f3a19fbe13 spec: package old sysv initscript for lvmpolld 2015-05-14 11:27:52 +02:00
Zdenek Kabelac
1b43d63368 spec: packaging polld
Package lvmpolld

Drop legacy SysV init subpackage.
2015-05-13 13:18:59 +02:00
Petr Rockai
13fea87960 spec: Pull in lvmconfig and associated manpages. 2015-04-30 06:35:05 +02:00
Petr Rockai
926b38c0d7 spec: Add lvmlocal.conf to RPMs. 2015-03-03 15:47:13 +01:00
Petr Rockai
1ee82b545b spec: Include lvmsystemid.7 in RPMs. 2015-02-16 17:15:03 +01:00
Petr Rockai
d5537e7d6b spec: Add an (optional) lvm2-testsuite subpackage. 2015-02-05 13:47:18 +01:00
Peter Rajnoha
4c9fbe048f spec: new thin-generic.profile 2014-06-13 10:01:34 +02:00
Peter Rajnoha
23f9c45a1b profiles: remove default.profile and add {command,metadata}_profile_template.profile
The "default.profile" name was misleading. It's actually a helper
*template* that can be used for copying and further editing to create
a new profile.

Also, we have separate command and metadata profiles now so the templates
are separated as well - we can't mix profile settings from one group with
another - such profile is rejected by lvm tools.
2014-05-21 12:36:52 +02:00
Zdenek Kabelac
e538354e28 spec: configurable cache build
Install lvmcache man page when being configured with cache support.
Install lvmthin man page only with thin support.
2014-05-20 21:50:30 +02:00
Zdenek Kabelac
b73a786755 man: lvmcache
Migrate cache description into  man(7) entry
(like lvmthin).
2014-05-15 12:13:24 +02:00
Petr Rockai
0996b5ccf4 spec: Add lvmthin.7.gz to packages.inc. 2014-04-07 20:38:42 +02:00
Zdenek Kabelac
0e02551f04 spec: add dumpconfig man 2014-03-28 00:41:19 +01:00
Petr Rockai
244b80d948 spec: Package the new clvmd/cmirrord systemd units. 2014-02-28 11:23:52 +01:00
Petr Rockai
13d5c78a8d spec: Add lvm2-pvscan@.service to filelist. 2014-02-28 11:23:51 +01:00
Petr Rockai
49ea253aaf spec: Add thin-performance.profile to the filelist. 2014-02-28 11:23:51 +01:00