summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pvscan: add options listlvs listvg checkcompletedev-dct-pvscan-list-2David Teigland2020-12-165-49/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pvscan --cache <dev> . read only dev . create online file for dev pvscan --listvg <dev> . read only dev . list VG using dev pvscan --listlvs <dev> . read only dev . list VG using dev . list LVs using dev pvscan --cache --listvg [--checkcomplete] <dev> . read only dev . create online file for dev . list VG using dev . [check online files and report if VG is complete] pvscan --cache --listlvs [--checkcomplete] <dev> . read only dev . create online file for dev . list VG using dev . list LVs using dev . [check online files and report if VG is complete] . [check online files and report if LVs are complete] [--vgonline] can be used with --checkcomplete, to enable use of a vg online file. This results in only the first pvscan command to see the complete VG to report 'VG complete', and others will report 'VG finished'. This allows the caller to easily run a single activation of the VG. The list of complete LVs is meant to be passed to lvchange -aay, or the complete VG used with vgchange -aay. Example of listlvs ------------------ $ lvs -a vg -olvname,devices LV Devices lv_a /dev/loop0(0) lv_ab /dev/loop0(1),/dev/loop1(1) lv_abc /dev/loop0(3),/dev/loop1(3),/dev/loop2(1) lv_b /dev/loop1(0) lv_c /dev/loop2(0) $ pvscan --cache --listlvs --checkcomplete /dev/loop0 pvscan[35680] PV /dev/loop0 online, VG vg incomplete (need 2). VG vg incomplete LV vg/lv_a complete LV vg/lv_ab incomplete LV vg/lv_abc incomplete $ pvscan --cache --listlvs --checkcomplete /dev/loop1 pvscan[35681] PV /dev/loop1 online, VG vg incomplete (need 1). VG vg incomplete LV vg/lv_b complete LV vg/lv_ab complete LV vg/lv_abc incomplete $ pvscan --cache --listlvs --checkcomplete /dev/loop2 pvscan[35682] PV /dev/loop2 online, VG vg is complete. VG vg complete LV vg/lv_c complete LV vg/lv_abc complete Example of listvg ----------------- $ pvscan --cache --listvg --checkcomplete /dev/loop0 pvscan[35684] PV /dev/loop0 online, VG vg incomplete (need 2). VG vg incomplete $ pvscan --cache --listvg --checkcomplete /dev/loop1 pvscan[35685] PV /dev/loop1 online, VG vg incomplete (need 1). VG vg incomplete $ pvscan --cache --listvg --checkcomplete /dev/loop2 pvscan[35686] PV /dev/loop2 online, VG vg is complete. VG vg complete
* man lvmcache: add writecache cleaner infoDavid Teigland2020-12-021-0/+10
|
* man: update writing style of the lvmvdo man pageMarek Suchánek2020-12-021-103/+102
| | | | | | | This patch improves the clarity, writing style, and language of the lvmvdo(7) man page. See https://bugzilla.redhat.com/show_bug.cgi?id=1855804.
* build: make generateMarian Csontos2020-11-262-5/+5
|
* udev rule: remove lvmetad commentsDavid Teigland2020-11-251-12/+3
|
* lvm.conf: remove reference to locking_typeDavid Teigland2020-11-171-2/+1
|
* man: vgsplit source and destination VGsDavid Teigland2020-11-171-3/+4
| | | | make clearer which is source and which is destination
* lvchange: fix error for foreign vg activationDavid Teigland2020-11-171-1/+1
| | | | was using ECMD_FAILED instead of 0.
* tests: integrity mismatch checks for all raid levelsDavid Teigland2020-11-112-21/+41
| | | | | | | | | | | | | | Verify that corruption is corrected for raid levels other than raid1. For other raid levels, attempt to corrupt the given file pattern on each underlying device, since we don't know which device contains the file being corrupted. This ensures that corruption is actually be introduced when testing the other raid levels. Verify that corruption is being corrected by checking the integritymismatches count is non-zero for the raid LV, which includes the total from all images (since we don't know which image will have the corruption.)
* integrity: display total mismatches at raid LV levelDavid Teigland2020-11-113-0/+45
| | | | | | | | | | | | | | | | Each integrity image in a raid LV reports its own number of integrity mismatches, e.g. lvs -o integritymismatches vg/lv_rimage_0 lvs -o integritymismatches vg/lv_rimage_1 In addition to this, allow the total number of integrity mismatches from all images to be displayed for the raid LV. lvs -o integritymismatches vg/lv shows the number of mismatches from both lv_rimage_0 and lv_rimage_1.
* tests: update integrity testsDavid Teigland2020-11-102-217/+275
| | | | | | simplified the method of corrupting data, the old method was not working reliably. moved syncation tests to a different file
* writecache: supported in dm-writecache version 3David Teigland2020-11-091-1/+1
| | | | not version 2
* man: update vdoZdenek Kabelac2020-11-031-87/+88
| | | | | | | | | | | Enhance VDO man page with description of memory usage and space requirements chapter. Remove some unneeded blank lines in man page. Use more precise terminology. Correct examples since cpool and vpool are protected names.
* pvck: fix previous commitDavid Teigland2020-10-281-2/+2
| | | | | line to setup bcache was misplaced in commit 5a94126e7a28
* Revert "tests: revert lvm shell use in pvck-dump"David Teigland2020-10-281-1/+1
| | | | | | This reverts commit 05d23b2dd80919ebd2239cfd7f8e08d5de9ebace. this required enabling editline in configure
* tests: revert lvm shell use in pvck-dumpDavid Teigland2020-10-271-1/+1
| | | | doesn't work on my machine
* pvck: fix dev filteringDavid Teigland2020-10-271-10/+21
| | | | | | | filters needing io weren't being run because bcache wasn't set up. Read the first 4k of the device before doing filtering or reading ondisk structs to reduce reads.
* pvck: handle first mda at non-4096 offsetDavid Teigland2020-10-271-5/+6
| | | | | | | | | It's possible for a machine with a non-4k page size to create a PV with an mda_header at an offset other than 4k. Fix pvck --dump to work with these other mda offsets. pvck --repair will write a new first mda at 4096 but lvm with other page sizes will work with this.
* writecache: disallow partial or degraded activationDavid Teigland2020-10-262-0/+37
| | | | when either main or fast lvs are incomplete
* lvchange: allow syncaction check with integrityDavid Teigland2020-10-262-13/+146
| | | | syncaction check will detect and correct integrity checksum mismatches.
* pvcreate: clean up opening and filtering of argsDavid Teigland2020-10-264-39/+120
| | | | | | | | | | | | | | | | | | | | | | | | | The args for pvcreate/pvremove (and vgcreate/vgextend when applicable) were not efficiently opened, scanned, and filtered. This change reorganizes the opening and filtering in the following steps: - label scan and filter all devs . open ro . standard label scan at the start of command - label scan and filter dev args . open ro . uses full md component check . typically the first scan and filter of pvcreate devs - close and reopen dev args . open rw and excl - repeat label scan and filter dev args . using reopened rw excl fd - wipe and write new headers . using reopened rw excl fd
* gcc: cleanup warns from older gccZdenek Kabelac2020-10-262-3/+3
|
* tests: minor updateZdenek Kabelac2020-10-261-2/+2
|
* fsadm: better check for getsize64 supportZdenek Kabelac2020-10-261-8/+5
| | | | | | | | | | Older blockdev tool return failure error code with --help, and since now the tool abort on command failure, lets detect missing --getsize64 support directly by running command and check if it returns something usable. It's likely very hard to have the system with such old blockdev tool and newer lvm2 compiled.
* WHATS_NEW: updateZdenek Kabelac2020-10-241-0/+2
|
* man: regenerateZdenek Kabelac2020-10-2443-129/+86
|
* man: more precise UNITZdenek Kabelac2020-10-241-3/+2
| | | | | | | | Since 'kilobytes' could be seen in 2 way - SI as '1000', while all programmers sees it as '1024' - switch to commonly acceptted KiB, MiB.... Resolves RHBZ 1496255.
* lv_manip: add space into messageZdenek Kabelac2020-10-241-1/+1
| | | | Just add space between %s(.
* tests: fsadm test continue after fs repairZdenek Kabelac2020-10-241-1/+26
| | | | | | Test case where filesystem has been corrected via fsck. In such case fsck returns '1' as success and should be handled in a same way as '0' since fs is correct.
* fsadm: enhance error handlingZdenek Kabelac2020-10-241-19/+28
| | | | | | | Set more secure bash failure mode for pipilines. Avoid using unset variables. Enhnace error reporting for failing command. Avoid using error via 'case..esac || error'.
* fsadm: handle fsck return 1 for corrected fsZdenek Kabelac2020-10-241-7/+18
|
* fsadm: use NULLZdenek Kabelac2020-10-241-10/+10
| | | | Use consistently $NULL as in other places.
* get dev size when setting pv deviceDavid Teigland2020-10-221-2/+6
| | | | | | In some cases the dev size may not have been read yet in set_pv_devices(). In this case get the dev size before comparing the dev size with the pv size.
* pvscan: rework to improve PVs without metadataDavid Teigland2020-10-224-618/+733
| | | | | | | | | | | | | | | Restructure the pvscan code, and add new temporary files that list pvids in a VG, used for processing PVs that have no metadata. The new temp files, in /run/lvm/pvs_lookup/<vgname>, allow a proper pvscan --cache to be done on PVs that have no metadata. pvscan --cache <dev> is only supposed to read <dev>, but when <dev> has no metadata, this had not been possible. The command had to fall back to scanning all devices to read all VG metadata to get the list of all PVIDs needed to check for a complete VG. Now, the temp file can be used in place of reading metadata from all PVs on the system.
* add label_scan_devs_cachedDavid Teigland2020-10-212-0/+16
| | | | | | label_scan_devs without invalidating data first for cases where the caller wants to use any bcache data they have already read.
* add label_read_pvidDavid Teigland2020-10-212-0/+49
| | | | | | | To read the lvm headers and set dev->pvid if the device is a PV. Difference from label_scan_ functions is this does not read any vg metadata or add any info to lvmcache.
* lvmcache: rename label_read label_scan_devDavid Teigland2020-10-214-6/+5
| | | | for consistent naming with other similar functions
* lvmcache: add lvmcache_get_dev_mdaDavid Teigland2020-10-212-0/+17
| | | | for future patch
* scanning: improve filtering controlDavid Teigland2020-10-211-48/+70
| | | | | | | | | | | | | | | | | | | | | Filtering in label_scan was controlled indirectly by the fact that bcache was not yet set up when label_scan first ran. The result is that filters that needed data would not run and would return -EAGAIN, which would result in the dev flag FILTER_AFTER_SCAN being set. After the dev header was read for checking the label, filters would be rechecked because of FILTER_AFTER_SCAN. All filters would be checked this time because bcache was now set up, and the filters needing data would largely use data already scanned for reading the label. This design worked but is hard to adjust for future cases where bcache is already set up. Replace this method (based on setting up bcache, or not) with a new cmd flag filter_nodata_only. When this flag is set filters that need data will not run. This allows the same label_scan behavior when bcache has been set up. There are no expected changes in behavior.
* filters: nodata optionDavid Teigland2020-10-215-0/+16
| | | | | When filter_nodata_only is set, a filter that uses data is skipped.
* filters: allow filter wipe for one deviceDavid Teigland2020-10-213-6/+15
| | | | as passes_filter already does
* tests: writecache-misc disable with lvmlockdDavid Teigland2020-10-211-1/+2
| | | | in a shared vg pvmove requires a named lv
* tests: check dmevent with bigger reserved_stackZdenek Kabelac2020-10-201-3/+6
| | | | | Check dmeventd remains working when reserved_stack is above 300KiB.
* memlock: allocate at most halve of rlimit stackZdenek Kabelac2020-10-201-4/+7
| | | | | | Touch of stack allocation validated given size with rlimit and if the reserved_stack was above rlimit, its been completely ignored - now we will always touch stack upto rlimit/2 size.
* lvmcmdlib: lvm2_init_threadedZdenek Kabelac2020-10-207-10/+28
| | | | | | | | | | | | | cmd context has 'threaded' value that used be set by clvmd - and allowed proper memory locking management. Reuse same bit for dmeventd. Since dmeventd is using 300KiB stack per thread, we will ignore any user settings for allocation/reserved_stack until some better solution is find. This avoids crashing of dmevend when user changes this value and because in most cases lvm2 should work ok with 64K stack size, this change should not cause any problems.
* libdm: relocate code for sending messagesZdenek Kabelac2020-10-191-11/+11
| | | | | | To be able to send messages for recently resumed devices, move code into inner loop. Matching commit c1a6b10d09aae6179e4f08c7d8c03d5e3068ad94.
* cov: split check for type assignmentZdenek Kabelac2020-10-191-4/+5
| | | | | | | Check that type is always defined, if not make it explicit internal error (although logged as debug - so catched only with proper lvm.conf setting). This ensures later type being NULL can't be dereferenced with coredump.
* dm: remove created devices on error pathZdenek Kabelac2020-10-193-106/+51
| | | | | | | | DM tree keeps track of created device while preloading a device tree. When fail occures during such preload, it will now try to remove all created and preloaded device. This makes it easier to maintain stacking of device, since we do not need to check in-depth for existance of all possible created devices during the failure.
* debug: shorten error messageZdenek Kabelac2020-10-191-18/+8
| | | | Just check for sigint during log_error().
* libdm: validate thin-pool before sending messagesZdenek Kabelac2020-10-191-0/+9
| | | | | Alhtough lvm2 does validation on its side, ensure DM code is not sending messages to failed thin pool.