201-450 practice question 8 of 25

Which of the following commands erases the contents of the /dev/sdb3 partition?

Full set: 161 questions
Answer options
A: rm /dev/sdb3
B: dd if=/dev/zero of=/dev/sdb3 Correct answer
C: dd of=/dev/zero if=/dev/sdb3
D: umount /dev/sdb3
Correct Answer:
B. dd if=/dev/zero of=/dev/sdb3
Explanation

The dd command is a utility for raw data copying. The command dd if=/dev/zero of=/dev/sdb3 specifies /dev/zero as the input file (if) and the partition /dev/sdb3 as the output file (of). The /dev/zero device produces an infinite stream of null characters. By writing this stream to /dev/sdb3, the command overwrites every block of the partition with zeros, thereby completely erasing all data previously stored on it.

Why Incorrect

A. rm /dev/sdb3 deletes the special device file in /dev, but does not touch the actual data on the partition.
C. dd of=/dev/zero if=/dev/sdb3 reads the partition's data and sends it to /dev/zero, which discards it. The partition itself remains unchanged.
D. umount /dev/sdb3 simply detaches the filesystem from the directory tree. It is a prerequisite for safe erasure but does not perform it.

References

- GNU Coreutils. (2020). "dd: Convert and copy a file". In GNU Coreutils manual. Free Software Foundation. Section 12.1 dd invocation. Retrieved from https://www.gnu.org/software/coreutils/manual/htmlnode/dd-invocation.html

- Linux man pages. (2021). dd(1) — Linux manual page. Retrieved from https://man7.org/linux/man-pages/man1/dd.1.html

- MIT OpenCourseWare. (2019). Lecture 1: The Shell. In 6.NULL The Missing Semester of Your CS Education. Massachusetts Institute of Technology. (Covers core utilities like dd).

Scroll to Top