My system:
Code: Select all
guest@porteus:~$ cat /etc/porteus/00*
001-core.xzm:20221211
002-xorg.xzm:20221211
002-xtra.xzm:20221211
003-xfce.xzm:20220925
I downloaded
https://slackware.uk/slackware/slackwar ... 6_64-1.txz and created a local btrfs-progs-5.16-x86_64-1.xzm module (size quite larger than the package - 2.06 MB
Activated btrfs-progs-5.16-x86_64-1.xzm
Creating a 60 MB container file failed:
Code: Select all
root@porteus:/tmp/TEST# dd if=/dev/zero of=container.btrfs bs=1M count=60
60+0 records in
60+0 records out
62914560 bytes (63 MB, 60 MiB) copied, 0.0357233 s, 1.8 GB/s
root@porteus:/tmp/TEST# mkfs.btrfs container.btrfs
btrfs-progs v5.16
See http://btrfs.wiki.kernel.org for more information.
ERROR: 'container.btrfs' is too small to make a usable filesystem
ERROR: minimum size for each btrfs device is 114294784
Since 114294784 byte translates into 109 MB I tried again:
Code: Select all
root@porteus:/tmp/TEST# dd if=/dev/zero of=container.btrfs bs=1M count=109
109+0 records in
109+0 records out
114294784 bytes (114 MB, 109 MiB) copied, 0.0624429 s, 1.8 GB/s
root@porteus:/tmp/TEST# mkfs.btrfs container.btrfs
btrfs-progs v5.16
See http://btrfs.wiki.kernel.org for more information.
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: (null)
UUID: 9513bd4a-9152-4170-b046-b123acd454b8
Node size: 16384
Sector size: 4096
Filesystem size: 109.00MiB
Block group profiles:
Data: single 8.00MiB
Metadata: DUP 32.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 109.00MiB container.btrfs
root@porteus:/tmp/TEST# file container.btrfs
container.btrfs: BTRFS Filesystem sectorsize 4096, nodesize 16384, leafsize 16384, UUID=9513bd4a-9152-4170-b046-b123acd454b8, 147456/114294784 bytes used, 1 devices
and it works.
seems when you want a container file of the minimum size of 109 MB, then you can use mkfs.btrfs
If you want a smaller container (e.g. by test size of 60 MB) you have to go with e.g. ext2.
Added in 11 minutes 27 seconds:
I cannot say that I like btrfs as a container file system:
Code: Select all
root@porteus:/tmp/TEST# mkdir /BTRFS-TEST
root@porteus:/tmp/TEST# mount container.btrfs /BTRFS-TEST/
root@porteus:/tmp/TEST# ls -ao /BTRFS-TEST
total 16root@porteus:/tmp/TEST# mkdir /BTRFS-TEST
root@porteus:/tmp/TEST# mount container.btrfs /BTRFS-TEST/
root@porteus:/tmp/TEST# ls -ao /BTRFS-TEST
total 16
drwxr-xr-x 1 root 0 2023-01-09 02:15 .
drwxrwxrwt 94 root 400 2023-01-09 02:23 ..
root@porteus:/tmp/TEST# df -Tm /BTRFS-TEST
Filesystem Type 1M-blocks Used Available Use% Mounted on
/dev/loop21 btrfs 109 4 28 12% /BTRFS-TEST
drwxr-xr-x 1 root 0 2023-01-09 02:15 .
drwxrwxrwt 94 root 400 2023-01-09 02:23 ..
root@porteus:/tmp/TEST# df -Tm /BTRFS-TEST
Filesystem Type 1M-blocks Used Available Use% Mounted on
/dev/loop21 btrfs 109 4 28 12% /BTRFS-TEST
From 109 MB, when 4 MB are used, why are only 28 MB available?
109 minus 4 should state that 105 MB is available, not a mere 28.
Let's compare that to my auto-mounted at boot /Lsfind ext2 container file:
Code: Select all
root@porteus:~# df -Tm /Lsfind/
Filesystem Type 1M-blocks Used Available Use% Mounted on
/dev/loop18 ext2 68 54 15 80% /Lsfind
68 minus 54 would be 14, the error that it's 15 MB free and not 14 MB free is a rounding error.
Maybe this is explained in detail in some btrfs readme or in man mkfs.btrfs.8 but I am too lazy to browse through all that. (And maybe the info about that is in one of the other man pages - there are 26 man pages included in btrfs-progs-5.16-x86_64-1.xzm after all.)
Code: Select all
root@porteus:/# man mkfs.btrfs.8|wc
583 3231 31839
583 lines, 3231 words and 31839 bytes is on the larger size when it comes to man pages.
Added in 1 minute 55 seconds:
When it comes to a container file system, I will stick with either ext2 or ext3 and skip on using btrfs for now.
But as you can see above, it can easily implemented in Porteus 5.0.
Added in 13 minutes 3 seconds:
Just as additional heads-up:
I umounted /BTRFS-TEST
I deactivated btrfs-progs-5.16-x86_64-1.xzm
and then mounted again /tmp/TEST/container.btrfs on /BTRFS-TEST/ to see if that works without the need of the btrfs module, and it does.
So, creating a btrfs file system or a btrfs container file, you need the btrfs tools module activated.
But only mounting and umounting an already created btrfs container file you not need the btrfs tools module - unless you want a btrfsck.