fdisk: add support for partition resizing#2570
Conversation
| MENU_ENT ('t', N_("change a partition type")), | ||
| MENU_BENT_E('v', N_("verify the partition table"), FDISK_DISKLABEL_BSD), | ||
| MENU_ENT ('i', N_("print information about a partition")), | ||
| MENU_ENT ('e', N_("resize a partition")), |
There was a problem hiding this comment.
Better ideas for the menu character are very welcome.
'r' is already used unfortunately.
|
I'm unsure if fdisk_ask_number() is the right way to request the new size. The cfdisk has a private function that uses parses_size(), so you can specify the new size as
|
I like this the most, thanks for the suggestion! |
eecd02a to
ecf649d
Compare
|
|
||
| fdisk_partition_size_explicit(npa, 1); | ||
|
|
||
| rc = strtosize_sectors(response, fdisk_get_sector_size(cxt), &size); |
There was a problem hiding this comment.
It would also be nice to check if the result from the user is in the valid range size > 0 && size <= max_size
There was a problem hiding this comment.
And probably also provide any feedback for the user, "Could not resize partition" seems not enough :-)
There was a problem hiding this comment.
size can't be negative because it's unsigned.
Fixes util-linux#2555 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Fixes #2555