aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-09-22 00:41:47 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-09-22 11:54:09 +0200
commit873bda089bd05adbe74ad17cae063ee4bcbe25de (patch)
treec1a1cdb3fe3ba582f33332f58ab1142641592f62
parentc848871d7432c5ad834f6bb5b60f4e6133ae73fd (diff)
downloadmkinitfs-873bda089bd05adbe74ad17cae063ee4bcbe25de.tar.bz2
mkinitfs-873bda089bd05adbe74ad17cae063ee4bcbe25de.tar.xz
fix booting from btrfs on multiple devices
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices: > btrfs device scan is used to scan all of the block devices under /dev > and probe for Btrfs volumes. This is required after loading the btrfs > module if you're running with more than one device in a filesystem. See http://bugs.alpinelinux.org/issues/6903
-rw-r--r--features.d/btrfs.files1
-rwxr-xr-xinitramfs-init.in4
2 files changed, 5 insertions, 0 deletions
diff --git a/features.d/btrfs.files b/features.d/btrfs.files
new file mode 100644
index 0000000..3729b89
--- /dev/null
+++ b/features.d/btrfs.files
@@ -0,0 +1 @@
+/sbin/btrfs
diff --git a/initramfs-init.in b/initramfs-init.in
index be7b1c3..f3a3ee5 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -388,6 +388,10 @@ if [ -n "$KOPT_root" ]; then
nlplug-findfs $cryptopts -p /sbin/mdev ${KOPT_debug_init:+-d} \
$KOPT_root
+ if echo "$KOPT_modules $KOPT_rootfstype" | grep -qw btrfs; then
+ /sbin/btrfs device scan || echo "Failed to scan devices for btrfs filesystem."
+ fi
+
if [ -n "$KOPT_resume" ]; then
echo "Resume from disk"
if [ -e /sys/power/resume ]; then