summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dm-integrity supportdev-dct-integrity15David Teigland2019-12-1331-56/+2128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Create a linear LV with a dm-integrity layer above it: lvcreate --type integrity --integrity String [options] Create a raid1 LV with a dm-integrity layer over each raid image: lvcreate --type raid1 --integrity y [options] Add a dm-integrity layer to an existing linear LV, or to each image of an existing raid1 LV: lvconvert --integrity y LV Remove the dm-integrity layer from a linear LV, or from the images of a raid1 LV: lvconvert --integrity n LV Integrity metadata: The --integrity String specifies if the dm-integrity metadata (checksums) should be interleaved with data blocks, or written to a separate external LV. --integrity external (default) Use integrity with metadata on a separate LV. Allows removing integrity from the LV later. --integrity y Same as integrity external. --integrity n Remove integrity (external metadata only.) --integrity internal Use integrity with metadata interleaved with data on the same LV. Only allowed with new linear LVs. Internal integrity cannot be removed from an LV. Around 1% of the LV size is used for integrity metadata. Command variations: lvcreate --type integrity -n Name -L Size VG [Uses integrity external, the default.] lvcreate --integrity y|external -n Name -L Size VG [Uses type integrity, which is implied.] lvcreate --integrity internal -n Name -L Size VG [Uses type integrity, which is implied.] lvcreate --type raid1 --integrity y -m Num -n Name -L Size VG [Uses type integrity for each raid image.] lvconvert --type integrity LV [Converts linear LV to type integrity.] lvconvert --integrity y|external LV [Converts linear LV to type integrity, or each image to type integrity in a raid1 LV.] Options: --integritymetadata LV Use the specified LV for external metadata. Allows specific device placement of metadata. Without this option, the command creates a hidden LV (with an _imeta suffix) to hold the metadata. (Not usable with raid1+integrity.) --integritysettings String set dm-integrity parameters, e.g. to use a journal instead of bitmap, --integritysettings "mode=J". Example: $ lvcreate --integrity external -n lvex -L1G vg $ lvs -a vg LV VG Attr LSize Origin lvex vg gwi-a----- 1.00g [lvex_iorig] [lvex_imeta] vg ewi-ao---- 12.00m [lvex_iorig] vg -wi-ao---- 1.00g $ lvcreate --integrity internal -n lvin -L1G vg $ lvs -a vg LV VG Attr LSize Origin lvin vg gwi-a----- 1.00g [lvin_iorig] [lvin_iorig] vg -wi-ao---- 1.00g $ lvcreate --type raid1 --integrity y -m 1 -n lver -L1G vg $ lvs -a vg LV VG Attr LSize Origin lver vg rwi-a-r--- 1.00g [lver_rimage_0] vg gwi-aor--- 1.00g [lver_rimage_0_iorig] [lver_rimage_0_imeta] vg ewi-ao---- 12.00m [lver_rimage_0_iorig] vg -wi-ao---- 1.00g [lver_rimage_1] vg gwi-aor--- 1.00g [lver_rimage_1_iorig] [lver_rimage_1_imeta] vg ewi-ao---- 12.00m [lver_rimage_1_iorig] vg -wi-ao---- 1.00g [lver_rmeta_0] vg ewi-aor--- 4.00m [lver_rmeta_1] vg ewi-aor--- 4.00m
* drop warnings about missing pvs in foreign vgsDavid Teigland2019-12-111-2/+5
| | | | | When a foreign VG is ignored, don't print warnings that it is missing PVs.
* pvck: show specific dump option valuesDavid Teigland2019-12-106-2/+17
|
* tests: improve secure testZdenek Kabelac2019-12-101-2/+4
| | | | Validate we capture core while original task sleeps.
* test: fix missing waiting on udevZdenek Kabelac2019-12-101-3/+3
| | | | | After device creation we need to wait for a cookie so it's not forgotten in the system.
* test: fail on device createZdenek Kabelac2019-12-101-1/+5
| | | | | Correct validation of prepared device and fail if the device can't be created.
* test: aux setupZdenek Kabelac2019-12-101-6/+6
| | | | Avoid endless loop if there was no 'remove' progress.
* clenaup: simpler formZdenek Kabelac2019-12-101-7/+6
|
* vg_read: use else for 3 caseZdenek Kabelac2019-12-101-9/+2
| | | | Make it visible we check for ==, >, < of same var.
* debug: enhance messagesZdenek Kabelac2019-12-101-20/+20
| | | | | Drop 'extra' stack trace where errors are already logged from function. Add some missing dots in messages.
* debug: avoid to slashes in debug messageZdenek Kabelac2019-12-101-1/+1
|
* debug: print VG name in log messages for segment errorsNikhil Kshirsagar2019-12-101-3/+3
| | | | Signed-off-by: Nikhil Kshirsagar <nkshirsa@redhat.com>
* libdm: set maj:min while creating and reloading deviceZdenek Kabelac2019-12-101-0/+6
| | | | | Add maj:min to the task structure for RELOAD - which is now handled in _flatten() and will just skip passing device name.
* libdm: support device RELOAD with maj:min and devname setZdenek Kabelac2019-12-102-4/+11
| | | | | | | | | | When devices are created - we were not giving meaning error messages when the failure happened on 'reload' part of creation. With this patch we are now able to report both name and major:minor. Enhancment is most visible with 'crypto' devices, which are using 'secure' memory erase bit.
* man pvck: describe settingsDavid Teigland2019-12-061-0/+46
|
* update option description for settingsDavid Teigland2019-12-061-1/+2
|
* pvck: deal with coverity warningsDavid Teigland2019-12-021-41/+57
|
* post-releaseMarian Csontos2019-11-304-2/+8
|
* pre-releasev2_03_07Marian Csontos2019-11-304-6/+8
|
* build: make generateMarian Csontos2019-11-301-12/+233
|
* pvck: use zalloc in more placesDavid Teigland2019-11-271-7/+3
|
* pvck: repair headers and metadataDavid Teigland2019-11-279-103/+1946
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To write a new/repaired pv_header and label_header: pvck --repairtype pv_header --file <file> <device> This uses the metadata input file to find the PV UUID, device size, and data offset. To write new/repaired metadata text and mda_header: pvck --repairtype metadata --file <file> <device> This requires a good pv_header which points to one or two metadata areas. Any metadata areas referenced by the pv_header are updated with the specified metadata and a new mda_header. "--settings mda_num=1|2" can be used to select one mda to repair. To combine all header and metadata repairs: pvck --repair --file <file> <device> It's best to use a raw metadata file as input, that was extracted from another PV in the same VG (or from another metadata area on the same PV.) pvck will also accept a metadata backup file, but that will produce metadata that is not identical to other metadata copies on other PVs and other areas. So, when using a backup file, consider using it to update metadata on all PVs/areas. To get a raw metadata file to use for the repair, see pvck --dump metadata|metadata_search. List all instances of metadata from the metadata area: pvck --dump metadata_search <device> Save one instance of metadata at the given offset to the specified file (this file can be used for repair): pvck --dump metadata_search --file <file> --settings "metadata_offset=<off>" <device>
* pvck: dump functions cleanup args and return valsDavid Teigland2019-11-271-32/+36
|
* pvck: dump show most recent metadataDavid Teigland2019-11-271-1/+23
|
* pvck: allow disk locations to be specifiedDavid Teigland2019-11-273-86/+134
| | | | | | | | | | | | using --settings: mda_offset=<offset> mda_size=<size> can be used in place of the offset/size that normally come from headers. metadata_offset=<offset> prints/saves one instance of metadata text at the given offset, in metadata_all or metadata_search.
* pvck: move some arg processingDavid Teigland2019-11-271-66/+37
|
* scan: add simple scan to find a pvidDavid Teigland2019-11-272-0/+72
|
* metadata: add vg_from_config_treeDavid Teigland2019-11-275-22/+42
| | | | | Add cmd/fmt args to import functions so that they can be used without the fid arg which.
* Revert "cov: use zalloc"David Teigland2019-11-271-3/+6
| | | | | | This reverts commit 9af1d63b4d96facb0aa055a44c2f61eac01e13f2. fixes folded into subsequent pvck commit
* Revert "pvck: check result of dev_get_size"David Teigland2019-11-271-2/+1
| | | | | | This reverts commit 1f4968289c9c0e2a1e850317ef173df11938b7f3. fixes folded into subsequent pvck commit
* Revert "cov: fix mem leaking buffer"David Teigland2019-11-271-22/+14
| | | | | | This reverts commit d67ce9e140b5691a3f75a69d6e735eec30603670. fixes folded into subsequent pvck commit
* Revert "cov: avoid passing NULL to strstr function"David Teigland2019-11-271-5/+5
| | | | | | This reverts commit 0bad3977df40a70c68778ff0514d0ca712fee402. fixes folded into subsequent pvck commit
* Revert "cov: check for retvalue"David Teigland2019-11-271-4/+1
| | | | | | This reverts commit 153e55c20e9a3810a1862314a6465179e1b53931. fixes folded into subsequent pvck commit
* scanning: use bool type for _scan_text_mismatchDavid Teigland2019-11-271-13/+7
|
* tests hints: update check for io countDavid Teigland2019-11-261-4/+6
| | | | | | Running a reporting command on a VG now includes one additional read to check the mda_header for any change to the vg between scan and lock.
* Revert "lvs: disable scanning optimization"David Teigland2019-11-261-1/+1
| | | | | | | | This reverts commit 7474440d3b540d20eb4f997efeb31b881cc6ac8e. lvs can use the scanning optimization again since it has been changed in: "scanning: optimize by checking text offset and checksum"
* scanning: optimize by checking text offset and checksumDavid Teigland2019-11-267-9/+168
| | | | | | | | | | | | | | After the VG lock is taken for vg_read, reread the mda_header and compare the metadata text offset and checksum to what was seen during label scan. If it is unchanged, then the metadata has not changed since the label scan, and the metadata does not need to be reread under the lock for command processing. For commands that do not make changes (e.g. reporting), the mda_header is reread and checked on one mda to decide if the full metadata rereading can be skipped. For other commands (e.g. modifying the vg) the mda_header is reread and checked from all PVs. (These could probably just check one mda also.)
* bcache: add invalidate_bytes functionDavid Teigland2019-11-264-0/+22
|
* lvcreate: ensure striped raid region size is at least stripe sizeHeinz Mauelshagen2019-11-262-0/+8
| | | | | | | | | | | | | The kernel MD runtime requires region size to be larger than stripe size on striped raid layouts, thus the dm-raid target's constructor rejects such request. This causes e.g. an 'lvcreate --type raid10 -i3 -I4096 -R2048 -n lv vg' to fail. Avoid failing late in the kernel by enforcing region size to be larger or equal to stripe size. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1698225
* pvcreate,pvremove: fix reacquiring global lock after promptDavid Teigland2019-11-264-6/+16
| | | | | | | | | | When pvcreate/pvremove prompt the user, they first release the global lock, then acquire it again after the prompt, to avoid blocking other commands while waiting for a user response. This release/reacquire changes the locking order with respect to the hints flock (and potentially other locks). So, to avoid deadlock, use a nonblocking request when reacquiring the global lock.
* writecache: modprobe dm-writecacheDavid Teigland2019-11-261-1/+1
|
* tests: update to md dev nameDavid Teigland2019-11-261-2/+5
| | | | | | | | Restore WAIT_MD_DEV in teardown. NOTE: The name of MD device may have changed. (cherry picked from commit c2ff8876f97a5840cd9d6fcda1bec55ef6220dc3)
* tests: Find md name using lsblkdev-mcsontos-md-stop-scanMarian Csontos2019-11-262-10/+5
| | | | | After stopping MD device and rescanning the leg, it is created with different name.
* Partial revert "tests: update to md dev name"Marian Csontos2019-11-253-5/+7
| | | | | | This partially reverts commit c2ff8876f97a5840cd9d6fcda1bec55ef6220dc3. Not all MD devices are stopped. Something is missing there...
* test: Fix handling leftovers from previous testsMarian Csontos2019-11-201-1/+1
| | | | | teardown fails current PREFIX is prefix of previously failed test with leftovers in dmtable.
* lvs: disable scanning optimizationDavid Teigland2019-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scanning optimization can produce warnings from 'lvs' when run concurrently with commands modifying LVs, so disable the optimization until it can be improved. Without the scanning optimization, lvs will always read all PVs twice: 1. read metadata from all PVs, saving it in memory 2. for each VG 3. lock VG 4. reread metadata from all PVs in VG, replacing metadata saved from step 1 5. run command on VG 6. unlock VG The optimization would usually cause step 4 to be skipped, and PVs would be read only once. Running the command in step 5 using metadata that was not read under the VG lock is usually fine, except for the fact that lvs attempts to validate the metadata by comparing it to current dm state. If other commands are modifying dm state while lvs is running, lvs may see differences between metadata from step 1 and dm state checked during step 5, and print warnings. (A better fix may be to detect the concurrent change and fall back to rereading metadata in step 4 only when needed.)
* tests: add more tracing infoZdenek Kabelac2019-11-151-0/+2
|
* tests: reduce amount of written dateZdenek Kabelac2019-11-151-1/+1
| | | | Since we reduced created LV to 4M - dd also just 4M.
* revert "dmeventd: vdo plugin link lvm library"Zdenek Kabelac2019-11-151-0/+8
| | | | | | This reverts commit cbabdf2fca6131660cfb5525ed9edb3f7a41525a. and add extra comment why this code may look unused, but in runtime is necessary.
* Revert "hints: rewrite function"David Teigland2019-11-141-13/+26
| | | | This reverts commit 70fb31b5d6863248b5adfb2581b706cbb158b30e.