Add option to sfdisk to use maximum partition size

Bug #686124 reported by Alex Bligh
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Fix Released

Bug Description

Binary package hint: util-linux

The attached patch adds the ability to make a partition the maximum size possible. This gives the equivalent functionality to omitting the size parameter in the input, but works with -N too. So this lets you resize a partition to maximum size by

  echo ",+," | sfdisk -N1 /dev/sda

This is non-trivial to do without the patch as -N makes the default size the existing size. As there is (without this patch) no way of reading the maximum size, the only option is to delete the partition and recreate it.

This is needed for cloud-init to resize an image on first boot.

Related branches

Revision history for this message
Alex Bligh (ubuntu-alex-org) wrote :
tags: added: patch
Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Alex Bligh (ubuntu-alex-org) wrote :

This patch has now been applied upstream:

author Karel Zak <email address hidden> Thu, 9 Dec 2010 22:13:58 +0000 (23:13 +0100)
committer Karel Zak <email address hidden> Thu, 9 Dec 2010 22:13:58 +0000 (23:13 +0100)
commit f30f2bbc81ad37cdd8f50485e41550dbbd82275d
tree 97304a577f5b0d2dc93040c5777ac05b6f1a5fd3
parent 8aa504664794150c2d64923e2a63341a2b56e065;a=commit;h=f30f2bbc81ad37cdd8f50485e41550dbbd82275d

It would be useful to ensure this reaches Natty.

Revision history for this message
Scott Moser (smoser) wrote :

This is ready to go. I have a feature I'd like to get in that is much more easily done with it. Please review and pull.

Changed in util-linux (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.17.2-3.3ubuntu2

util-linux (2.17.2-3.3ubuntu2) natty; urgency=low

  * sfdisk: pull upstream support for '+' to specify maximum size for a
    partition when using -N. (LP: #686124)
  * remaining changes:
    - Since udev is required in Ubuntu, the init script is
      not called on startup and the init script is
    - Use wildcards for symbols file, since they use versioned symbols
    - Remove /etc/adjtime on upgrade if it was not used.
    - Install custom blkid.conf to use /dev/ since we don't
      expect device names to survive a reboot
    - No lsb_release call in mount.preinst since we'd need Pre-Depends
      (LP: #383697).
    - Do not install initramfs hook, since our initramfs already handles
      including blkid.
    - Mention mountall(8) in fstab(5) manpages, along with its special
    - For the case where mount is called with a directory to mount, look
      that directory up in mountall's /lib/init/fstab if we couldn't find
      it mentioned anywhere else. This means "mount /proc", "mount /sys",
      etc. work.
    - sfdisk support for '+' with '-N' (LP: #686124)
 -- Scott Moser <email address hidden> Tue, 04 Jan 2011 20:56:59 -0500

Changed in util-linux (Ubuntu):
status: Triaged → Fix Released
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.