btrfs with multiple subvolumes in one partition
Christoph Pleger
Christoph.Pleger at cs.tu-dortmund.de
Mon Dec 12 15:30:50 CET 2022
Hello,
> > > when setting up btrfs with setup-storage,
> > > is it possible to configure multiple subvolumes
> > > in one partition, like I tried to configure
> > > with
> >
> > > disk_config btrfs fstabkey:uuid
> > > btrfs single / disk1.3 subvol=@root
> > > btrfs single /var disk1.3 subvol=@root/var
> > > btrfs single /usr disk1.3 subvol=@root/usr
> > I think this is related to https://bugs.debian.org/964761
> > The output of format.log would help for the bug report.
>
> The bug can be solved with the attached patch.
There is another bug in setup-storage that strikes with almost the same
configuration as above, but when using for example raid1 instead of
single. In that case, mkfs.btrfs is called several times on the same
raid devices, so that previously created subvolumes get lost. This is
because, in contrast to single device btrfs filesystems, setup-storage
does not check for raid if the highest level filesystem already exists.
This can be solved by the attached patch.
I discovered that surprisingly it can happen that, though the output of
setup-storage says that for example /dev/sdb3 is going to be mounted on
/mnt and that /dev/sdb3 is going to be unmounted, in reality /dev/sda3
is mounted, but /dev/sdb3 is tried to be unmounted, what of course
fails. That is why I also changed from unmounting the device to
unmounting the mountpoint.
Regards
Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: btrfs.patch
Type: text/x-patch
Size: 1077 bytes
Desc: not available
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20221212/d1af4c0a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20221212/d1af4c0a/attachment.sig>
More information about the linux-fai
mailing list