[elbe-users] Image with flat BTRFS Layout

Müller, Steffen - LT Mueller.Steffen at litef.de
Mon Nov 18 13:31:13 CET 2024


Hello,

I want to use ELBE to build an Debian Image with filesystem type BTRFS.

For an "easy" Layout I used this xml settings:
     <images>
          <msdoshd>
                <partition>
                     <size>remain</size>
                     <label>BTRFS</label>
                </partition>
          </msdoshd>
     </images>
     <fstab>
          <bylabel>
                <label>BTRFS</label>
                <mountpoint>/</mountpoint>
                <fs>
                     <type>btrfs</type>
                </fs>
          </bylabel>
     <fstab>

This works fine.

Now I want to implement a flat BTRFS design:
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Subvolumes

     <images>
          <msdoshd>
                <partition>
                     <size>remain</size>
                     <label>BTRFS</label>
                </partition>
          </msdoshd>
     </images>
     <fstab>
          <bylabel>
                <label>BTRFS</label>
                <mountpoint>/</mountpoint>
                <fs>
                     <!-- fs type and options -->
                     <type>btrfs</type>
                     <fs-finetuning>
                          <path-command>echo "subvol=/rfs"</path-command>
                     </fs-finetuning>
                </fs>
                <options>subvol=/rfs,defaults,noatime</options>
          </bylabel>
          <bylabel>
                <label>BTRFS</label>
                <mountpoint>/home</mountpoint>
                <fs>
                     <!-- fs type and options -->
                     <type>btrfs</type>
                     <fs-finetuning>
                          <path-command>echo "subvol=/rfshome"</path-command>
                     </fs-finetuning>
                </fs>
                <options>subvol=/rfshome,defaults,noatime</options>
          </bylabel>
          <bylabel>
                <label>BTRFS</label>
                <mountpoint>/</mountpoint>
                <fs>
                     <!-- fs type and options -->
                     <type>btrfs</type>
                     <!-- subvolumes may be specified in fs-finetuning  -->
                     <fs-finetuning>
                          <path-command>btrfs subvolume create {path}/rfs</path-command>
                          <path-command>btrfs subvolume create {path}/rfshome</path-command>
                     </fs-finetuning>
                </fs>
                <nofstab/>
          </bylabel>
     </fstab>

The image generation does work. But both subvolumes are empty and the Debian image is installed on the subvolume=/.
In addition the home directory is empty too.

Can someone help me?

Here is the corresponding output of log.txt:

[CMD] losetup --find --show --partscan --offset 140257280 --sizelimit 7375935488 /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/bookworm-arm64-industrial.img
[CMD] mkfs.btrfs  -L BTRFS /dev/loop0
btrfs-progs v6.2
See http://btrfs.wiki.kernel.org for more information.

Performing full device TRIM /dev/loop0 (6.87GiB) ...
NOTE: several default settings have changed in version 5.15, please make sure
      this does not affect your deployments:
      - DUP for metadata (-m dup)
      - enabled no-holes (-O no-holes)
      - enabled free-space-tree (-R free-space-tree)

Label:              BTRFS
UUID:               255f685c-3014-405c-a77e-8c2501fced9b
Node size:          16384
Sector size:        4096
Filesystem size:    6.87GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP             256.00MiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Incompat features:  extref, skinny-metadata, no-holes
Runtime features:   free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     6.87GiB  /dev/loop0

[CMD] mount /dev/loop0 /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt
[CMD] btrfs subvolume create /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt/rfs
Create subvolume '/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt/rfs'
[CMD] btrfs subvolume create /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt/rfshome
Create subvolume '/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt/rfshome'
[CMD] cp -a /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/filesystems/1/. /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt/
[CMD] umount /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/imagemnt
[CMD] losetup --detach /dev/loop0
[CMD] mv "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/filesystems/1"/* "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/target/"
[CMD] mv "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/filesystems/0"/* "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/target/boot"
[CMD] mv "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/filesystems/2"/* "/var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/target/home"
[CMD] tar cfz /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/bookworm-arm64-industrial.tgz -C /var/cache/elbe/01933ee6-4ace-73d3-93ed-2caa9a52abd2/target/  .

Thanks fr your help.

Kind regards,

Steffen Müller


Informationen über den Umfang der Verarbeitung Ihrer personenbezogenen Daten und über Ihre Datenschutzrechte finden Sie auf unserer Internetpräsenz.
Information about the scope of the processing of your personal data and about your data protection rights can be found on our Internet presence.
__________________________________________________________________________________________

Northrop Grumman LITEF GmbH ~ Amtsgericht Freiburg, HRB 3115 ~ Geschaeftsfuehrung: Lutz Kampmann ~ Vorsitzender des Aufsichtsrates: David Martin ~ Deutsche Bank Freiburg (BLZ 680 700 30) Account: 375 048 00,IBAN: DE96 6807 0030 0037 5048 00, BIC/SWIFT: DEUTDE6FXXX
__________________________________________________________________________________________

Confidentiality Notice:    This e-mail, including any attachments, may contain privileged and/or confidential information and is intended for the addressee’s use only. If you receive this e-mail in error or are not the intended recipient, you may not use, reproduce, disseminate or distribute it. Do not open nor save any attachments, please delete it immediately from your system, destroy any copies and/or printouts and notify the sender promptly by e-mail confirming that you have done so. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linutronix.de/pipermail/elbe-users/attachments/20241118/0cb8edc9/attachment-0001.htm>


More information about the elbe-users mailing list