nerdexam
CompTIA

XK0-005 · Question #314

An administrator receives a USB drive and wants to make an exact copy of the disk before starting to work on it. One of the partitions on the USB drive was mounted as /dev/sdc1. Which of the…

The correct answer is C. dd if=/dev/sdc1 of=~/usb_copy.img bs=1024. The dd command is used to make a byte-for-byte copy of a disk or partition. To copy a specific partition, the input file (if) should specify that partition, and the output file (of) should be a new image file.

System Management

Question

An administrator receives a USB drive and wants to make an exact copy of the disk before starting to work on it. One of the partitions on the USB drive was mounted as /dev/sdc1. Which of the following commands should the administrator use?

Options

  • Add if=/dev/sdc of=~/usb_copy.img bs=512
  • Bdd if=/dev/sdc1 of=~/usb_copy.img count=1024
  • Cdd if=/dev/sdc1 of=~/usb_copy.img bs=1024
  • Ddd of=/dev/sdc if=~/usb_copy.img bs=1M

How the community answered

(47 responses)
  • A
    4% (2)
  • B
    15% (7)
  • C
    74% (35)
  • D
    6% (3)

Why each option

The `dd` command is used to make a byte-for-byte copy of a disk or partition. To copy a specific partition, the input file (`if`) should specify that partition, and the output file (`of`) should be a new image file.

Add if=/dev/sdc of=~/usb_copy.img bs=512

`if=/dev/sdc` would copy the entire disk, not just the specified partition `/dev/sdc1`, which is not what the question asks for.

Bdd if=/dev/sdc1 of=~/usb_copy.img count=1024

The `count` option limits the number of blocks copied and is not typically used for making an exact copy of an entire partition unless the exact size is known and specific blocks are desired.

Cdd if=/dev/sdc1 of=~/usb_copy.img bs=1024Correct

The `dd` command is used for low-level copying of data. `if=/dev/sdc1` correctly specifies the input as the partition to be copied, `of=~/usb_copy.img` correctly specifies the output as a new image file, and `bs=1024` sets the block size for the copy operation.

Ddd of=/dev/sdc if=~/usb_copy.img bs=1M

This command is incorrect because `of=/dev/sdc` means the image would overwrite the original disk, and `if=~/usb_copy.img` means the source is an existing image, which is the reverse of what is needed.

Concept tested: Linux disk imaging with dd

Source: https://man7.org/linux/man-pages/man1/dd.1.html

Topics

#dd command#disk imaging#partition management#Linux utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice