Server Fault is a question and answer site for system and network administrators. 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'm trying to create disk image with 2 partitions: First partition: 1Mb for boot and second partition of the maximum capacity

  dd if=/dev/zero of=flash.img bs=1M count=10
  /sbin/sfdisk flash.img -uM << SFDISK_EOF

I got an error:

sfdisk: I don't like these partitions - nothing changed.

What I'm doing wrong?

I'm working with CentOS

share|improve this question
Might be simplest to use regular fdisk to partition the image once manually, and then use sfdisk -uM -d to dump the partition info into a file or standard output. The dumped output may highlight a critical error in your commands. – Mike Renfro Jun 18 '11 at 18:17
up vote 1 down vote accepted

it's 2011, why don't you use something more user-friendly like cfdisk? I've used sfdisk once a time in a bash script for an automated OS rescue system, not on ordinary system administration.

share|improve this answer
the cfdisk is not part of the CentOS distribution, this is the reason why I'm using sfdisk. Anyway, I increased image size and problem is gone... – Dima Jun 19 '11 at 22:53

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.