sfdisk --force says it can correct a size mismatch, but then fails.

Bug #1916645 reported by Kevin O'Gorman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

Trying to restore a GPT partition table using a dump sfdisk previously created from a larger disk to a smaller one (but has enough room for the partitions) fails. I'm using the --force option to try to make this work. It doesn't. The first line of the output (with added blank lines for readability) is

GPT PMBR size mismatch (494403583 != 234441647) will be corrected by write.

this ought to be reassuring, but then I get

Last LBA specified by script is out of range.

Last LBA specified by script is out of range.

Last LBA specified by script is out of range.

Failed to apply script headers, disk label not created.

Leaving.

And there was then a crippled disk label that I had to erase (wipefs) before I could try again. What actually worked for me was editing the output from --dump to remove the line with "last-lba". Then it worked without even the warnings.

I would suggest some fixes: (1) don't say it will be corrected if you're not going to finish, (2) don't write a label -- corrupted or not -- if you say "label not created", and (3) make the --force option override all of that and make it work.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: fdisk 2.34-0.1ubuntu9.1
ProcVersionSignature: Ubuntu 5.4.0-62.70-generic 5.4.78
Uname: Linux 5.4.0-62-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.14
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue Feb 23 10:45:04 2021
InstallationDate: Installed on 2020-07-12 (225 days ago)
InstallationMedia: Xubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.