Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

How can I dd an image of a single partition out of a full-disk image? I know skip and count, but I am supposed to divide by bs, and since this is the first partition, it's start point is early in the image and dd says the number is not valid for skip. After playing around a bit, I get an image that's roughly the right size but parted can't read it. I also tried without a bs (bs=1 presumably), and this also appears to copy the right amount of data, but parted still can't read the image.

I can mount with offset but I want the whole partition block and I don't know if mounting and dding the mountpoint is going to give me something suitable to copy directly back onto the disk. I just want to restore a single partition to the disk and leave the others alone. I'd like to split the partition into its own image file first so I can confirm it looks the way I want.

share|improve this question
Let me check if I understand you correctly. You have the output of something like dd if=/dev/sda of=file, and you want something that looks like the output of dd if=/dev/sda1 of=file? – justarobert Apr 3 '11 at 23:11
Yes, that is correct. – user31557 Apr 4 '11 at 3:37
up vote 1 down vote accepted

Use kpartx to create device nodes for each of the partitions within the image.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.