Home » LPI » 117-201 » Which combination of commands should be used?
A system is running out of swap space. To initialize 5GB of additional swap space, which combination of commands should be used?
A. dd if=/dev/zero of=/tmp/swapfile bs=1024 count 5120000; mkswap /tmp/swapfile; swapon /tmp/swapfile
B. dd if=/dev/zero of=/tmp/swapfile bs=1024 count 5120000; swapon /tmp/swapfile
C. dd if=/dev/zero of=/tmp/swapfile bs=1024 count 5120000; mkswap /tmp/swapfile; mount /tmp/swapfile
D. touch -5G /tmp/swapfile; swapon /tmp/swapfile
E. mkswap /tmp/swapfile 5120000; swapon /tmp/swapfile
Correct Answer: A
Explanation/Reference:
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 swap filesystem
3.To on/off the swap memory: swapon swapfile and to off swapoff swapfile
4.Verify using free command
Download Printable PDF. VALID exam to help you PASS.
|
|