Skip to content

Commit

Permalink
Merge pull request #436 from jmlntw/fix-swapfile
Browse files Browse the repository at this point in the history
Fix "swapon: swapfile has holes" error in Linux kernel 5.7
  • Loading branch information
helmuthdu authored Jul 8, 2020
2 parents 5c21147 + d1bd0b8 commit 18ee6a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fifo
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ format_partitions() {
;;
2)
total_memory=$(grep MemTotal /proc/meminfo | awk '{print $2/1024}' | sed 's/\..*//')
fallocate -l "${total_memory}"M "${MOUNTPOINT}"/swapfile
dd if=/dev/zero of="${MOUNTPOINT}"/swapfile bs=1M count="${total_memory}" status=progress
chmod 600 "${MOUNTPOINT}"/swapfile
mkswap "${MOUNTPOINT}"/swapfile
swapon "${MOUNTPOINT}"/swapfile
Expand Down

0 comments on commit 18ee6a5

Please sign in to comment.