Skip to content

Commit

Permalink
Improves mk-swap-file on btrfs
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Feb 24, 2024
1 parent 4cb4c76 commit 3768bd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .functionsrc
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ get-crypto-balance() {

# Create a swap file and activate it.
mk-swap-file() {
set -x
swapfile=${1:-swapfile}
size=${2:-10g}
test -f "$swapfile" && return
sudo truncate -s 0 "$swapfile"
sudo chattr +C "$swapfile"
sudo fallocate "$swapfile" -l "$size"
sudo chmod 600 "$swapfile"
sudo mkswap "$swapfile"
Expand Down

0 comments on commit 3768bd0

Please sign in to comment.