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

61 Commits

Author SHA1 Message Date
Marian Csontos
1b9bf5007b scripts: Install services for devices file init
Services introduced in commit c609dedc2f
need installing.
2024-06-27 15:16:26 +02:00
Marian Csontos
ee31ba5023 spec: Install and package /etc/lvm/devices 2023-11-29 15:09:36 +01:00
David Teigland
264827cb98 lvresize: add new options and defaults for fs handling
The new option "--fs String" for lvresize/lvreduce/lvextend
controls the handling of file systems before/after resizing
the LV.  --resizefs is the same as --fs resize.

The new option "--fsmode String" can be used to control
mounting and unmounting of the fs during resizing.

Possible --fs values:

checksize
  Only applies to reducing size; does nothing for extend.
  Check the fs size and reduce the LV if the fs is not using
  the affected space, i.e. the fs does not need to be shrunk.
  Fail the command without reducing the fs or LV if the fs is
  using the affected space.

resize
  Resize the fs using the fs-specific resize command.
  This may include mounting, unmounting, or running fsck.
  See --fsmode to control mounting behavior, and --nofsck to
  disable fsck.

resize_fsadm
  Use the old method of calling fsadm to handle the fs
  (deprecated.) Warning: this option does not prevent lvreduce
  from destroying file systems that are unmounted (or mounted
  if prompts are skipped.)

ignore
  Resize the LV without checking for or handling a file system.
  Warning: using ignore when reducing the LV size may destroy the
  file system.

Possible --fsmode values:

manage
  Mount or unmount the fs as needed to resize the fs,
  and attempt to restore the original mount state at the end.

nochange
  Do not mount or unmount the fs. If mounting or unmounting
  is required to resize the fs, then do not resize the fs or
  the LV and fail the command.

offline
  Unmount the fs if it is mounted, and resize the fs while it
  is unmounted. If mounting is required to resize the fs,
  then do not resize the fs or the LV and fail the command.

Notes on lvreduce:

When no --fs or --resizefs option is specified:
. lvextend default behavior is fs ignore.
. lvreduce default behavior is fs checksize
  (includes activating the LV.)

With the exception of --fs resize_fsadm|ignore, lvreduce requires
the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE.
FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV,
which determines if reducing the fs is necessary.
2022-09-13 15:15:05 -05:00
David Teigland
ee8fb0310c remove static autoactivation
event based autoactivation is now the only method that lvm
provides for autoactivation.

Setting lvm.conf event_activation=0 can still be used to disable
event based autoactivation commands, but doing so will no longer
enable static autoactivation.
2022-01-27 16:43:11 -06:00
Marian Csontos
36095ac374 spec: Add lvmautoactivation man page 2021-12-01 15:36:34 +01:00
David Teigland
67722b3123 new udev autoactivation
new udev rule 69-dm-lvm.rules replaces
69-dm-lvm-meta.rules and lvm2-pvscan.service

udev rule calls pvscan directly on the added device

pvscan output indicates if a complete VG can be activated

udev env var LVM_VG_NAME_COMPLETE is used to pass complete
VG name from pvscan to the udev rule

udev rule uses systemd-run to run vgchange -aay <vgname>
2021-10-07 12:42:31 -05:00
Marian Csontos
49822624e8 spec: Rename vdoimport to lvm_import_vdo. 2021-08-26 17:14:08 +02:00
Marian Csontos
640fe5cf42 spec: Add vdoimport man page 2021-07-21 16:40:27 +02:00
Zdenek Kabelac
ed48cb26a3 vdo: add vdoimport support
Add tool 'vdoimport' to support easy conversion of an existing VDO manager managed
VDO volumes into lvm2 managed VDO LV.

When physical converted volume is already a logical volume, conversion
happens with the VG itself, just with validation for extent_size, so
the virtually sized logical VDO volume size can be expressed in extents.

Example of basic simple usage:

vdoimport --name vg/vdolv  /dev/mapper/vdophysicalvolume
2021-07-09 14:57:59 +02:00
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