Project

General

Profile

Submit #3276

Add option controlling whether gpt expand expands the last partition (needs testing)

Added by falsifian 26 days ago. Updated 20 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
05/26/2021
Due date:
% Done:

0%

Estimated time:

Description

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) expand.patch falsifian, 05/26/2021 09:40 PM

History

#1

Updated by falsifian 20 days ago

It looks like the new GPT partition table doesn't cover the whole disk. E.g. the the "Usable LBA" reported by OpenBSD's fdisk showed the old disk's size.

I was able to fix it by running parted on Linux. It noticed the problem and offered to fix it automatically.

I don't know if this was already a problem with Dfly's gpt or if my patch introduces the problem.

Also available in: Atom PDF