1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-13 00:58:47 +03:00

17639 Commits

Author SHA1 Message Date
Zdenek Kabelac
1c6992d37e vdo: read new sysfs path
New versions of kvdo module exposes statistics at new location:
/sys/block/dm-XXX/vdo/statistics/...

Enhance lvm2 to access this location first.
Also if the statistic info is missing - make it 'debug' level info,
so it is not failing 'lvs' command.

(cherry picked from commit e6f735d411e5911de186a610932c9bb9638275eb)

Conflicts:
	WHATS_NEW
2021-09-14 16:04:58 +02:00
Zdenek Kabelac
70467e905c vdo: fix conversion of large virtual sizes
Properly accept virtual sizes above 2TiB.

(cherry picked from commit 4afe872fd6c43fcfcd519c862574d010cdbda653)
2021-09-09 15:12:49 +02:00
Zdenek Kabelac
6621116b61 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.)

(cherry picked from commit 89595a366554191c3df1a18e1f82b79c450a21ad)
2021-09-09 15:11:25 +02:00
Zdenek Kabelac
deb36d236e 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.

(cherry picked from commit 3287d37f440ca272b52f900fc60ee5effcf73697)

Conflicts:
	scripts/lvm_import_vdo.sh
2021-09-09 15:11:13 +02:00
Zdenek Kabelac
60eb37394b vdo: lvm_import_vdo fix max_discard size
Use correct 4K units in lvm2 for max_discard VDO option.

(cherry picked from commit 8d5b7de54f21ce5e34d533599f9d5a42f2977cd5)
2021-09-09 15:10:12 +02:00
Zdenek Kabelac
5d0756fc33 vdo: fixes
Better identify VDO device with major:minor.
Handle different LV name from originally converted origin LV.
Improve --dry-run handling.

(cherry picked from commit 1ae157a0f67e984ef3037d19d62b84a3b0201c84)
2021-09-09 15:09:57 +02:00
Marian Csontos
527e5522b9 vdo: Rename vdoimport to lvm_import_vdo.
(cherry picked from commit bbbd4fed69d88e67678994cb611d082d27bb774b)

Conflicts:
	WHATS_NEW
2021-08-26 18:29:28 +02:00
Zdenek Kabelac
323257dfff tests: extend vgmerge testing
(cherry picked from commit 8ebcbe9ace6e5c88a35cf62cd04b853ca7551a2b)
2021-08-03 11:36:19 +02:00
Zdenek Kabelac
84f8b4325c vgmerge: support option --poolmetadataspare
(cherry picked from commit 4b856476e96777842ea6c9b42654c369a6b22db4)
2021-08-03 11:36:07 +02:00
Zdenek Kabelac
5b388f30fd vgmerge: remove one of merge pmspare LVs
When merging 2 VG, where both of them have pmspare volume,
select the bigger one and remove the other.

(cherry picked from commit 9cbc9e8296752df35626a9b50de1cb551ff5e99e)
2021-08-03 11:35:50 +02:00
Zdenek Kabelac
a48e248e17 test
(cherry picked from commit b70c341c9e9526cc21f590af73ccce2369755736)
2021-07-22 13:54:14 +02:00
Zdenek Kabelac
03bbbd14f8 vgsplit: add support for option --poolmetadataspare
When splitting VG with thin/cache pool volume, handle pmspare during
such split and allocate new pmspare in new VG or extend existing pmspare
there and eventually drop  pmspare in original VG if is no longer needed
there.

(cherry picked from commit 2132fdc11f7bc285638765e001bef6a3e595b286)

Conflicts:
	WHATS_NEW
2021-07-22 13:54:12 +02:00
Zdenek Kabelac
bec8649487 vgremove: remove forgotten pmspare
As pmspare is an invisible LV it's not getting automatically removed
since vgremove removes only visible LVs and it depending LVs.
If there was no other thin/cache pool volume, such pmspare stayed
undeleted and caused command failure.

So handle explicitelly such forgotten pmspare and remove it.

(cherry picked from commit 5042463c5083cc71546297344058bd0fa523aa5c)
2021-07-22 13:53:50 +02:00
Zdenek Kabelac
f29ce593ec thin: fix component detection of external origin
When check active componet of thinLV with external origin,
we need to check if the external origin isn't already active.
For this however we need to use layered check for -real device.

(cherry picked from commit d38fdb25e4debc035f1e4585432c2627460d5e50)

Conflicts:
	WHATS_NEW
