which combination of commands should be used?

A system is running out of swap space. To initialise 5GB of additional swap space, which
combination of commands should be used?

A system is running out of swap space. To initialise 5GB of additional swap space, which
combination of commands should be used?

A.
dd if=/dev/zero of=/tmp/swapfilebs=1024 count=5120000; mkswap/tmp/swapfile;
mount/tmp/swapfile

B.
dd if=/dev/zero of=/tmp/swapfilebs=1024 count=5120000; swapon /tmp/swapfile

C.
touch -5G /tmp/swapfile; swapon /tmp/swapfile

D.
mkswap /tmp/swapfile 512000; swapon /tmp/swapfile

E.
dd if=/dev/zero of=/tmp/swapfilebs=1024 count=5120000; mkswap /tmp/swapfile; swapon
/tmp/swapfile

Explanation:
By Creating the image file, we can use as a Virtual Memory.
To use as a swap space:
1. Create the image file using dd command where if means input from and of means output
filename, bs means byte sector and count means how many times to read.
2. mkswap command creates the swapfilesystem
3. Toon/off the swap memory: swapon swapfile and to off swapoff swapfile
4. Verify using free command



Leave a Reply 0

Your email address will not be published. Required fields are marked *