1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

28 Commits

Author SHA1 Message Date
Zdenek Kabelac
f5781144ab vdo: typo fix
Argh - lastmin mods...
2023-09-14 10:01:43 +02:00
Zdenek Kabelac
f968833570 vdo: avoid using of valuesonly
To retain backward compatibility with some older version of lvm
avoid using --valuesonly option with lvmconfig.
2023-09-14 01:44:27 +02:00
Zdenek Kabelac
e1cfc075c2 vdo: better support for devicesfile
Instead of relying on 'pvs' output - check directly system
configuation and use lvmdevice accrording to use_devicesfile setting.

Also drop use of --fs ignore for filesystem extension for better
backward compatibility with older lvm version.

Shuffle code a bit so the '--no-snapshot' path does not execute
a few unnecessary commands.
2023-09-13 13:38:15 +02:00
Zdenek Kabelac
d9cebeaf34 vdo: lvm_import_vdo enhancements
Work also with devices that may have ':' inside their generated
/dev/disk/by-id

Ensure there is no race with systems' auto activation while using
the snapshot for conversion.

Update system's vdoconf.yml after the use of snapshot for conversion.

Skip unnecesary prompt for 'convert' while using snapshot and query only
for final snaphot merge.

Prohibit conversion for a device with the PV header.

Enhance 'trap' protection for more signals.

Improve clean() recovery path.

Replace bash 'test' command with [].

Correct some output message to print $TOOL.

Support also options without '-' in the middle i.e. --nosnapshot.

For shellcheck predefine all variables extracted from vdoconf.yml.
2023-09-12 14:30:48 +02:00
Zdenek Kabelac
c693aa8dac vdo: enhance import script for devices file
When the import is used on a system, that uses devices file,
the final activation was impossible for the case the converted
volume was not present in devices file.
Currently add volume automatically in such case.

Also add some more debugging output from the script.

TODO: Consider enhnacing lvconvert with extending devices file.
2023-09-03 22:03:33 +02:00
Zdenek Kabelac
b81835b5ca vdo: lvm_import_vdo uses devname from vdoconf.yml
VDO is using specific path for some device paths.
i.e. for /dev/sda it could be /dev/disk/by-id/scsi-xxxxx.

This used to be not a problem before lvm2 started to use snapshot,
but now it needs to replace matching device path.
So switch to the path naming used in vdoconf.yml file.
2023-09-03 16:01:07 +02:00
Zdenek Kabelac
1c2782354c vdo: use long --verbose
vdo tools needs long option.
2023-07-17 16:22:29 +02:00
Zdenek Kabelac
8a07f57ba4 lvm_import_vdo: spelling fixes 2023-06-29 13:10:42 +02:00
Zdenek Kabelac
8b75bbe47d vdo: lvm_import_vdo correct parsing output
Output from vdo manager may actually indent output with spaces,
so trim leading and ending space.

Also add support for verbosity flag for vdo conversion tool.
2023-06-29 13:10:42 +02:00
Zdenek Kabelac
6ff65e6755 vdo: check_point_frequence is unused option
This vdo parameter existed in the early stage of integration of vdo into lvm2,
but later it's been removed from vdoformat tool - so actually if
there would be any non-zero value it would cause error on lvcreate.
Option was not stored on disk in lvm2 metadata.

Remove this vdo parameter from lvm2 sources.

(Although this vdo parameter will be still accepted on cmdline through
 --vdosettings option, but it will be ignored.)
2023-06-29 13:10:42 +02:00
Zdenek Kabelac
657dde6208 lvm_import_vdo: correct the converted virtual size
Ensure the volume after conversion has the properly aligned size to the
volume group extent size. This would be visible when using virtual size,
that cannot be divided by extent size.

Before the user had to manually adjust the size after conversion to get
access to all data stored on VDO volume.
2023-06-23 18:05:03 +02:00
Zdenek Kabelac
be6c34212b vdo: enhance lvm_vdo_import
Add support for usage of 'dm-snapshot' for doing whole device conversion
in a snapshot which could be merged once the whole conversion has been
made.
This helps with cases where there would be any unexpected failure in the
middle of conversion process and user can continue using original
device until problem in conversion is fixed.

