summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: for devices filedev-dct-deviceid-31David Teigland2021-02-174-0/+1591
|
* tests: allow tests to use real devicesDavid Teigland2021-02-174-2/+75
| | | | | | | | user creates a file listing real devices they want lvm tests to use, and sets LVM_TEST_DEVICE_LIST. lvm tests can use these with prepare_real_devs and get_real_devs. Other aux functions do not work with these devs.
* device usage based on devices fileDavid Teigland2021-02-1755-191/+4455
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* hints: clean up comment and init settingsDavid Teigland2021-02-021-2/+6
| | | | no behavior change
* cachevol: allow forced detaching of damaged or invalid cachevolDavid Teigland2021-02-022-7/+54
| | | | | | | A cachevol can be forcibly detached when it's missing devices. Also allow this if it's damaged/invalid and unrepairable. This would be needed to recover data from the origin LV after a cachevol is lost or damaged beyond repair.
* test: check read_only_volume_list tagging worksZdenek Kabelac2021-02-021-0/+5
|
* lvcreate: use lv_passes_readonly_filterZdenek Kabelac2021-02-024-0/+14
| | | | | | Check if created LV is going to be activated read-only because such LV cannot be zeroed (equals to use option '-pr').
* writecache: let block_size setting override device block sizesDavid Teigland2021-02-022-3/+41
| | | | | | | | | | | | | | | | | In cases where lvconvert does not detect a fs block size on the device, it falls back to choosing a writecache block size based on the device's LBS and PBS (tries to match those.) If the user specifies a writecache block size on the command line (--cachesettings block_size=4096|512), lvconvert currently fails and reports an error if the user-specified value does not match the value lvconvert would have chosen based on LBS and PBS. The purpose of allowing a user-specified value on the command line is to override what lvconvert would otherwise do, so change this to just print a warning that the user value does not match the value that would be chosen based on the LBS/PBS, and then take the user-specified value as the writecache block size.
* filter-mpath: work with nvme devicesDavid Teigland2021-02-024-63/+177
| | | | | Recognize when a device is nvme, and apply filter-mpath to nvme devices in addition to scsi devices.
* tests: increase required target versionZdenek Kabelac2021-02-011-1/+1
| | | | Require 1.7.0 for raid0.
* tests: avoid killing test machines with kernel bugZdenek Kabelac2021-02-011-1/+1
| | | | | | Bug 1916891 still applies: https://bugzilla.redhat.com/show_bug.cgi?id=1916891
* tests: check for raid target supportZdenek Kabelac2021-02-011-0/+2
|
* gcc: hide uninitialized warning with older gccZdenek Kabelac2021-02-011-1/+1
|
* libdm: add dm_tree_node_add_thin_pool_target_v1Zdenek Kabelac2021-02-014-13/+44
| | | | Supports thin-pool without crop.
* aux: update thin_restore_needs_more_volumesZdenek Kabelac2021-02-011-0/+1
| | | | Version 0.8.5-2.el7 needs to return 0;
* tests: check for cache support presenceZdenek Kabelac2021-02-011-7/+7
|
* tests: update thin and cache checked messagesZdenek Kabelac2021-02-013-13/+11
| | | | Slightly changed messages for allocation of pool metadata.
* tests: check 16G thin pool metadata sizeZdenek Kabelac2021-02-011-0/+88
|
* lvconvert: ensure device_name is definedZdenek Kabelac2021-02-011-3/+3
|
* pvscan: enhance _count_pvid_files_from_lookup_fileZdenek Kabelac2021-02-012-32/+26
| | | | Ensure all vars are always properly defined in all paths.
* wipe: reformat message for failure caseZdenek Kabelac2021-02-011-3/+3
| | | | | Use the same error message layout to match BLKZEROUT look. Makes testing easier.
* WHATS_NEW: updatesZdenek Kabelac2021-02-011-0/+5
|
* allocation: report allocation error instead of crashZdenek Kabelac2021-02-011-3/+6
| | | | | | | | | Current allocation limitation requires to fit metadata/log LV on a single PV. This is usually not a big problem, but since thin-pool and cache-pool is using this for allocating extents for their metadata LVs it might be eventually causing errors where the remaining free spaces for large metadata size is spread over several PV.
* pvmove: automatically resolve whole stacked LVZdenek Kabelac2021-02-011-22/+35
| | | | | | | | When passing 'pvmove --name arg' try to automatically move all associated dependencies with given LV. i.e. 'pvmove --name thinpool vg vgnew' moves all thins and data and metadata LV into a new VG vgnew.
* cache: reuse code for metadata min_maxZdenek Kabelac2021-02-014-26/+17
| | | | | | | Use update_pool_metadata_min_max() which is shared with thin-pool metadata min-max updating. Gives improved messages when converting volumes to metadata.
* pool: limit pmspare to 16GiBZdenek Kabelac2021-02-011-1/+9
| | | | | | There is not much point to let allocate more then this size even when i.e. converted LV is bigger then 16GiB (%extent_size) ATM neither thin-pool nor cache-pool supports bigger metadata.
* thin: improve 16g support for thin pool metadataZdenek Kabelac2021-02-0117-55/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial support for thin-pool used slightly smaller max size 15.81GiB for thin-pool metadata. However the real limit later settled at 15.88GiB (difference is ~64MiB - 16448 4K blocks). lvm2 could not simply increase the size as it has been using hard cropping of the loaded metadata device to avoid warnings printing warning of kernel when the size was bigger (i.e. due to bigger extent_size). This patch adds the new lvm.conf configurable setting: allocation/thin_pool_crop_metadata which defaults to 0 -> no crop of metadata beyond 15.81GiB. Only user with these sizes of metadata will be affected. Without cropping lvm2 now limits metadata allocation size to 15.88GiB. Any space beyond is currently not used by thin-pool target. Even if i.e. bigger LV is used for metadata via lvconvert, or allocated bigger because of to large extent size. With cropping enabled (=1) lvm2 preserves the old limitation 15.81GiB and should allow to work in the evironement with older lvm2 tools (i.e. older distribution). Thin-pool metadata with size bigger then 15.81G is now using CROP_METADATA flag within lvm2 metadata, so older lvm2 recognizes an incompatible thin-pool and cannot activate such pool! Users should use uncropped version as it is not suffering from various issues between thin_repair results and allocated metadata LV as thin_repair limit is 15.88GiB Users should use cropping only when really needed! Patch also better handles resize of thin-pool metadata and prevents resize beoyond usable size 15.88GiB. Resize beyond 15.81GiB automatically switches pool to no-crop version. Even with existing bigger thin-pool metadata command 'lvextend -l+1 vg/pool_tmeta' does the change. Patch gives better controls 'coverted' metadata LV and reports less confusing message during conversion. Patch set also moves the code for updating min/max into pool_manip.c for better sharing with cache_pool code.
* man: update lvmthinZdenek Kabelac2021-02-011-12/+25
| | | | | Add few more notes about thin-pool repair. Fix couple typos.
* writecache: use cleaner message instead of table reloadDavid Teigland2021-01-282-3/+9
| | | | | | | | | | | | | When detaching writecache, make the first stage send a message to dm-writecache to set the cleaner option. This is instead of reloading the dm table with the cleaner option set. Reloading the table causes udev to process/probe the dm dev, which gets stalled because of the writeback activity, and the stalled udev in turn stalls the lvconvert command when it tries to sync with udev events. When getting writecache status we do not need to get open_count or read_head info, which can cause extra steps.
* lvdisplay: enhance LV status output for raid(0)Heinz Mauelshagen2021-01-276-3/+149
| | | | | | | | | | | | | | | | | | In case legs of a raid0 LV are removed, the lvdisplay command still reports 'available' though raid0 is not providing any resilience compared to the other raid levels. Also lvdisplay does not display '(partial)' in case of missing raid0 legs as oposed to the lvs command. Enhance lvdisplay to report "NOT available" for any RaidLV type in case too many legs are inaccessible hence causing data loss. I.e. any leg for raid0, all for raid1, more than 1 for raid4/5, more than 2 for raid6 and in case of completely lost mirror groups for raid10. Add test/shell/lvdisplay-raid.sh. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1872678
* WHATS_NEW: updateZdenek Kabelac2021-01-221-0/+4
|
* pvscan: ensure read buffer ends with 0Zdenek Kabelac2021-01-221-11/+8
| | | | | | | Read buffersize - 1 so the last byte is always 0. Simplify init of 0 buffers. Check snprintf result for error and report internal error as it could happen only via bad compile parameters.
* filters: avoid duplicated //Zdenek Kabelac2021-01-221-3/+3
| | | | sysfs_dir already goes with '/sys/'.
* pvscan: make ret value definedZdenek Kabelac2021-01-221-2/+1
|
* tests: check support for online vdo renameZdenek Kabelac2021-01-222-15/+90
| | | | | kvdo 6.2.3 module version supports online rename. Add cache and raid stacked renames.
* vdo: support online renameZdenek Kabelac2021-01-225-11/+70
| | | | | | | New VDO targets v6.2.3 corrects support for online rename of VDO device. If needed if can be disable via new lvm.conf setting: vdo_disabled_features = [ "online_rename" ]
* pools: fix removal of spare volumeZdenek Kabelac2021-01-221-24/+24
| | | | | | | | When removing pool LV from a stacked LV setup, it's been possible to leak _pmspare and such hidden LV then required manual user removal. Fix it by moving automatic removal into _lv_reduce().
* config: avoid printing spaces before end of lineZdenek Kabelac2021-01-223-75/+75
| | | | Empty comments were generating unnecessary space char before new line.
* pvck: fix warning and exit code for non-4k mda1 offsetDavid Teigland2021-01-191-3/+7
| | | | | Print a warning if mda1 is not 4k, 8k or 64k. Don't exit with an error for any unexpected mda1 offset.
* label_scan: fix missing free of filtered_devsDavid Teigland2021-01-181-0/+5
| | | | | missing free of devl entries on filtered_devs list in commit 2c9bb676048fda86867df165aa297f7078dffc4b
* make: generateMarian Csontos2021-01-181-0/+4
|
* devs: remove invalid path name aliasesDavid Teigland2021-01-152-35/+179
| | | | | | Make dev_cache_get() verify aliases and drop any that are invalid before returning a dev for a given name.
* integrity: fix segfault on error path when replacing imagesDavid Teigland2021-01-131-3/+7
| | | | | | | | | When adding replacement raid+integrity images (lvconvert --repair after a raid image is lost), various errors can cause the function to exit with an error. On this exit path, the function attempts to revert new images that had been created but not yet used. The cleanup failed to account for the fact that not all images needed to be reverted.
* tests: check full zeroing of thin-pool metadataZdenek Kabelac2021-01-131-0/+68
| | | | Check zeroing works on whole thin-pool metadata device.
* tests: check thin-pool corner case allocsZdenek Kabelac2021-01-131-4/+26
|
* alloc: enhance estimation of sufficient_pes_freeZdenek Kabelac2021-01-132-3/+8
| | | | | | | | | Since commit 77fdc17d70e62cab75efaaf0dad02493b948610d always include log_len size into needed extents - however now we may need sometimes more extents then necessary - mainly when multiple PVs are involved into allocation. Add logs_still_needed into calculation of sufficient_pes_free()
* lvmlockd: sscanf buffer size warningsDavid Teigland2021-01-081-2/+4
|
* post-releaseMarian Csontos2021-01-084-2/+8
|
* pre-releasev2_03_11Marian Csontos2021-01-084-6/+11
|
* lvconvert: chunksize option was missing with cachedeviceDavid Teigland2021-01-072-1/+14
|