Can't mount BTRFS volume using fstab
I installed Alpine on /dev/sda
in sys
mode
using ext4
. Then I created a btrfs
volume on
/dev/sdb
and /dev/sdc
using:
apk add btrfs-progs
modprobe btrfs && echo btrfs > /etc/modules
mkfs.btrfs -m raid1 -d raid1 /dev/sdb /dev/sdc
mkdir /data && mount /dev/sdb /data
This is working fine. Now I add this mount to /etc/fstab
like this:
UUID=da110dca-aed5-48b8-a5b6-c1b41c10c419 /data btrfs defaults 0 0
On reboot I get the following error:
mount: mounting /dev/sdc on /data failed: Invalid argument
Output of dmesg
:
[ 5.950849] BTRFS: device fsid da110dca-aed5-48b8-a5b6-c1b41c10c419 devid 2 transid 12 /dev/sdc
[ 5.952786] BTRFS info (device sdc): disk space caching is enabled
[ 5.952791] BTRFS info (device sdc): has skinny extents
[ 5.954055] BTRFS warning (device sdc): devid 1 uuid 6a45e7d4-78df-4263-be09-b83a3a15e6e0 is missing
[ 5.954063] BTRFS error (device sdc): failed to read the system array: -5
[ 6.002364] BTRFS error (device sdc): open_ctree failed
I fixed this by adding /sbin/btrfs device scan
to the top
of the start
method in /etc/init.d/localmount
.
However, I have a feeling that this command is already ran on boot but
only after mounting /etc/fstab
, because when I simply run
mount /dev/sdb /data
right after booting it’s working.
It seems that this command is being called if the root file system is
btrfs
(see #6903); I think this should also be done if
there is any other btrfs
file system in
/etc/fstab
.
(from redmine: issue id 9539, created on 2018-10-08)