sgdisk 0.8.1-1build1: "--largest-new=0" option not working as documented

Bug #924028 reported by andrew bezella
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdisk (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

the man page for sgdisk(8) states that for the "--largest-new=num" option "A num value of 0 causes the program to use the first available partition number." this does not appear to be the case. using a value of 0 returns the following error:
% sgdisk --version
GPT fdisk (sgdisk) version 0.8.1
% sudo /sbin/sgdisk /dev/xenvg/9e46d655-f4b5-49bd-9e78-7df0a143119a.disk0 --largest-new=0
Could not create partition 0 from 34 to 16777182
Error encountered; not saving changes.

values >0 work and the "--new=partnum:start:end" option (also supporting 0 for the first available partition number) works as expected. from a look at the source code (gdisk-0.8.1/gptcl.cc around lines 276-307; disclaimer: i am not a coder) it appears that "largestPartNum" is tested differently than "partNum" and that the "< 0" check for largestPartNum will always evaluate as false.

thank you.

% lsb_release -rd
Description: Ubuntu 10.04.3 LTS
Release: 10.04
% apt-cache policy gdisk
gdisk:
  Installed: 0.8.1-1build1
  Candidate: 0.8.1-1build1
  Version table:
 *** 0.8.1-1build1 0
        100 /var/lib/dpkg/status
     0.5.1-1 0
        500 http://apt-mirror.us.archive.org/ubuntu/ lucid/universe Packages

Revision history for this message
James Page (james-page) wrote :

Confirmed on 12.04 as well:

sudo sgdisk --largest-new=0 /dev/vdb
Creating new GPT entries.
Could not create partition 0 from 34 to 41943006
Error encountered; not saving changes.

Changed in gdisk (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Rod Smith (rodsmith) wrote :

I'm the upstream author of GPT fdisk. This bug will be fixed in version 1.0.1, which I hope to release later today.

Revision history for this message
Rod Smith (rodsmith) wrote :

I've released GPT fdisk 1.0.1. I know it's way too late to get it into Wily, so either 1.0.1 can be SRU'd or I can provide a patch.

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.