nerdexam
CompTIA

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.

System Management

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

XK0-004 question #417 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)
  • B
    86% (18)
  • E
    10% (2)
  • F
    5% (1)

Why each option

Configuring a new swap partition requires two steps: formatting the partition as swap with mkswap, then activating it with swapon.

Add if-/dev/sda5 of-/otp bs-512

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.

Bswapon./dev/sda5Correct

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.

Cmksvap /dev/sda5Correct

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.

Dmkfs.ext3 /dev/sda5

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.

Eiostat/dev/sda5

iostat /dev/sda5 reports block device I/O statistics only and cannot configure, initialize, or activate a swap partition.

Ffree -m /dev/sda

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

#swap space#mkswap#swapon#virtual memory

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice