TL;TR
Failed to boot with lvm2's new default cache-pool setting cache-policy-smq
The problem
I have created a lvm disk with lvmcache on SSD drive on ubuntu 16.04 Following this, but failed to mount my root volume after reboot server.
I can boot into 16.04 live CD and mount /dev/mapper/vg0-root
successfully
(with Boot-repair, mdadm, thin-provisioning-tools).
After some digging, It seems lvmcache's new policy dm-cache-smq
is missing/unsupported in somewhere, but i have no idea what to do next.
How can i fix this?
Error messages on boot
The error message repeat showing until mount wait timeout, then console drops a (initramfs)
shell.
Begin: Running /scripts/local-block . . . lumetad is not active yet, using direct activation during sysinit
/sbin/nodprobe failed: 1
device-mapper: cache: You have created a cache device with a lot of individual cache blocks (7600000)
All these mappings can consume a lot oF kernel memory, and take some time to read/write
Please consider increasing the cache block size to reduce the overall cache block count
device-mapper: cache-policy: unknown policy type
device-mapper: table: 252:4: cache: Error creating cache's policy
device-napper: ioctl: error adding target to table
device-mapper: reload ioctl on (252:4) failed: Invalid argument
done.
Settings i have now
/etc/initramfs-tools/modules
dm_cache
dm_cache_mq
dm_cache_smq
dm_persistent_data
dm_bufio
/etc/initramfs-tools/hooks/lvmcache
#!/bin/sh
PREREQ="lvm2"
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
if [ ! -x /usr/sbin/cache_check ]; then
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
copy_exec /usr/sbin/cache_check
manual_add_modules dm_cache dm_cache_mq dm_cache_smq dm_persistent_data dm_bufio
Workaround
I change lvmcache back to mq policy to get my server online temporarily, but still looking for solutions for cache with smq policy.
lvremove vg0/cachedata
lvcreate -L 480M -n cachemeta vg0 /dev/sde
lvcreate -L 475000M -n cachedata vg0 /dev/sde
# Use mq here
lvconvert --type cache-pool --cachepolicy mq --chunksize 8192 --poolmetadata vg0/cachemeta --cachemode writeback vg0/cachedata --yes
lvconvert --type cache --cachepool vg0/cachedata vg0/root
References
- How to install Ubuntu with both disk encryption AND SSD caching
- Boot-Repair
- Bug 1247386 - lvcreate and lvchange need '--cachepolicy' validity checks