automate missing /nocow
authorIan Kelling <iank@fsf.org>
Tue, 24 Feb 2026 04:06:33 +0000 (23:06 -0500)
committerIan Kelling <iank@fsf.org>
Tue, 24 Feb 2026 04:06:33 +0000 (23:06 -0500)
fai/config/hooks/partition.DEFAULT

index d210a9a86a1954a12be15cbf6754190b61f1d623..aee20c873f109ab31b769a3f536d9de47f43731c 100755 (executable)
@@ -1311,8 +1311,16 @@ btrfs subvolume set-default 0 /mnt # already default, just ensuring it.
 
 # for libreboot systems. grub2 only reads from subvolid=0
 mkdir -p /mnt/grub2
-# todo: this would need some rework if we moved boot into
-# lvm.
+
+# initial setup of extra data fs.
+btrfs subvol create /mnt/nocow
+chattr +C /mnt/nocow
+mkdir /mnt/nocow/{t,user}
+cat > /tmp/fai/fstab <<EOF
+/mnt/root/nocow /nocow  none  nofail,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s,noatime,subvol=nocow,$mopts
+EOF
+
+
 cp $FAI/distro-install-common/libreboot_grub.cfg /mnt/grub2
 
 if $wipe && [[ -e /mnt/$boot_vol ]]; then
@@ -1331,8 +1339,3 @@ grub-editenv /mnt/grubenv set last_boot=/$boot_vol
 umount /mnt
 
 
-# initial setup of extra data fs, mounted,
-# btrfs subvol create nocow
-# chattr +C nocow
-# mkdir nocow/{t,user}
-# chown iank.iank nocow/{t,user}