[DragonFlyBSD - Submit #3276] Add option controlling whether gpt expand expands the last partition (needs testing)
sigttou
bugtracker-admin at leaf.dragonflybsd.org
Wed Sep 23 03:30:17 PDT 2026
Issue #3276 has been updated by sigttou.
File gpt-expand-n-master.patch added
File gpt-expand-x.v2.patch added
The posted patch no longer applies to master: sbin/gpt/expand.c was
rewritten in f4b4c056f1 ("gpt(8): Refactor and improve \"expand\" command",
2025-09-01), which also fixed the two bugs the original patch addressed.
The requested feature is still missing. Since current master always expands
the last partition, the new option disables that instead of enabling it:
<pre>
gpt expand expand the GPT and the last partition (unchanged)
gpt expand -n expand only the GPT; leave the last partition untouched
</pre>
Attached: gpt-expand-n-master.patch (master).
gpt-expand-x.v2.patch is the equivalent for the 6.4 branch, if wanted.
Unrelated: a regression in the rewritten expand code is tracked as #3422.
----------------------------------------
Submit #3276: Add option controlling whether gpt expand expands the last partition (needs testing)
http://bugs.dragonflybsd.org/issues/3276#change-14700
* Author: falsifian
* Status: New
* Priority: Normal
* Target version: 6.4
* Start date: 2021-05-26
----------------------------------------
Just today I needed a version of the "gpt expand" command that doesn't extend the last partition. The attached patch adds a -x option; the last partition is only expanded if -x is specified.
I have done minimal testing:
- I successfully used it without -x after copying my laptop's data to a larger SSD, leaving plenty of space at the end for me to install DragonflyBSD on top of the two existing OSs :-)
- I did a really quick test with the -x option on a hastily created vnode disk initialized with gpt init. I just verified that after expanding with -x, the Dfly partition got bigger.
I'm happy to do more testing if requested, though I'm not sure exactly what to try.
(This patch changes the default behaviour. I suppose it could be reversed, but a "don't expand the last partition option" seems a bit more convoluted conceptually.)
Patch is vs. commit 42a874b478.
---Files--------------------------------
expand.patch (6.65 KB)
gpt-expand-n-master.patch (2.1 KB)
gpt-expand-x.v2.patch (4.72 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Submit
mailing list