Skip to contentSkip to conversation

sfdisk: dump format changed in 2.26

DISCUSSION Tzafrir Cohen 2 participants 2 messages Nov 19, 2015 – Nov 24, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hi,

Is dumping and restoring accross versions of sfdisk supported?

The sfdisk man page documents using --dump to dump partitions of a system and later restore them by feeding them to sfdisk from the standard input.

The format of this dump has changed in the rewrite in version 2.26, and thus a dump generated by newer distributions cannot be used by existing ones.

New versions seem to be able to use old dumps.

A simple script I use here to convert new format to old:

sed \
        -e 's/type=/Id=/' \
        -e '/^label:/d' \
        -e '/^label-id:/d' \
        -e '/^device:/d' \
        #
Quoted 1 line

From what I could see, "Id" was changed to "type" in the body and

various extra header lines were added. Al of those changes make the dump file unreadable by older versions.

Is there any intention to support some sort of compatibility through an extra option?

Asked originally on https://bugs.debian.org/805277

Signature · 4 lines
Tzafrir Cohen         | [email protected] | VIM is
http://tzafrir.org.il |                    | a Mutt's
[email protected] |                    |  best
[email protected]    |                    | friend
maintainer
#1 lore raw
Quoted 1 line · Tzafrir Cohen

New versions seem to be able to use old dumps.

This has been the most important :-)

Quoted 9 lines

A simple script I use here to convert new format to old:

sed \
        -e 's/type=/Id=/' \
        -e '/^label:/d' \
        -e '/^label-id:/d' \
        -e '/^device:/d' \
        #
Quoted 6 lines

From what I could see, "Id" was changed to "type" in the body and various extra header lines were added. Al of those changes make the dump file unreadable by older versions.

Is there any intention to support some sort of compatibility through an extra option?

I'm not sure if we really need (and want) to provide compatibility in this way. Maybe we can add the sed command to the man page.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com