Fix swap creation for low memory systems

This commit is contained in:
Le0xFF 2023-07-27 16:12:57 +02:00
parent 14de907f4d
commit 74ad30e212
2 changed files with 2 additions and 2 deletions

View File

@ -276,7 +276,7 @@ function create_swapfile {
truncate -s 0 /var/swap/swapfile
chattr +C /var/swap/swapfile
chmod 600 /var/swap/swapfile
dd if=/dev/zero of=/var/swap/swapfile bs=1G count="$swap_size" status=progress
dd if=/dev/zero of=/var/swap/swapfile bs=100M count="$((${swap_size}*10))" status=progress
mkswap --label SwapFile /var/swap/swapfile
swapon /var/swap/swapfile
gcc -O2 "$HOME"/btrfs_map_physical.c -o "$HOME"/btrfs_map_physical

2
vli.sh
View File

@ -387,7 +387,7 @@ function create_swapfile {
truncate -s 0 /var/swap/swapfile
chattr +C /var/swap/swapfile
chmod 600 /var/swap/swapfile
dd if=/dev/zero of=/var/swap/swapfile bs=1G count="$swap_size" status=progress
dd if=/dev/zero of=/var/swap/swapfile bs=100M count="$((${swap_size}*10))" status=progress
mkswap --label SwapFile /var/swap/swapfile
swapon /var/swap/swapfile
gcc -O2 "$HOME"/btrfs_map_physical.c -o "$HOME"/btrfs_map_physical