Re: btrfs with multiple subvolumes in one partition

Christoph Pleger <[email protected]>
Newsgroups gmane.linux.debian.fai
Message-ID <[email protected]>
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.

Regards
  Christoph
btrfs.patch (text/x-patch, 459 B)
--- fai-5.10.3.orig/lib/setup-storage/Commands.pm
+++ fai-5.10.3/lib/setup-storage/Commands.pm
@@ -349,7 +349,7 @@ sub build_btrfs_commands {
     next unless ($config eq "BTRFS");
 
     #create BTRFS RAIDs
-    foreach my $id (keys %{ $FAI::configs{$config}{volumes} }) {
+    foreach my $id (&FAI::numsort(keys %{ $FAI::configs{$config}{volumes} })) {
     #reference to current btrfs volume
     my $vol = (\%FAI::configs)->{$config}->{volumes}->{$id};
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEHeqYcooFjlnR4zwFcOXIip7d3fEFAmORqP4ACgkQcOXIip7d
3fEZQw//dC0DGkKa7sRQX70RI+pEZS3wbbj6sNm9/R8NCjufERIiF3+QdWBsogRx
WBUNC8x7E8k0s0zHCCIVaqrZVzqtgTEmYkQj+4PU+0fLVkrpd2ZQd0YhmUCZ0rzC
h4uyImxiSbFkuk2zkIJS5aBdOe4FWMzVA9eDfcQGhLewQwMgR/Q8Ybux1wWHkIEN
1T0nOjKaD8mpMVIZ11o2OxML88OBN039eKdbZjZc/GSHvy7Hle9BoBR8SlsGo3Tj
U+FNeKWcg4Xy/7+cMlD5tEdiSZ+17xKvPlrntmMCQBuzwbaAqnOi6Omw2hXo5JaU
qXDJVTuZ1aBJkQY6ZtdiSoY2LoezdmhptBIy/Fl4E74TAUbEJ8onqDbLdkaQoXEK
Y9JariSXmTrfXlfb3i1dZJmegVu4CdWImvO5eLoNkt9ZWUGNReptOapRE4wkDPQW
QnPgPgoTIFOCVMatnjTP6JgrsABClHZAyZMT4836GiNeb/tlNtqzwd7he2Xryjja
6A1BMZqlMhm6oIqspfvB77z6wy2onzpfRph7FL2BrHpmVVqv69JT0hL/uLJzKiZF
JU9lbc5Oq/JruC/2PF39QspptxIK+4ufDWX0IhqPBgB255lBRimXxYxZiBwxOgTs
1iNDIxs5g31SN+FXvHuCLU3cviyUSenc26e5tqe21EkTwKhqeKI=
=v0Ae
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.