XK0-004 · Question #417
A technician reviews me following output: Which of the following commands should the technician execute to ensure the system has the appropriate paging? (Select TWO).
The correct answer is B. swapon./dev/sda5 C. mksvap /dev/sda5. Configuring a new swap partition requires two steps: formatting the partition as swap with mkswap, then activating it with swapon.
Question
A technician reviews me following output:
Which of the following commands should the technician execute to ensure the system has the appropriate paging? (Select TWO).
Exhibit
Options
- Add if-/dev/sda5 of-/otp bs-512
- Bswapon./dev/sda5
- Cmksvap /dev/sda5
- Dmkfs.ext3 /dev/sda5
- Eiostat/dev/sda5
- Ffree -m /dev/sda
How the community answered
(21 responses)- B86% (18)
- E10% (2)
- F5% (1)
Why each option
Configuring a new swap partition requires two steps: formatting the partition as swap with mkswap, then activating it with swapon.
dd if=/dev/sda5 of=/otp bs=512 copies raw bytes from the partition to a file path and performs no swap initialization or activation.
swapon /dev/sda5 activates a swap-formatted partition by registering it with the kernel, making it immediately available for paging. It must follow mkswap because the kernel requires the swap signature written by mkswap before it will accept the partition as a valid swap area.
mkswap /dev/sda5 initializes the partition by writing a swap header and UUID, preparing it for use as virtual memory. Without this step first, swapon will refuse the partition because no valid swap signature is present.
mkfs.ext3 /dev/sda5 formats the partition as an ext3 filesystem, which overwrites any swap header and makes the partition unusable as a paging area.
iostat /dev/sda5 reports block device I/O statistics only and cannot configure, initialize, or activate a swap partition.
free -m /dev/sda displays current memory and swap usage in megabytes but does not accept a device argument or configure any swap space.
Concept tested: Creating and activating a Linux swap partition
Source: https://www.man7.org/linux/man-pages/man8/mkswap.8.html
Topics
Community Discussion
No community discussion yet for this question.
