Util-Linux package development
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: Thomas Bechtold <tbechtold@suse.com>
Cc: util-linux@vger.kernel.org
Subject: Re: sfdisk input parsing broken with 2.26.1
Date: Thu, 16 Apr 2015 13:51:22 +0200	[thread overview]
Message-ID: <201504161351.23675.sweet_f_a@gmx.de> (raw)
In-Reply-To: <552F87E5.5010507@suse.com>

On Thursday 16 April 2015, Thomas Bechtold wrote:
> [please CC me - I'm not subscribed to the list]
>
> Hi,
>
> the following worked fine with 2.20 (tested on Ubuntu):
>
> sfdisk $IMAGE_BLOCK_DEVICE << EOF
> 1 - - *
> 0 0;
> 0 0;
> 0 0;
> EOF


BTW I've noticed that since 2.26 --dump produces incompatible dump 
files. Shouldn't we have at least backward compatibility, i.e. old 
dumps still work with new sfdisk?

If you dump the above example with sfdisk 2.23.2 then 2.26 cant't use 
it.

## Dump with old sfdisk:

$ sfdisk -d /tmp/image > /tmp/p1
$ cat /tmp/p1
# partition table of /tmp/image
unit: sectors

/tmp/image1 : start=    16065, size=209696445, Id=83, bootable
/tmp/image2 : start=        0, size=        0, Id= 0
/tmp/image3 : start=        0, size=        0, Id= 0
/tmp/image4 : start=        0, size=        0, Id= 0
----------------

## Write back with new sfdisk:

$ ./sfdisk /tmp/image < /tmp/p1
Checking that no-one is using this disk right now ... OK

Disk /tmp/image: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Old situation:

Device      Boot Start       End   Sectors  Size Id Type
/tmp/image1 *    16065 209712509 209696445  100G 83 Linux

>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0xdf10c8b1.
Created a new partition 1 of type 'Linux' and of size 100 GiB.
Start sector 0 out of range.
Failed to add partition: Numerical result out of range
/tmp/image2: Leaving.
-------------

cu,
Rudi

  parent reply	other threads:[~2015-04-16 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  9:59 sfdisk input parsing broken with 2.26.1 Thomas Bechtold
2015-04-16 11:24 ` Karel Zak
2015-04-16 11:51 ` Ruediger Meier [this message]
2015-04-16 16:05   ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201504161351.23675.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=tbechtold@suse.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox