Lpic 1 Linux Administrator · Free Practice Question Medium
Question 13
After creating a Linux swap partition on /dev/sdb3, which sequence of commands should be executed to activate the swap space?
- A swapon /dev/sdb3
- B mkswap /dev/sdb3; swapon /dev/sdb3
- C swapon /dev/sdb3; mkswap /dev/sdb3
- D swapctl /dev/sdb3
Reveal correct answer
Correct answer: B
A.
Incorrect. The swapon command activates swap space, but it requires that the partition is prepared with mkswap first to initialize it as swap space.
B.
Correct. The mkswap command initializes the partition for swap, and swapon then activates it as usable swap space.
C.
Incorrect. The sequence is incorrect. mkswap must be used before swapon to prepare the partition as swap space.
D.
Incorrect. swapctl is not a standard Linux command for managing swap; mkswap and swapon are the correct commands.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
