A Linux administrator is decommissioning a server and must securely erase all data from a specific hard drive, /dev/sdb, by overwriting it with pseudorandom data. The administrator has chosen to use the dd command for this task. Which of the following commands correctly accomplishes this goal?
The correct command is dd if=/dev/urandom of=/dev/sdb. This command reads pseudorandom data from the special device file /dev/urandom (the input file or if) and writes it directly to the target block device /dev/sdb (the output file or of), overwriting all existing data. Overwriting a drive with random data is a secure method to make the original data unrecoverable.
dd if=/dev/zero of=/dev/sdb is incorrect because /dev/zero provides a continuous stream of null characters (zeros), not random data. While this does overwrite the data, it is considered less secure than using random data because the resulting pattern is uniform.
dd if=/dev/sdb of=/dev/urandom is incorrect because it reverses the input and output, attempting to read the contents of the hard drive and write them to the /dev/urandom device, which is not the intended operation for wiping a drive.
dd if=/dev/null of=/dev/sdb is incorrect because /dev/null is a special file that discards all data written to it and provides no data when read. Therefore, this command would write nothing to the drive.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the /dev/urandom file in Linux?
Open an interactive chat with Bash
Why is /dev/urandom more secure for wiping than /dev/zero?
Open an interactive chat with Bash
What does the dd command do in Linux?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access