installed system boots with root=/dev/bcache0 rather than root=UUID when root is bcache

Bug #1680591 reported by Scott Moser
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin (Ubuntu)

Bug Description

In some debugging of another issue, we realized that installs with root on bcache such as in tests/vmtests/ end up booting with root=/dev/bcache0 (or bcache*) rather than UUID=.

This is not good as bcache names are not guaranteed in any order.

The reason this was failing was that when we create a filesystem on /dev/bcache0 no symlinks would be updated in /dev/disk/by-uuid/. The lack of a by-uuid entry causes /etc/grub.d/10_linux to take the 'GRUB_DEVICE' path in

| if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
| || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
| || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
| else
| fi

For other devices the /dev/disk/by-uuid entries were (we believe) being created by the the udev watches in /lib/udev/rules.d/60-block.rules. However, the watch there does not cover bcache devices.

## /lib/udev/rules.d/60-block.rules
| # watch metadata changes, caused by tools closing the device node which was opened for writing
| ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*", OPTIONS+="watch"

Related bugs:
 * bug 1680597: udev 60-block.rules does not watch bcache
 * bug 1676991: bcache mounts inconsistent after node reboots

Related branches

Scott Moser (smoser)
Changed in curtin:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Ryan Harper (raharper) wrote :

Can we link the kernel or grub issue as well? It'd be nice to make this not just a curtin install issue.

Scott Moser (smoser)
description: updated
description: updated
Changed in curtin (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Scott Moser (smoser)
Changed in curtin:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package curtin - 0.1.0~bzr500-0ubuntu1

curtin (0.1.0~bzr500-0ubuntu1) artful; urgency=medium

  * New upstream snapshot.
    - Allow re-use of vmtest output
    - Fix stacked storage configurations with iSCSI (LP: #1683910)
    - vmtests: enable tests to apply storage config to validate clear_holders path
    - mdadm_stop: Add retry and additional steps to halt a resync
    - vmtests: Add Artful release and update classes
    - clear-holders: mdadm use /proc/mdstat to wait for array to stop (LP: #1682584)
    - uc16 curthooks: add 'network' key to config file (LP: #1685000)
    - Doc and makefile updates for build and test on new systems.
    - clear-holders: make bcache handler wait for device shutdown (LP: #1680409)
    - vmtest: Use utf-8 and fix pseudo test collect_output
    - vmtest: fix path to install log, and utilize the globally copied paths.
    - Copy curtin install log into target. (LP: #1684128)
    - vmtest: add in post-test log post-processing
    - vmtest: update source.list test
    - add recursive flag to do_umount, add --umount to block-meta
    - load_command_environment: fix strict flag, and unit tests.
    - block_meta: Attempt to mount by UUID= if possible (LP: #1676991)
    - Make systems with root on bcache use root=UUID=. (LP: #1680591)

 -- Scott Moser <email address hidden> Fri, 19 May 2017 16:57:07 -0400

Changed in curtin (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers