managing swap

Create and manage swap spaces to supplement physical memory.

Task 1:

Make a swap partition having 100MB. Make automatically usable at system boot time.

Solution:

fdisk /dev/sdX
n
p
1
enter
+101M
t
82
w
mkswap /dev/sda1
swapon /dev/sda1
vim /etc/fstab
/dev/sda1    swap    swap    defaults    0 0

Task 2:

Add an additional swap partition of 656MiB to your system. The swap partition should be mount when your system boots. Do not remove or otherwise alter any existing swap partition on your system.

Solution:

Task 3:

Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.

Solution:

Task 4:

Create a swap space, set the size is 600MB, and make it be mounted automatically after rebooting the system (permanent mount).

Solution:

Last updated

Was this helpful?