Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write a .raw file to the first partition of my external drive. I tried: dd if=file of=/dev/sdb3 but it didn't give me a bootable drive since the correct command should had been: dd if=file of=/dev/sdb. But would this command destroy data on the other two partitions that I have on the drive, or only on the first partition?

share|improve this question
The first partition on your disk dev/sdb is dev/sdb1. Writing to dev/sdb will start at sector 0 of the disk, which is not in any of the partitions. The command dd knows nothing about partition boundaries. – kreemoweet Dec 25 '12 at 20:37
up vote 1 down vote accepted
  1. It would destroy the partition table, since that's stored at the beginning of the drive.

  2. It would destroy as much drive contents as the size of the image itself. If it is large enough to reach into the second or third partitions then it will destroy those.

  3. MEMDISK will allow you to leave it as an image and boot it directly.

share|improve this answer

As long as you have proper partition table, the process should erase only the partition, it won't extend to next partition on disk. If you need proper partition table, try running fsck on this disk or fix the partition table or, if it is Windows disk, running fixmbr and fixboot would be the solution.

For sure, use sdb1, NOT sdb! Sdb is the whole disk beginning with the partition. Sdb1 is the first partition, sdb2 the second, and so on...

share|improve this answer
I would think about running GParted to check this disk for proper MBR and partitions. From a live CD/DVD, pendrive or external USB disk. – pbies Dec 25 '12 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .