- Code: Select all
root@debian:~# dd if=/dev/zero of=/live/image/swapfile bs=1024 count=524288
- Code: Select all
root@debian:~# mkswap /live/image/swapfile 524288
In this example the SWAP file is 512 Mb and it is placed in /live/image.
You can start using this swapfile right a way without reboot with this command:
- Code: Select all
root@debian:~# swapon /live/image/swapfile
And you can stop it with this one:
- Code: Select all
root@debian:~# swapoff /live/image/swapfile
You can move this swap file on different partition and use it from there by changing the path, or you can delete it and recreate it again when you need it.