diff options
| author | Chris Titus <[email protected]> | 2021-10-26 17:27:42 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-26 17:27:42 -0500 |
| commit | 9724ae3706aa2801c3e776e2aa1344d622da0e23 (patch) | |
| tree | b85a64b799bab01d8f6068fed97226727f44295c | |
| parent | c5816896b29a74e2040fcecde494ee14331afa20 (diff) | |
| parent | f7aa459015e9e29a11d5f041f6518d840837da92 (diff) | |
| download | ArchTitus-9724ae3706aa2801c3e776e2aa1344d622da0e23.tar.xz ArchTitus-9724ae3706aa2801c3e776e2aa1344d622da0e23.zip | |
Merge pull request #48 from RoyShapiro/test
NOCOW & swap-in-ram fix.
| -rwxr-xr-x | 0-preinstall.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/0-preinstall.sh b/0-preinstall.sh index c5b5e69..b01f2d0 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -129,10 +129,16 @@ echo "-- Check for low memory systems <8G --" echo "--------------------------------------" TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTALMEM -lt 8000000 ]]; then - dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress - chmod 600 /swapfile - mkswap /swapfile - swapon /swapfile + #Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything. + mkdir /mnt/opt/swap #make a dir that we can apply NOCOW to to make it btrfs-friendly. + chattr +C /mnt/opt/swap #apply NOCOW, btrfs needs that. + dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress + chmod 600 /mnt/opt/swap/swapfile #set permissions. + chown root /mnt/opt/swap/swapfile + mkswap /mnt/opt/swap/swapfile + swapon /mnt/opt/swap/swapfile + #The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the sysytem itself. + echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab #Add swap to fstab, so it KEEPS working after installation. fi echo "--------------------------------------" echo "-- SYSTEM READY FOR 0-setup --" |
