btrfs dev scan fails to find all devices

Bug #1989677 reported by Ken Sharp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
btrfs-progs (Ubuntu)
New
Undecided
Unassigned

Bug Description

After upgrading from 18.04 to 20.04, my computer failed to boot.

I eventually figured out that `btrfs device scan` does not detect all of the devices for my root filesystem, one of which is /dev/sdb10.

Is the program hardcoded to do this?

Workaround is to create /etc/initramfs-tools/scripts/local-premount/btrfs:

------
#!/bin/sh

set -e

modprobe btrfs
/bin/btrfs device scan
/bin/btrfs device ready /dev/sdb10
------

I've had a quick look through device-scan.c from the upstream kernel but I don't see anything in there that would suggest it should be stopped after /dev/sdX9.

I'm sure this can be recreated fairly easily in a VM but I haven't tried that. I will do so if needed.

Related: https://askubuntu.com/q/1429429/170177

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: btrfs-progs 5.4.1-2
ProcVersionSignature: Ubuntu 5.4.0-126.142-generic 5.4.203
Uname: Linux 5.4.0-126-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.24
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: MATE
Date: Thu Sep 15 08:34:43 2022
SourcePackage: btrfs-progs
UpgradeStatus: Upgraded to focal on 2022-09-14 (1 days ago)
mtime.conffile..etc.apport.crashdb.conf: 2019-08-06T11:56:22.315382

Revision history for this message
Ken Sharp (kennybobs) wrote :
Revision history for this message
Ken Sharp (kennybobs) wrote :
description: updated
Revision history for this message
Ken Sharp (kennybobs) wrote (last edit ):

GParted Live 1.7.0 fails to correctly identify the partition when it loads also; a manual `btrfs dev scan` corrects this. Obviously this doesn't cause a boot failure, but as it is based on Debian Sid I would expect to see this in Debian also, possibly all the way upstream.

Revision history for this message
Ken Sharp (kennybobs) wrote :

Tried in a VM:

Install 18.04, add partitions to both sda and sdb up to 10, upgrade to 20.04, and it seems to work fine.

I don't know how to reproduce this reliably, but I definitely need the script to run on my system or it won't boot.

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.