Btrfs: Difference between revisions

imported>Onny
mNo edit summary
imported>Privacy1st
use single BTRFS command to create swapfile
Line 68: Line 68:
</syntaxhighlight>
</syntaxhighlight>


Then, create the swap file with copy-on-write and compression disabled:
Then, create the swap file and adjust its size as desired:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# truncate -s 0 /swap/swapfile
# btrfs filesystem mkswapfile --size 8g --uuid clear /swap/swapfile
# chattr +C /swap/swapfile
# btrfs property set /swap/swapfile compression none
# dd if=/dev/zero of=/swap/swapfile bs=1M count=4096
# chmod 0600 /swap/swapfile
# mkswap /swap/swapfile
</syntaxhighlight>
</syntaxhighlight>