Linux Foundation Certified System Administrator (LFCS) — Question 7
Which of the following commands overwrites the bootloader located on /dev/sda without overwriting the partition table or any data following it?
Answer options
- A. dd if=/dev/zero of=/dev/sda bs=512
- B. dd if=/dev/zero of=/dev/sda bs=512 count=1
- C. dd if=/dev/zero of=/dev/sda bs=440 count=1
- D. dd if=/dev/zero of=/dev/sda bs=440
Correct answer: C
Explanation
The correct answer is C because it specifically writes 440 bytes to /dev/sda, which is the size of the bootloader, while leaving the rest of the disk intact. Option A writes 512 bytes, which would overwrite the partition table, and option B does not affect the partition table but writes too much data. Option D writes 440 bytes but doesn't limit the count, which might lead to unintended overwrites.