diff options
| author | Blake Romero <blake@blkrom.com> | 2024-04-17 21:04:47 +0100 |
|---|---|---|
| committer | Blake Romero <blake@blkrom.com> | 2024-04-17 21:04:47 +0100 |
| commit | b9df3fd7322713dba0a18a92d213f1c24e5cfa0b (patch) | |
| tree | 8f51a483cdc739a9cf6d7e48dc65f7fcd33f7c5e | |
| parent | eeb3ebfc822768161b9ceec75c67af912e279e03 (diff) | |
Manually set label for swapfile for grub config
| -rwxr-xr-x | install-artix.sh | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/install-artix.sh b/install-artix.sh index 059f92d..a45ecba 100755 --- a/install-artix.sh +++ b/install-artix.sh @@ -189,12 +189,29 @@ mount -o "${options},subvol=@snapshots" "${root}" /mnt/.snapshots \ mount -o "nodatacow,subvol=@swap" "${root}" /mnt/.swap # Create swap file -btrfs filesystem mkswapfile \ - --size "$swap_size" \ - --uuid clear \ - /mnt/.swap/swapfile +# btrfs filesystem mkswapfile \ +# --size "$swap_size" \ +# --uuid clear \ +# /mnt/.swap/swapfile +# btrfs property set /mnt/.swap compression none +# swapon /mnt/.swap/swapfile + +# SWAP FILE +swapfile=/mnt/.swap/swapfile +# create an empty file +truncate -s 0 $swapfile +# set to copy-on-write +chattr +C $swapfile +# preallocate file size to swap size +fallocate -l $swap_size $swapfile +# restrict access to swap file +chmod 0600 $swapfile +# initialise the swap file +mkswap -L SWAP $swapfile +# ensure swap sub-volume does not use compression btrfs property set /mnt/.swap compression none -swapon /mnt/.swap/swapfile +# enable the swap file +swapon $swapfile # Mount boot partition. mount "${boot}" /mnt/boot |
