summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvresize: add new options and defaults for fs handlingdev-dct-lvresize-5David Teigland2022-08-1024-185/+3279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Possible --fs values: checksize Only used when reducing the size, does nothing when exending. 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_remount | resize Resize the fs if needed. Mounts or unmounts the fs as required (avoids mounting/unmounting when possible.) Attempts to restore the original mount state when finished. resize_keepmount Resize the fs if needed, only if it can be done without changing the current mount state. Fail the command without resizing the fs or LV if an fs resize requires mounting or unmounting. resize_unmount Resize the fs if needed, only while unmounted. Unmount the fs if needed. Fail the command without resizing the fs or LV if an fs resize is needed that requires the the fs to be mounted. resize_fsadm Use the old method of calling fsadm to do handle the fs (deprecated). ignore Resize the LV without checking for or handling a file system. 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.
* lvresize: restructure codeDavid Teigland2022-08-1015-557/+889
| | | | | Rewrite top level resize function to prepare for adding new fs resizing.
* config: add correct unconfigured value for use_devicesfileMarian Csontos2022-08-092-2/+2
|
* spec: use --with-default-use-devices-file=1 for rhel9+Marian Csontos2022-08-091-0/+4
|
* configure: fix typoMarian Csontos2022-08-091-1/+1
|
* spec: Use libedit for newer distributionsMarian Csontos2022-08-092-0/+15
|
* shell: also output error message about max number of args hit with JSON formatPeter Rajnoha2022-08-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If using JSON format for lvm shell's output, the error message about exceeding the maximum number of arguments was not reported on output if this condition was ever hit. This is because the JSON format (as well as any other future format) requires extra formatting compared to "basic" format and so it also requires extra calls when it comes to reporting. The report needs to be added to a report group and then popped and put on output with specialized "dm_report_group_output_and_pop_all". This "output and pop" is normally executed after we execute the command in the lvm shell. When we didn't get to the command exection at all because some precondition was not met (like hitting the limit for the number of arguments for the command here), we skipped this important call and so there was no log report output. Right now, it's only this exact error message for which we need to call "output and pop" directly, all the other error messages are about initializing and setting the log report itself which we can't report obviously. Before this patch: lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 lvm> With this patch applied: lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 { "log": [ {"log_seq_num":"1", "log_type":"error", "log_context":"shell", "log_object_type":"cmd", "log_object_name":"", "log_object_id":"", "log_object_group":"", "log_object_group_id":"", "log_message":"Too many arguments, sorry.", "log_errno":"-1", "log_ret_code":"0"} ] } If there's any other error message in the future before we execute the command itself, we also need to call the "output and pop" directly.
* apply multipath_component_detection=0 to duplicate PV handlingDavid Teigland2022-07-252-3/+10
| | | | | | | multipath_component_detection=0 has always applied to the filter-based component detection. Also apply this setting to the duplicate-PV handling which also eliminates multipath components (based on duplicate PVs having the same wwid.)
* make: generateZdenek Kabelac2022-07-111-0/+12
|
* cov: restore disable_dm_devs also for error pathZdenek Kabelac2022-07-111-3/+4
| | | | | Keep the structure correct for failing error path, alhtough likely this particual var will not be used.
* cov: remove unused headersZdenek Kabelac2022-07-114-4/+0
|
* vdo: suffle code for better error path handlingZdenek Kabelac2022-07-111-14/+14
| | | | | For failing dm_ no need to report 2nd. error, but we missed to report error with 'updated==NULL'.
* vdo: enhance lvcreate validationZdenek Kabelac2022-07-113-8/+56
| | | | | | | | | | | When creating VDO pool based of % values, lvm2 is now more clever and avoids to create 'unsupportable' sizes of physical backend volumes as 16TiB is maximum size supported by VDO target (and also limited by maximum supportable slabs (8192) based on slab size. If the requested virtual size is approaching max supported size 4PiB, switch header size to 0.
* vdo: support v4 kernel target lineZdenek Kabelac2022-07-115-14/+37
| | | | Check and use new available table line v4, if kernel supports it.
* vdo: add reformating to extent size aligned virtual sizeZdenek Kabelac2022-07-111-3/+19
| | | | | | | | | Newer VDO kernel target require to have matching virtual size - this however cause incompatiblity when lvcreate is let to format VDO data device and read the usable size from vdoformat. Altough this is a kernel regression and will likely get fixed, lvm2 can actually reformat VDO device to use properly aligned VDO LV size to make this problem disappear.
* vdo: check vdo memory constrainsZdenek Kabelac2022-07-114-2/+156
| | | | | | | | | | | | | | | | | | | Add function to check for avaialble memory for particular VDO configuration - to avoid unnecessary machine swapping for configs that will not fit into memory (possibly in locked section). Formula tries to estimate RAM size machine can use also with swapping for kernel target - but still leaving some amount of usable RAM. Estimation is based on documented RAM usage of VDO target. If the /proc/meminfo would be theoretically unavailable, try to use 'sysinfo()' function, however this is giving only free RAM without the knowledge about how much RAM could be eventually swapped. TODO: move _get_memory_info() into generic lvm2 API function used by other targets with non-trivial memory requirements.
* vdo: report supported range in error pathZdenek Kabelac2022-07-111-18/+45
|
* vdo: use defines also for configuration definesZdenek Kabelac2022-07-114-47/+60
| | | | | | | | | | | | | Keep single source for most of values printed in lvm.conf (still needs some conversion) Correct max for logical threads to 60 (we may refuse some older configuration which might eventually user higher numbers - but so far let's assume no user have ever set this as it's been non-trivial and if would complicate code unnecessarily.) Accept maximum of 4PiB for virtual size of VDO LV (lvm2 will drop 'header borders to 0 for this case').
* vdo: update info about memoryZdenek Kabelac2022-07-111-3/+12
| | | | | Add more info about kernel target memory allocation associated with VDO pool usage.
* vdo: use single validatorZdenek Kabelac2022-07-112-36/+10
| | | | | Add era lenght validation into dm_vdo_validate_target_params() and reuse this validator also for _check_lv_segment().
* man: space after sizeZdenek Kabelac2022-07-1110-43/+44
| | | | | Put space between size and SI unit. Automatically make this 'space' as fixed size by Makefile sed script.
* vdo: fix conversion of vdo_slab_size_mb 2ndZdenek Kabelac2022-07-111-1/+1
| | | | | | | Patch 1b070f366ba57a6eb24df03241284732db5047e9 should have been already fixing this issue but since it the incorrect patch rebasing the change to vdo_slabSize got lost. So again now with explicit one-line patch.
* exit with error when --devicesfile name doesn't existDavid Teigland2022-07-0612-17/+46
|
* lvmdbustest: Add test for property "Get"Tony Asleson2022-06-302-1/+25
| | | | We typically use "GetAll", so add test for "Get" and check values.
* lvmdbusd: Remove try/except for mkfifoTony Asleson2022-06-301-5/+2
| | | | We should never run into this error condition when using tempfile.mkdtemp.
* lvmdusd: Remove non lvm JSON output supportTony Asleson2022-06-303-233/+20
|
* lvmdbustest: Increase number of LVsTony Asleson2022-06-301-1/+1
| | | | As storage is getting faster, we need to create more LVs to pass this test.
* lvmdbustest: Correct comment spelling/grammarTony Asleson2022-06-301-11/+11
|
* lvmdbustest: Test job remove path when job not completeTony Asleson2022-06-301-0/+11
|
* lvmdbusd: Correct grammar in lvm shell proxy commentsTony Asleson2022-06-301-2/+2
|
* lvmdbusd: Don't require "lvm> " prompt for shellTony Asleson2022-06-301-40/+43
| | | | | | | Depending on how lvm is compiled, it may not present the "lvm> " prompt when using the lvm shell. Don't require it to be present. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2090391
* lvmdbusd: Job prop. Get/GetAll exec. immediatelyTony Asleson2022-06-301-0/+18
| | | | | This allows API user the ability to check on the status of a long running job without blocking in the request queue.
* lvmdbusd: Remove the use of sub shell for lvm shellTony Asleson2022-06-301-13/+11
| | | | This reduces the number of processes and improves security.
* lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODETony Asleson2022-06-301-4/+8
| | | | Make it more logical.
* lvmdbusd: Change unit test vdo minimum sizeTony Asleson2022-06-301-5/+9
|
* lvmdbusd: Add debug output for which lvm binary is usedTony Asleson2022-06-301-0/+2
|
* lvmdbusd: re-work lvm shell mainTony Asleson2022-06-301-18/+28
| | | | | Add an optional single argument "bisect" to use with git bisect for automation. Normal case is no arguments when running stand-alone.
* lvmdbusd: Simplify child process envTony Asleson2022-06-301-1/+2
| | | | | We don't need to duplicate the entire env from the parent, supply only what is needed.
* lvmdbusd: Correct conditional for lvm child process runningTony Asleson2022-06-301-1/+1
| | | | | Poll returns None when process is running, else exit value. If poll returns 0 we will fail to exit the select loop.
* pvdisplay: restore --reportformat optionDavid Teigland2022-06-241-2/+2
| | | | | | | | Fixes commit b8f4ec846 "display: ignore --reportformat" by restoring the --reportformat option to pvdisplay. Adding -C to pvdisplay turns the command into a reporting command (like pvs, vgs, lvs) in which --reportformat can be useful.
* filter-mpath: get wwids from sysfs vpd_pg83David Teigland2022-06-088-43/+454
| | | | | | | | | 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.
* tests: skip running tests for non root userZdenek Kabelac2022-06-071-0/+6
| | | | | Testing needs 'root' privileges. Only 'make run-unit-test' can work without them.
* tests: update for wrapperZdenek Kabelac2022-06-071-6/+7
| | | | | | | Update calling vdo manager since our vdo wrapper has a simple shell arg parser so it needs args without '=' Also correct using DM_DEV_DIR for 'pvcreate'
* tests: add lvm_vdo_wrapperZdenek Kabelac2022-06-072-0/+354
| | | | | | | | | | | | Introduce a replacement vdo manager wrapper for testing. When using test suite on a system without vdo manager (which has got deprecated) - we still need its functionality to prepare 'vdo volume' for testing lvm_import_vdo. Wrapper currently need 2 binaries from older 'vdo 6.2' package - to be named: oldvdoformat - format VDO metadata with older format oldvdoprepareforlvm - shift vdo metadata by 1MiB
* vdo: fix conversion of vdo_slab_size_mbZdenek Kabelac2022-06-072-12/+4
| | | | | | | | | | | | When converting VDO volume, the parameter vdo_slabSize was incorrectly copied as vdo_blockMapCacheSize, however this parameter is then no longer used for any table line creation so the wrong value was only stored in metadata. Also use just single get_kb_size_with_unit_ and remove it's duplicate functionality with get_mb_size_with_unit_. Use $VERB for vdo remove call.
* filter-mpath: handle other wwid types in blacklistDavid Teigland2022-06-061-5/+6
| | | | | | | Fixes commit 494372b4eed0c8f6040e3357939eb7511ac25745 "filter-mpath: use multipath blacklist" to handle wwids with initial type digits 1 and 2 used for t10 and eui ids. Originally recognized type 3 naa.
* devices file: fail if --devicesfile filename doesn't existDavid Teigland2022-05-272-0/+13
| | | | | | | A typo of the filename after --devicesfile should result in a command error rather than the command falling back to using no devices file at all. Exception is vgcreate|pvcreate which create a new devices file if the file name doesn't exist.
* devices file: move clean up after command is runDavid Teigland2022-05-272-2/+1
| | | | | devices_file_exit wasn't being called between lvm_shell commands, so the file lock wouldn't be released.
* post-releaseMarian Csontos2022-05-184-2/+8
|
* pre-releasev2_03_16Marian Csontos2022-05-184-6/+12
|