0

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

Dima
  • 485
  • 3
  • 7
  • 15
  • 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 Answers1

0

Why don't you use something more user-friendly like cfdisk? It's not really supposed to be used outside of a script.

Giovanni Toraldo
  • 2,587
  • 19
  • 27
  • 1
    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