Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
insufficient use of btrfs device scan #1547
Currently we only execute this command on boot via bootstrap.py btrfs/device_scan(). In certain, currently rare, circumstance this can lead to failed mounts with multi-volume filesystems when mounting by label as we do: https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#Filesystem_can.27t_be_mounted_by_label
Rockstor log excerpt of the same:
In the above instance a 2 disk LUKS full disk encrypted pool was unable to mount as it's drives had only been unlocked after boot.
And our "by-label" points to one of them as expected:
and we find:
with lsblk having output of:
So 251:1 is our luks-3efb3830-fee1-4a9e-a5c6-ea456bfc269e
But if we try and mount via this device:
Note that the resolved mapper path is correct.
then we are good and get a successful mount.
So if we are to move to a more dynamic disk model, ie such as external backup media or live plugging of disks, or occasional after boot LUKS container opening then we must first run our
I am unsure where best this should be implemented.
Maybe in scan_disks() but that may just be over the top or better still just before each mount ie in:
In follow up confirmation testing it was found that this same pool failed to mount for an extended period even with multiple refreshes (causing the same log output as before) of the pools page but once:
was executed the pool was there after auto mounted successfully while the pool page was visible.
referenced this issue
Mar 4, 2017
This was referenced
Jun 13, 2017
As a system wide btrfs device scan (all block devices) seems over kill prior to every pool mount; the above failure to mount by label and it's consequent disk was reproduced (note that this in an intermittent issue): and then only pool members were scanned prior to a pool mount attempt ie:
and dm-1 in turn links to luks-3efb3830-fee1-4a9e-a5c6-ea456bfc269e
Then we do a device specific btrfs scan of our first pool device:
and re-test our mount (which again fails):
then we do a device specific device scan of our second pool device:
and then retest our mount by label again (which this time succeeds):
So we now have a successful mount by label after first device scanning each member: