Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
,1,L,*
,,L;
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
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

1 Answer 1

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

 
discard

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.