Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvconvert --cachedevice doesn't support --chunksize #43

Open
optix2000 opened this issue Jan 4, 2021 · 1 comment
Open

lvconvert --cachedevice doesn't support --chunksize #43

optix2000 opened this issue Jan 4, 2021 · 1 comment

Comments

@optix2000
Copy link

Background

Running on Debian Bullseye.

% sudo lvm version
  LVM version:     2.03.10(2) (2020-08-09)
  Library version: 1.02.173 (2020-08-09)
  Driver version:  4.39.0
  Configuration:   ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --libdir=/lib/x86_64-linux-gnu --sbindir=/sbin --with-usrlibdir=/usr/lib/x86_64-linux-gnu --with-optimisation=-O2 --with-cache=internal --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --with-default-pid-dir=/run --with-default-run-dir=/run/lvm --with-default-locking-dir=/run/lock/lvm --with-thin=internal --with-thin-check=/usr/sbin/thin_check --with-thin-dump=/usr/sbin/thin_dump --with-thin-repair=/usr/sbin/thin_repair --with-udev-prefix=/ --enable-applib --enable-blkid_wiping --enable-cmdlib --enable-dmeventd --enable-lvmlockd-dlm --enable-lvmlockd-sanlock --enable-lvmpolld --enable-notify-dbus --enable-pkgconfig --enable-readline --enable-udev_rules --enable-udev_sync

Problem

When using lvconvert with --cachedevice with a large cache drive (~2TB), lvconvert will throw an error saying there are too many chunks and recommends using --chunksize to reduce the number.

% sudo lvconvert --type cache --cachedevice /dev/sdb vg/lv
Use all 1.63 TiB from /dev/sdb for cache? [y/n]: y
  Creating cachevol LV lv with size 1.63 TiB.
  Logical volume "lv_cache" created.
  Cache data blocks 3506397184 and chunk size 128 exceed max chunks 1000000.
  Use smaller cache, larger --chunksize or increase max chunks setting.

However, if you try to pass --chunksize to lvconvert it refuses to use it, making it impossible to proceed without increasing max chunks (which isn't desirable in this case).

% sudo lvconvert --type cache --chunksize 2M --cachedevice /dev/sdb vg/lv
  Command does not accept option: --chunksize 2M.

Ideally, lvconvert should support --chunksize when combined with --cachedevice, or support automatic sizing like when using --cachepool

Unfortunately using --cachepool doesn't produce the same results as --cachepool expects free extents, which don't exist, as all of them have been allocated to either the origin LV or the cache.

% sudo lvconvert --type cache --cachepool lv_cache vg/lv
  Using 2.00 MiB chunk size instead of default 64.00 KiB, so cache pool has less than 1000000 chunks.
  WARNING: Converting vg/lv_cache to cache pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vg/lv_cache? [y/n]: y
  Volume group "vg" has insufficient free space (0 extents): 10 required.
  LV vg/lv_cache could not be converted to a cache pool.
@zkabelac
Copy link

For now use simple syntax with cachepools - as this slightly faster use with dm-cache - here is example syntax

lvcreate --cache -Lsizeofcache -c 2M vg/LV_ORIGIN /dev/sdb

you can also use conversion if you create cachepool upfront.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants