CompTIA Linux+ (XK0-005) — Question 100
A Linux administrator needs to create an image named sda.img from the sda disk and store it in the /tmp directory. Which of the following commands should be used to accomplish this task?
Answer options
- A. dd of=/dev/sda if=/tmp/sda.img
- B. dd if=/dev/sda of=/tmp/sda.img
- C. dd --if=/dev/sda --of=/tmp/sda.img
- D. dd --of=/dev/sda --if=/tmp/sda.img
Correct answer: B
Explanation
The correct command is B because it correctly specifies 'if' (input file) as /dev/sda and 'of' (output file) as /tmp/sda.img, which is the proper syntax for the dd command. Option A is incorrect because it has 'of' and 'if' swapped. Options C and D are also incorrect due to the improper use of '--' for the dd command options.