How to add Swap to Ubuntu boot entry?

  

Swap is a swap partition in Ubuntu systems that functions somewhat like the virtual memory of a Windows system. After adding a Swap partition to Ubuntu, you can speed up your system. Add Swap to the boot entry of Ubuntu, you can let Swap boot automatically, how to operate?

1. increase Swap

2G Swap partition increased, only need to modify count = 2k

sudo dd if = /dev /zero of = /swap.disk Bs=1M count=2k

sudo mkswap -f /swap.disk

sudo swapon /swap.disk

or

sudo dd if=/Dev/zero of=/swap.disk bs=1M count=2k && sudo mkswap -f /swap.disk && sudo swapon /swap.disk

2.Join Start

sudo vi /etc/rc.local

before exit 0 Join:

#sudo dd if=/dev/zero of=/swap.disk bs=1M count=2k & ;& sudo mkswap -f /swap.disk && sudo swapon /swap.disk

sudo mkswap -f /swap.disk && sudo swapon /swap.disk

exit 0

The above is the way to add Swap to Ubuntu's boot entry, so you don't have to manually mount the Swap partition every time you boot.

Copyright © Windows knowledge All Rights Reserved