2021-07-22 13:53:47 +02:00
Marian Csontos
154592db7e make: generate
(cherry picked from commit 5f6da5acec65704a1f40dd073c59badba0e28f72)
2021-07-13 17:06:21 +02:00
Zdenek Kabelac
6643baa3cc man: vdoimport page
(cherry picked from commit 70c32d1e74b92f6055bcb688ed0e3bc8630f5489)
2021-07-13 17:06:21 +02:00
Zdenek Kabelac
864babf4c7 vdo: add vdoimport support
Add tool 'vdoimport' to support easy conversion of an existing VDO manager managed
VDO volumes into lvm2 managed VDO LV.

When physical converted volume is already a logical volume, conversion
happens with the VG itself, just with validation for extent_size, so
the virtually sized logical VDO volume size can be expressed in extents.

Example of basic simple usage:

vdoimport --name vg/vdolv  /dev/mapper/vdophysicalvolume

(cherry picked from commit ed48cb26a31e8e5a12d82d96d8bec6bfc4d5b218)

Conflicts:
	WHATS_NEW
2021-07-13 17:06:15 +02:00
Zdenek Kabelac
65e0829f34 vdo: support vdo_pool_header_size
Add profilable configurable setting for vdo pool header size, that is
used as 'extra' empty space at the front and end of vdo-pool device
to avoid having a disk in the system the may have same data is real
vdo LV.

For some conversion cases however we may need to allow using '0' header size.

TODO: in this case we may eventually avoid adding 'linear' mapping layer
in future - but this requires further modification over lvm code base.

(cherry picked from commit 2c6a2b6e86b57aeb96e93618193426ee129b00a6)

Conflicts:
	tools/lvconvert.c
2021-07-13 11:45:15 +02:00
Zdenek Kabelac
a021aba6ef vdo: rename variable vdo_pool_zero
Match rest of code.

(cherry picked from commit 5fcbc3bd7d3473f14e556508fff1b381431c59f0)

Conflicts:
	tools/lvconvert.c
2021-07-13 11:42:30 +02:00
Zdenek Kabelac
9281d69a74 lvconvert: fix vdo virtual size when specified
Correctly use virtual size specified by:
lvconvert --type vdo-pool --virtualsize

(cherry picked from commit 6e773bb196d7e45fbecf0619f8993e6cf4534fa2)
2021-07-13 11:39:15 +02:00
David Teigland
013303da9d device_id: handle scsi_debug wwid
Ignore the wwid value reported by scsi_debug devices
that begin "t10.Linux   scsi_debug".  The devname
will be used as the device id.

(cherry picked from commit 1139a05939f85bd86a756b451a8f194bc7a72a2c)
2021-07-13 11:36:49 +02:00
David Teigland
de8d6238df lvmdevices: add deviceidtype option
When adding a device to the devices file with --adddev, lvm
by default chooses the best device ID type for the new device.
The new --deviceidtype option allows the user to override the
built in preference.  This is useful if there's a problem with
the default type, or if a secondary type is preferrable.

If the specified deviceidtype does not produce a device ID,
then lvm falls back to the preference it would otherwise use.

(cherry picked from commit 440d6ae79fb4df92c7992d3c1689ba4f2d242d6a)
2021-06-21 16:05:52 +02:00
David Teigland
e9227b4bcc devices: don't use deleted loop backing file for device id
check for "(deleted)" in the backing_file string and
fall back to devname for id.

$ cat /sys/block/loop0/loop/backing_file
/root/looptmp (deleted)

(cherry picked from commit ca930bd936de2e7d4a83fa64add800baf6cfd116)
2021-06-21 16:04:51 +02:00
David Teigland
118ba71613 lvconvert: allow writecache with other thinpool command syntax
"lvconvert --thinpool LV" should allow LV to have a writecache,
but there was an extra type check preventing it.

(cherry picked from commit c35f7722d588009edad22d59c68c82150bb5c216)
2021-06-21 16:03:48 +02:00
David Teigland
f15472d5aa writecache: don't pvmove device used by writecache
The existing check didn't cover the unusual case where the
cachevol exists on the same device as the origin LV.

(cherry picked from commit e7f107c24666c8577f30e530b74f1ce0347e459b)
2021-06-15 16:06:21 +02:00
David Teigland
4d5f3207fd writecache: fix lv_on_pmem
dev_is_pmem on pv->dev requires a pv segment or it could segfault.

(cherry picked from commit 247f69f9aafe731ef85268da1e6ce817295b265d)
2021-06-15 16:06:12 +02:00
David Teigland
5d195b2041 enable command syntax for thin and writecache
converting an LV with a writecache to thin pool data in
addition to previous attaching writecache to thin pool data

