On Sat, 19 Dec 2020 23:59:45 +0100
Ulli Horlacher <[email protected]> wrote:

> Ok, I was able to extend the btrfs filesystem via a loopback devive.
> 
> What is the suggested way to do this at boot time?
> 
> For now I have in /etc/rc.local:
> 
> cd /nfs/rusnas/fex
> for d in spool_[1-9].btrfs; do
>   echo -n "$d ==> "
>   losetup -fP --show $d
> done
> sync
> sleep 2 # without this sleep the mount will fail!

You could try replacing the sleep with "btrfs device scan", certainly more
elegant (assuming it helps). Maybe even narrow it down to
"btrfs device scan /dev/loop*", or even scan each added device.

> mount -v spool_1.btrfs /mnt/spool

Better mount one of the loop devices, not the file, lest mount will probably
make one more, a dupe of one that your script has already added, and who knows
what side effects this could have.

> This works, but is there a more elegant way?
> Using /etc/fstab seems not to be possible?

There doesn't seem to be "/etc/looptab" or such, that would set these up on
boot. So your approach seems fine to me.

-- 
With respect,
Roman

Reply via email to