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

  • 1
    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

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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