nerdexam
CompTIA

XK0-004 · Question #359

A technician reviews the following output: Which of the following commands should the technical execute to ensure the system has the appropriate paging? (Select TWO.)

The correct answer is B. swapon /dev/sda5 C. Mkswap/dev/sda5. Configuring swap (paging) on Linux requires two steps - formatting the partition as swap with mkswap and then activating it with swapon.

System Management

Question

A technician reviews the following output:

Which of the following commands should the technical execute to ensure the system has the appropriate paging? (Select TWO.)

Exhibit

XK0-004 question #359 exhibit

Options

  • Add if=dev/sda5 of=/tmp bs=512
  • Bswapon /dev/sda5
  • CMkswap/dev/sda5
  • DMkfs,ext3 /dev/sda5
  • ELostat/dev/sda 5
  • FFree -m/dev/sda

How the community answered

(15 responses)
  • B
    93% (14)
  • E
    7% (1)

Why each option

Configuring swap (paging) on Linux requires two steps - formatting the partition as swap with mkswap and then activating it with swapon.

Add if=dev/sda5 of=/tmp bs=512

dd is a low-level data copying tool used for cloning disks or creating images, not for initializing or enabling swap space.

Bswapon /dev/sda5Correct

mkswap initializes a partition such as /dev/sda5 by writing the swap area header so the kernel recognizes it as swap space, and swapon then registers and activates that partition so the kernel can use it for paging. Both commands are required sequentially - mkswap prepares the structure and swapon enables it at runtime.

CMkswap/dev/sda5Correct
DMkfs,ext3 /dev/sda5

mkfs.ext3 formats a partition with the ext3 filesystem for general file storage, which would destroy any swap metadata rather than create it.

ELostat/dev/sda 5

iostat reports I/O statistics for block devices and is a monitoring tool, not a swap configuration command.

FFree -m/dev/sda

free displays current memory and swap usage statistics but does not configure, format, or enable any swap partition.

Concept tested: Configuring Linux swap space with mkswap and swapon

Source: https://man7.org/linux/man-pages/man8/mkswap.8.html

Topics

#swap space#mkswap#swapon#paging

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice