Difference between revisions of "Linux: swap"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) m (→Create swap) Tag: visualeditor |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | == Create swap == | + | ==Create swap== |
| − | + | <syntaxhighlight lang="bash"> | |
| − | + | sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 | |
| − | + | sudo chmod 600 /var/swap.1 | |
| − | + | sudo /sbin/mkswap /var/swap.1 | |
| − | + | sudo /sbin/swapon /var/swap.1 | |
| − | If you need more than 1024 then change that to something higher.<br /> | + | </syntaxhighlight>If you need more than 1024 then change that to something higher.<br /> |
To enable it by default after reboot, add this line to /etc/fstab:<br /> | To enable it by default after reboot, add this line to /etc/fstab:<br /> | ||
| − | |||
| − | |||
/var/swap.1 none swap sw 0 0 | /var/swap.1 none swap sw 0 0 | ||
| − | == Modify swap partition == | + | ==Modify swap partition== |
swapoff /dev/sda3 | swapoff /dev/sda3 | ||
mkswap /dev/sda4 | mkswap /dev/sda4 | ||
Latest revision as of 08:16, 11 November 2019
Create swap[edit]
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo chmod 600 /var/swap.1
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
If you need more than 1024 then change that to something higher.
To enable it by default after reboot, add this line to /etc/fstab:
/var/swap.1 none swap sw 0 0
Modify swap partition[edit]
swapoff /dev/sda3 mkswap /dev/sda4 swapon /dev/sda4
edit /etc/fstab