nerdexam
CompTIA

XK0-005 · Question #359

As part of the requirements for installing a new application, the swappiness parameter needs to be changed to 0. This change needs to persist across reboots and be applied immediately. A Linux…

The correct answer is A. echo "vm.swappiness=0" >> /etc/sysctl.conf && sysctl -p. To make a kernel parameter change both persistent and immediate, two steps are required. Writing vm.swappiness=0 to /etc/sysctl.conf ensures the setting survives reboots. Running sysctl -p reloads /etc/sysctl.conf and applies all settings immediately without a reboot…

System Management

Question

As part of the requirements for installing a new application, the swappiness parameter needs to be changed to 0. This change needs to persist across reboots and be applied immediately. A Linux systems administrator is performing this change. Which of the following steps should the administrator complete to accomplish this task?

Options

  • Aecho "vm.swappiness=0" >> /etc/sysctl.conf && sysctl -p
  • Becho "vm.swappiness=0" >> /proc/meminfo && sysctl -a
  • Csysctl -v >> /proc/meminfo && echo "vm.swapiness=0"
  • Dsysctl -h "vm.swapiness=0" && echo /etc/vmswapiness

How the community answered

(24 responses)
  • A
    71% (17)
  • B
    17% (4)
  • C
    8% (2)
  • D
    4% (1)

Explanation

To make a kernel parameter change both persistent and immediate, two steps are required. Writing vm.swappiness=0 to /etc/sysctl.conf ensures the setting survives reboots. Running sysctl -p reloads /etc/sysctl.conf and applies all settings immediately without a reboot. /proc/meminfo is a read-only virtual file providing memory statistics and cannot be written to for configuration. Options C and D contain the misspelled parameter swapiness (missing a 'p'), which would not work correctly.

Topics

#Linux Kernel Parameters#System Configuration#sysctl#Persistent Settings

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice