summaryrefslogtreecommitdiff
path: root/lib/Makefile.in
Commit message (Collapse)AuthorAgeFilesLines
* devices: factor common list functionsDavid Teigland2022-11-071-0/+1
| | | | which were duplicated in various places
* lvresize: add new options and defaults for fs handlingDavid Teigland2022-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* filter-mpath: get wwids from sysfs vpd_pg83David Teigland2022-06-081-0/+1
| | | | | | | | | to compare with wwids in /etc/multipath/wwids when excluding multipath components. The wwid printed from the sysfs wwid file may not be the wwid used in multipath wwids. Save the wwids found for each device on dev->wwids to avoid repeating reading and parsing the sysfs files.
* filters: remove unused internal filterDavid Teigland2022-04-061-1/+0
|
* move code from pvscan.c to online.cDavid Teigland2021-11-041-0/+1
| | | | | related to managing files in /run/lvm/pvs_online and /run/lvm/vgs_online
* devices: rework libudev usageDavid Teigland2021-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related to config settings: obtain_device_info_from_udev (controls if lvm gets a list of devices from readdir /dev or from libudev) external_device_info_source (controls if lvm asks libudev for device information) . Make the obtain_device_list_from_udev setting affect only the choice of readdir /dev vs libudev. The setting no longer controls if udev is used for device type checks. . Change obtain_device_list_from_udev default to 0. This helps avoid boot timeouts due to slow libudev queries, avoids reported failures from udev_enumerate_scan_devices, and avoids delays from "device not initialized in udev database" errors. Even without errors, for a system booting with 1024 PVs, lvm2-pvscan times improve from about 100 sec to 15 sec, and the pvscan command from about 64 sec to about 4 sec. . For external_device_info_source="none", remove all libudev device info queries, and use only lvm native device info. . For external_device_info_source="udev", first check lvm native device info, then check libudev info. . Remove sleep/retry loop when attempting libudev queries for device info. udev info will simply be skipped if it's not immediately available. . Only set up a libdev connection if it will be used by obtain_device_list_from_udev/external_device_info_source. . For native multipath component detection, use /etc/multipath/wwids. If a device has a wwid matching an entry in the wwids file, then it's considered a multipath component. This is necessary to natively detect multipath components when the mpath device is not set up.
* make: cflow target works againZdenek Kabelac2021-03-201-0/+1
| | | | | Restored 'make cflow' functinality. Produces some quick referece of function chaining and usage.
* device usage based on devices fileDavid Teigland2021-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow dm-integrity to be used for raid imagesDavid Teigland2020-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dm-integrity stores checksums of the data written to an LV, and returns an error if data read from the LV does not match the previously saved checksum. When used on raid images, dm-raid will correct the error by reading the block from another image, and the device user sees no error. The integrity metadata (checksums) are stored on an internal LV allocated by lvm for each linear image. The internal LV is allocated on the same PV as the image. Create a raid LV with an integrity layer over each raid image (for raid levels 1,4,5,6,10): lvcreate --type raidN --raidintegrity y [options] Add an integrity layer to images of an existing raid LV: lvconvert --raidintegrity y LV Remove the integrity layer from images of a raid LV: lvconvert --raidintegrity n LV Settings Use --raidintegritymode journal|bitmap (journal is default) to configure the method used by dm-integrity to ensure crash consistency. Initialization When integrity is added to an LV, the kernel needs to initialize the integrity metadata/checksums for all blocks in the LV. The data corruption checking performed by dm-integrity will only operate on areas of the LV that are already initialized. The progress of integrity initialization is reported by the "syncpercent" LV reporting field (and under the Cpy%Sync lvs column.) Example: create a raid1 LV with integrity: $ lvcreate --type raid1 -m1 --raidintegrity y -n rr -L1G foo Creating integrity metadata LV rr_rimage_0_imeta with size 12.00 MiB. Logical volume "rr_rimage_0_imeta" created. Creating integrity metadata LV rr_rimage_1_imeta with size 12.00 MiB. Logical volume "rr_rimage_1_imeta" created. Logical volume "rr" created. $ lvs -a foo LV VG Attr LSize Origin Cpy%Sync rr foo rwi-a-r--- 1.00g 4.93 [rr_rimage_0] foo gwi-aor--- 1.00g [rr_rimage_0_iorig] 41.02 [rr_rimage_0_imeta] foo ewi-ao---- 12.00m [rr_rimage_0_iorig] foo -wi-ao---- 1.00g [rr_rimage_1] foo gwi-aor--- 1.00g [rr_rimage_1_iorig] 39.45 [rr_rimage_1_imeta] foo ewi-ao---- 12.00m [rr_rimage_1_iorig] foo -wi-ao---- 1.00g [rr_rmeta_0] foo ewi-aor--- 4.00m [rr_rmeta_1] foo ewi-aor--- 4.00m
* move pv_list code into libDavid Teigland2020-04-131-0/+1
|
* writecache: move code into new fileDavid Teigland2019-09-241-0/+1
| | | | | | put writecache specific code in writecache_manip.c should be no functional change
* add device hints to reduce scanningDavid Teigland2019-01-151-0/+1
| | | | | | | Save the list of PVs in /run/lvm/hints. These hints are used to reduce scanning in a number of commands to only the PVs on the system, or only the PVs in a requested VG (rather than all devices on the system.)
* lvm: drop usage of dl libraryZdenek Kabelac2018-12-171-10/+1
| | | | | | Since lvm no longer supports any dlopen-able plugins (which in practice was never really usable) drop linking with -ldl.
* Add dm-writecache supportDavid Teigland2018-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dm-writecache is used like dm-cache with a standard LV as the cache. $ lvcreate -n main -L 128M -an foo /dev/loop0 $ lvcreate -n fast -L 32M -an foo /dev/pmem0 $ lvconvert --type writecache --cachepool fast foo/main $ lvs -a foo -o+devices LV VG Attr LSize Origin Devices [fast] foo -wi------- 32.00m /dev/pmem0(0) main foo Cwi------- 128.00m [main_wcorig] main_wcorig(0) [main_wcorig] foo -wi------- 128.00m /dev/loop0(0) $ lvchange -ay foo/main $ dmsetup table foo-main_wcorig: 0 262144 linear 7:0 2048 foo-main: 0 262144 writecache p 253:4 253:3 4096 0 foo-fast: 0 65536 linear 259:0 2048 $ lvchange -an foo/main $ lvconvert --splitcache foo/main $ lvs -a foo -o+devices LV VG Attr LSize Devices fast foo -wi------- 32.00m /dev/pmem0(0) main foo -wi------- 128.00m /dev/loop0(0)
* Remove lvmetadDavid Teigland2018-07-111-5/+0
| | | | | | | | | | | | | Native disk scanning is now both reduced and async/parallel, which makes it comparable in performance (and often faster) when compared to lvm using lvmetad. Autoactivation now uses local temp files to record online PVs, and no longer requires lvmetad. There should be no apparent command-level change in behavior.
* vdo: introduce segment types and manip functionsZdenek Kabelac2018-07-091-0/+5
| | | | Core functionality introducing lvm VDO support.
* Remove more code that was only used by liblvm2appDavid Teigland2018-06-081-1/+0
|
* Remove clvmd and associated codeDavid Teigland2018-06-051-12/+1
| | | | More code reduction and simplification can follow.
* build: libbase.aJoe Thornber2018-06-041-1/+0
|
* bcache: switch to storing blocks in a radix tree.Joe Thornber2018-05-301-0/+1
| | | | | | Rather than a hash table. This will make invalidate_fd() more efficient since we can iterate just those blocks that are on a particular dev.
* bcache: Move the utils to a separate file.Joe Thornber2018-05-031-0/+1
| | | | This makes it clearer that they don't access the cache internals.
* devices: ignore lvm1 and pool devicesDavid Teigland2018-05-011-0/+2
|
* Remove lvm1 and pool disk formatsDavid Teigland2018-04-301-29/+0
| | | | | | | | | | | There are likely more bits of code that can be removed, e.g. lvm1/pool-specific bits of code that were identified using FMT flags. The vgconvert command can likely be reduced further. The lvm1-specific config settings should probably have some other fields set for proper deprecation.
* build: remove --with-{snapshots,mirrors,raid,thin,cache} options from ↵Joe Thornber2018-04-301-45/+5
| | | | | | ./configure It now behaves as if the were all set as 'internal'
* [lib/device/bcache] Tweaks after Kabi's reviewJoe Thornber2018-04-201-0/+1
|
* liblvm: Move lib code used exclusively into metadata-liblvm.cAlasdair G Kergon2017-10-181-0/+1
| | | | Also remove some redundant function definitions from metadata.h.
* replicator: remove the codeDavid Teigland2017-10-131-10/+0
| | | | | It has not been used in a long time and is not expected to be used further.
* makefiles: cleanupsZdenek Kabelac2017-08-011-4/+4
|
* makefiles: fixing linkingZdenek Kabelac2017-08-011-7/+2
| | | | | | | | | | | Avoid adding -g more then once for debug builds. Avoid enabling DEBUG_MEM when we build multithreaded tools. Link executables with -fPIE -pie and --export-dynamic LDFLAGS Introduce PROGS_FLAGS to add option to pass flags for external libs. Link lvm2 internally library only when really used. Link DAEMON_LIBS with daemons. Pass VALGRIND_CFLAGS internally Set shell failure mode on couple places.
* lib: Move lcm and gcd to lib/misc for wider use.Alasdair G Kergon2016-08-181-0/+1
|
* vgimportclone: add native commandDavid Teigland2016-06-221-0/+1
| | | | | This is cleaner and more efficient than the script. The args and usage are unchanged.
* dbus: add notification from commandsDavid Teigland2016-03-071-0/+2
| | | | | | | When a command modifies a PV or VG, or changes the activation state of an LV, it will send a dbus notification when the command is finished. This can be enabled/disabled with a config setting.
* doc: change fsf addressZdenek Kabelac2016-01-211-1/+1
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* pvcreate: don't support unpartitioned DASD devices with CDL formattedLidong Zhong2015-10-271-0/+1
| | | | | | | | | The former patch(dab3ebce4c7) is a little bit strict. For example, it is OK to create PV on unpartitioned DASD devices with LDL formatted. So after lvm version containing the patch, LVs created on those devices could not be found. Signed-off-by: Lidong Zhong <lzhong@suse.com>
* makefiles: ensure no old .h are leftZdenek Kabelac2015-09-081-0/+2
| | | | | | | Ensure make clean cleans any left-over file from their previous location so they are not in conflict with new ones. Also hide error message when .commands file is not present.
* configure: relocate generated headersZdenek Kabelac2015-09-071-2/+0
| | | | | | | | | | | | | | | Relocate generated configure.h and lvm-version.h outside of compilable .c source tree. The reason is behind - when compiling in builddir != srcdir the generated file in lib/misc/configure.h was used for all compiled source file except ones located in lib/misc dir - those would have used configure.h file located in this dir - if there have existed one (i.e. from some other build) This problem was only visible, when srcdir == buildir was used before trying to use srcdri != builddir (as configure.h appeared then in srcdir).
* libdm: Add dm_timestamp functions.Alasdair G Kergon2015-07-291-5/+0
|
* Add lvmlockddev-dct-lvmlockd-AZDavid Teigland2015-07-021-0/+5
|
* cleanup: remove unused tags.c filePeter Rajnoha2015-06-291-1/+0
|
* lvmpolld: Add standalone polldaemon.Ondrej Kozina2015-05-091-0/+5
| | | | See doc/lvmpolld_overview.txt
* configure: Look for valgrind.h independently of VALGRIND_POOLS.Petr Rockai2015-02-051-1/+1
|
* filters: add firmware RAID filterPeter Rajnoha2015-01-301-0/+1
| | | | | | | | | | | | | | | | | Just like MD filtering that detects components of software RAID (md), add detection for firmware RAID. We're not adding any native code to detect this - there are lots of firmware RAIDs out there which is just out of LVM scope. However, with current changes with which we're able to get device info from external sources (e.g. external_device_info_source="udev"), we can do this easily if the external device status source has this kind of information - which is the case of "udev" source where the results of blkid scans are stored. This detection should cover all firmware RAIDs that blkid can detect and which are identified as: ID_FS_TYPE = {adaptec,ddf,hpt45x,hpt37x,isw,jmicron,lsi_mega,nvidia,promise_fasttrack,silicon_medley,via}_raid_member
* device: add infrastructure to support external device infoPeter Rajnoha2015-01-301-0/+1
|
* filters: add "usable device" filterPeter Rajnoha2014-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usable device filter is responsible for filtering out unusable DM devices. The filter has 3 modes of operation: - FILTER_MODE_NO_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is empty - whether device is blocked - whether device is suspended (only on devices/ignore_suspended_devices=1) - whether device uses an error target - whether device name/uuid is reserved - FILTER_MODE_PRE_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is empty - whether device is suspended (only on devices/ignore_suspended_devices=1) - whether device uses an error target - whether device name/uuid is reserved - FILTER_MODE_POST_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is blocked - whether device is suspended (only on devices/ignore_suspended_devices=1) These modes will be used by subsequent patch to create different instances of this filter, depending on lvmetad use.
* locking: Separate out flock and signal code.Alasdair G Kergon2014-05-011-0/+2
|
* makefiles: use BLKID/UDEV_CFLAGS properlyZdenek Kabelac2014-03-061-0/+2
| | | | | blkid.h needs BLKID_CFLAGS Do not add UDEV_CFLAGS everywhere and use it only when needed.
* cache: Add functions that create/remove cache LVsJonathan Brassow2014-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | A cache LV - from LVM's perpective - is a user accessible device that links the cachepool LV and the origin LV. The following functions were added to facilitate the creation and removal of this top-level LV: 1) 'lv_cache_create' - takes a cachepool and an origin device and links them into a new top-level LV of 'cache' segment type. No allocation is necessary in this function, as the sub-LVs contain all of the necessary allocated space. Only the top-level layer needs to be created. 2) 'lv_cache_remove' - this function removes the top-level LV of a cache LV - promoting the cachepool and origin sub-LVs to top-level devices and leaving them exposed to the user. That is, the cachepool is unlinked and free to be used with another origin to form a new cache LV; and the origin is no longer cached. (Currently, if the cache needs to be flushed, it is done in this function and the function waits for it to complete before proceeding. This will be taken out in a future patch in favor of polling.)
* cache: New 'cachepool' segment typeJonathan Brassow2014-01-271-1/+10
| | | | | | | | | | | This patch adds the new cachepool segment type - the first of two necessary to eventually create 'cache' logical volumes. In addition to the new segment type, updates to makefiles, configure files, the lv_segment struct, and some necessary libdevmapper flags. The cachepool is the LV and corresponding segment type that will hold all information pertinent to the cache itself - it's size, cachemode, cache policy, core arguments (like migration_threshold), etc.
* Misc: Move some thin pool functions to a new fileJonathan Brassow2014-01-221-0/+1
| | | | | | | | | | Functions that handle set-up, tear-down and creation of thin pool volumes will be more generally applicable when more targets exist that make use of device-mapper's persistent data format. One of these targets is the dm-cache target. I've selected some functions that will be useful for the cache segment type to be moved, since they will no longer be thin pool specific but are more broadly useful to any segment type that makes use of a 'pool' LV.
* filters: check for mpath before opening devsAlasdair G Kergon2013-08-131-1/+2
| | | | | | | | | | | | | | | | Split out the partitioned device filter that needs to open the device and move the multipath filter in front of it. When a device is multipathed, sending I/O to the underlying paths may cause problems, the most obvious being I/O errors visible to lvm if a path is down. Revert the incorrect <backtrace> messages added when a device doesn't pass a filter. Log each filter initialisation to show sequence. Avoid duplicate 'Using $device' debug messages.