As of Manjaro 25.0.0 “Zetar”, we are now using btrfs as the default filesystem option in calamares, and there have already been several requests from members — both directly, as in the Manjaro-Chroot on BTRFS thread, and as off-the-cuff questions elsewhere on the forum — regarding support for btrfs autodetection in manjaro-chroot.
I do not have a GitLab account, nor do I aspire to create one, but if either @philm, @Yochanan or @ManjaroDevOps were to be so kind as to merge this, then I’m sure a lot of people with broken systems due to an interrupted update would be a lot happier. ![]()
Patch follows below. ![]()
@@ -14,7 +14,8 @@
}
parse_fstab(){
- echo $(perl -ane 'printf("%s:%s\n", @F[0,1]) if $F[0] =~ m#^UUID=#;' $1/etc/fstab)
+ [ -d "$1/@" ] && fstab="/@/etc/fstab" || fstab="/etc/fstab"
+ echo $(perl -ane 'printf("%s:%s\n", @F[0,1]) if $F[0] =~ m#^UUID=#;' $1${fstab})
# perl -ane 'printf("%s:%s\n", @F[0,1]) if $F[0] =~ m#^/dev#;' $1/etc/fstab
# perl -ane 'printf("%s:%s\n", @F[0,1]) if $F[0] =~ m#^LABEL=#;' $1/etc/fstab
}
Rationale: By default, calamares will create a btrfs filesystem with a dedicated subvolume called “@” for the root directory of the system. This is not the actual filesystem root — which remains “/” — but it is the subvolume that gets set up by calamares to house the operating system’s root directory. Therefore, with this setup, the file /etc/fstab of the installed system is not actually to be found in the filesystem’s root directory /, but rather under the @ subvolume, at /@/.
In the event that the user has set @ itself as the default subvolume that gets mounted when no other subvolume is specified as a mount option, then my patch will still work, because then the @ subvolume itself won’t be visible as a subvolume, given that it will itself be the one mounted as “/” , and then /etc/fstab will be right under the default mountpoint, just as in the case of ext4 or another traditional filesystem.
![]()
