Using bcache with root on LVM logical volume fails to boot

Bug #1614553 reported by Rod Smith
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
initramfs-tools
New
Undecided
Unassigned

Bug Description

I attempted to create an installation that used bcache (with a partition on an SSD, /dev/nvme0n1p1, as the cache device) to accelerate access to an LVM logical volume (/dev/mapper/weavile-root) on a hardware RAID array (/dev/sda). The intent was to put the root (/) filesystem in the bcache-mediated logical volume. (/boot and my EFI System Partition were outside of the LVM and were not accessed through bcache.) I was able to create the bcache device and install the OS (Ubuntu 16.04.1 server, kernel 4.4.0-34-generic) to it. As per various online guides, I chroot'ed into the newly-prepared Ubuntu and did an "update-initramfs -k all -u", which seemed to succeed. Unfortunately, upon reboot, the system dropped to an "(initramfs)" prompt, which showed /dev/bcache0 to be missing. I eventually discovered that the initramfs was not automatically activating the LVM; /dev/mapper was empty, aside from a "control" file. At the "(initramfs)" prompt, doing a "vgchange -a y" caused /dev/mapper to become populated, and exiting then enabled the system to boot. Creating a fresh initramfs from within the natively-booted installation did NOT improve matters. Also, creating a small "junk" logical volume, mounting it, and referencing it in /etc/fstab prior to preparing a fresh initramfs did NOT help. (Perhaps putting something critical, like var, on such a logical volume would help, but I didn't try that -- and the point of the configuration is to have the entire OS served by bcache.)

Thus, it looks as if update-initramfs is preparing a /boot/initrd.img file that has the necessary LVM tools, but is not actually activating the LVM when root (/) is on bcache with the backing store in a logical volume.

FWIW, this looks a lot like bug #931929, but I discovered that bug after removing LVM from the configuration of the server I was setting up, so I don't know if the workaround there would work. (Also, that bug does not involve bcache.) The server on which I discovered the bug is now configured without LVM, but I have access to a test system with an SSD and a regular disk, if reproducing the problem is important.

Jeff Lane  (bladernr)
tags: added: hwcert-server
Revision history for this message
SirG (sirg-nj) wrote :

I am successfully running a system with several devices, including root, set up on bcache with both backing and cache devices on LVM volumes. Initiramfs scripts are not bright enough to detect this. Details are discussed in bug #1573982. Adding line "vgchange -ay" to /usr/share/initramfs-tools/scripts/local-top/lvm2, as suggested in comment 8 on that bug, works.

Jeff Lane  (bladernr)
tags: removed: hwcert-server
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.