(cherry picked from commit a65f8e0a62b9ab3c2fc909a63abfa0e933619a8c)
2021-06-15 15:48:59 +02:00
David Teigland
4dfef72f35 lvremove: fix removing thin pool with writecache on data
(cherry picked from commit 4a746f7ffcc8e61c9cb5ce9f9e8a061d1ef6b28e)
2021-06-15 15:48:18 +02:00
Zdenek Kabelac
1f840e8387 vdo: fix preload of kvdo
Commit 5bf1dba9eb8a8b77410e386e59dadeb27801b14e broke load of kvdo
kernel module - correct it by loading kvdo instead of trying dm-vdo.

(cherry picked from commit b725b5ea6ecfeef428fd7ffcd6855a38378d761b)

Conflicts:
	WHATS_NEW
2021-06-01 13:41:17 +02:00
Marian Csontos
742fa2ff96 lvm2: test: skip-problematic-tests 2021-05-19 09:54:54 +02:00
Marian Csontos
a0abac9965 lvm2: set default preferred_names 2021-05-19 09:54:54 +02:00
Marian Csontos
3c93b7585f lvm2-rhel8 2021-05-19 09:54:54 +02:00
Marian Csontos
01b05cf51d pre-release v2_03_12 2021-05-07 23:09:09 +02:00
Marian Csontos
64719861ec make: generate 2021-05-07 17:44:43 +02:00
David Teigland
00f603de2c tests: add lvextend-caches-on-thindata
to test lvextend of thin pool data while it has
cache|writecache attached
2021-05-06 16:23:26 -05:00
David Teigland
6b00c8c910 writecache: allow attaching to thin pool data 2021-05-06 16:23:03 -05:00
David Teigland
92fcfc59b2 tests: new lvextend-caches
to test lvextend of LVs with attached cache|writecache
2021-05-06 14:43:10 -05:00
David Teigland
318bb3a06b blkid: simplify fs block size check
Only the LV path name is needed for blkid query,
the step of getting a dev struct is not needed.
2021-05-05 16:15:10 -05:00
David Teigland
71933d3496 devices file: recommend removing filter
When the devices file is enabled and the filter is set,
recommand that the user remove the filter from lvm.conf
since it's ignored.
2021-05-05 13:59:42 -05:00
David Teigland
2419345b9d pvremove: use consistent error message
When the device is not a PV print
  "No PV found on device ..."

instead of
  "Failed to read lvm info for ... PVID ."

an earlier check had been added with a different
message for the same condition.
2021-05-04 13:08:02 -05:00
David Teigland
4dc5d4ac7e label_read_pvid: separate error and no-pvid
error reading dev and no pvid on dev were both
returning 0.  make it easier for callers to
know which, if they care.

return 1 if the device could be read, regardless
of whether a pvid was found or not.
set has_pvid=1 if a pvid is found and 0 if no
pvid is found.
2021-04-23 17:37:08 -05:00
David Teigland
fcbed26393 Revert "cov: check label_read_pvid return value"
This reverts commit bf461b99c6d26e550835b77eaffe2204cbc9bed3.

label_read_pvid returns 0 for non-PVs and these callers want
to handle non-PVs.
2021-04-23 17:12:24 -05:00
Zdenek Kabelac
9cdd4dcca7 make: generate 2021-04-23 23:02:58 +02:00
Zdenek Kabelac
64a8505b96 tests: use should for expected state
While we heavily try to spot arrays that are not yet in-sync,
some kernels tends to block our lvm2 command in kernel,
while we resume these smaller raid arrays even for 5 seconds.

But since the result is not really wrong - report these
check failures only as TEST WARNING.
2021-04-23 23:00:55 +02:00
Zdenek Kabelac
05eb90db68 cleanup: indent 2021-04-23 23:00:55 +02:00
Zdenek Kabelac
fccd6e0346 makefiles: add target for man-generator
Add supporting target for recreating man-generator when dependencies needs it.
2021-04-23 23:00:55 +02:00
Zdenek Kabelac
348c46c8fc man: add some resizing examples
Add some examples with -l% usage.
2021-04-23 23:00:55 +02:00
Zdenek Kabelac
a21028dea7 man: add missing _iorig suffix 2021-04-23 23:00:55 +02:00
Zdenek Kabelac
579c941321 man: document fsadm -l option
Missed -l option in man page, although users should prefer
lvresize -r when the also want to do a volume management,
as there they can specify i.e. extents for allocation.
Also mention dm-crypt support in command description.
2021-04-23 23:00:55 +02:00
Zdenek Kabelac
6f61de3009 args.h: bold command refference 2021-04-23 23:00:55 +02:00