Skip to content

Instantly share code, notes, and snippets.

@tsangwpx
Created February 6, 2021 08:17
Show Gist options
  • Save tsangwpx/a8b2d8704b55309651f2e4a72b020076 to your computer and use it in GitHub Desktop.
Save tsangwpx/a8b2d8704b55309651f2e4a72b020076 to your computer and use it in GitHub Desktop.

A volume group is unable to activate with the following syslog messages.

Feb  6 15:57:24 hostname kernel: [31991.352746] device-mapper: cache metadata: blocks_are_clean_separate_dirty: cache block 0 is dirty
Feb  6 15:57:24 hostname kernel: [31991.354279] device-mapper: table: 253:47: cache: Cannot enter passthrough mode unless all blocks are clean
Feb  6 15:57:24 hostname kernel: [31991.354291] device-mapper: ioctl: error adding target to table
Feb  6 15:57:24 hostname lvm[318]:   device-mapper: reload ioctl on  (253:47) failed: Invalid argument

There is something wrong with the dirty bit of the cache. Luckily, the cache is in passthrough mode (writethrough mode as well?). No actual dirty data is in the cache and, hence, the dirty bit is fake.

Use

lvconvert --splitcache vgname/lvname

to split the cache from the LV and run successfully vgchange -ay vgname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment