Skip to content

sfdisk: "line 5: unsupported command" on sector-size #1080

@zimbatm

Description

@zimbatm

Still debugging this issue. This is breaking the cloud-utils growpart script.

The TL;DR is that sfdisk emits a "sector-size" line which is not understood as a command when applying that back.

# uname -a
Linux <snip> 5.4.46 #1-NixOS SMP Wed Jun 10 18:24:58 UTC 2020 x86_64 GNU/Linux
# sfdisk --version
from util-linux 2.35.1
# sfdisk --unit=S  --dump /dev/sda | tee out.dump
label: dos
label-id: 0x6aacd6ae
device: /dev/sda
unit: sectors
sector-size: 512

/dev/sda1 : start=        2048, size=   122875904, type=83
# sfdisk --force /dev/sda < out.dump
Checking that no-one is using this disk right now ... FAILED

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

Disk /dev/sda: 300 GiB, 322122547200 bytes, 629145600 sectors
Disk model: PersistentDisk  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x6aacd6ae

Old situation:

Device     Boot Start       End   Sectors  Size Id Type
/dev/sda1        2048 122877951 122875904 58.6G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> line 5: unsupported command

New situation:
Disklabel type: dos
Disk identifier: 0x6aacd6ae

Device     Boot Start       End   Sectors  Size Id Type
/dev/sda1        2048 122877951 122875904 58.6G 83 Linux
Leaving.

Activity

zimbatm

zimbatm commented on Jun 29, 2020

@zimbatm
Author

Nevermind, this seems to be fixed for the next release: d8c68b5

zimbatm

zimbatm commented on Jun 29, 2020

@zimbatm
Author

closing as duplicate of #949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zimbatm

        Issue actions

          sfdisk: "line 5: unsupported command" on sector-size · Issue #1080 · util-linux/util-linux