Import tool now uses 'truncate' tool to create a small backend file (20M) for loop device
to hold COW exception store.

Option  --vdo-config has been added to allow specifing location of vdo
configuration file.

Option --no-snapshot allows to use import tool without creation of
snapshot, however recovery after finished VDO conversion and unfinished
lvm2 conversion is then very difficult.

Option --uuid-prefix allow to specify DM UUID prefix for snapshot
device.

Use read with -r.
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
773bc01377 tests: cleanup some shellcheck warns
Reduce shellcheck warnings about missing {} for possible array
dereference.

Make sure we are not loosing error code when assigning local vars
and explicitely ignore 'errors' from standalone lines when needed.

Add some missing quotes.

Use $() instead of ancient ``

Avoid writing some temporary data into /tmp - test need to store
files within its own 'testdir' - so it can be properly discarded.
2023-02-10 17:50:27 +01:00
Zdenek Kabelac
d2667bc25b vdo: fix conversion of vdo_slab_size_mb 2nd
Patch 1b070f366b 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.
2022-07-11 01:18:24 +02:00
Zdenek Kabelac
1b070f366b vdo: fix conversion of vdo_slab_size_mb
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.
2022-06-07 17:14:08 +02:00
Andrew Walsh
522561e64b vdo: ensure VDO config is removed
Make sure to remove the VDO config after conversion
of LVM-backed VDO.

Addresses point 3 in rhbz#1987024#c5
2021-12-20 16:13:28 +01:00
Zdenek Kabelac
bb6fd1a15f shellcheck: warning enhancements 2021-09-21 21:03:47 +02:00
Zdenek Kabelac
4c0354fe0f cleanup: better wording
Follow-up advice of native speaker.
2021-09-20 15:41:14 +02:00
Zdenek Kabelac
a0bbdfba7f cleanup: typo fix 2021-09-17 22:42:41 +02:00
Zdenek Kabelac
3817392d87 lvm_import_vdo: --dry-run automatically verbose
Dry-run is way more usable when it's verbose.
2021-09-17 16:49:17 +02:00
Zdenek Kabelac
3b24c0fe4e vdo: prompt with no return failure
Exit 1  (failure) when prompt for conversion is answered as 'No'.
2021-09-13 12:34:41 +02:00
Zdenek Kabelac
9db4ddabc1 vdo: lvm_import_vdo script needs to continue when vgname does not exist
When the script cannot find vgname - it needs to continue to run.
2021-09-13 12:34:41 +02:00
Zdenek Kabelac
89595a3665 vdo: more lvm_import_vdo fixes
Do not call 'dmsetup info' for non-dm devices.

Better handling for VGNAME and LVNAME - so when convering LV as
backend device automatically recognize it and reuse LV name for VDOLV.

Add prompt for final confirmation before actual conversion is started
(once confirmed, lvm2 commands no longer prompts to avoid leaving
conversion in the middle of its process.)
2021-09-06 15:19:51 +02:00
Zdenek Kabelac
3287d37f44 vdo: better message for missing device
Show readable message when passed device cannot be accessed.
And use STAT shell var wrapper to call 'stat' command.
2021-09-06 15:19:51 +02:00
Zdenek Kabelac
8d5b7de54f vdo: lvm_import_vdo fix max_discard size
Use correct 4K units in lvm2 for max_discard VDO option.
2021-09-06 15:19:51 +02:00
Zdenek Kabelac
1ae157a0f6 vdo: fixes
Better identify VDO device with major:minor.
Handle different LV name from originally converted origin LV.
Improve --dry-run handling.
2021-08-31 22:05:47 +02:00
Zdenek Kabelac
12ba43ccd0 vdo: rename vdoimport to lvm_import_vdo
Missed bits in previous rename commits.
2021-08-26 19:10:28 +02:00
Marian Csontos
bbbd4fed69 vdo: Rename vdoimport to lvm_import_vdo. 2021-08-26 17:13:59 +02:00