Bug 1249893
Summary: | sfdisk: Clarification of "+" and "-" as size arguments | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Ian Wienand <iwienand> | ||||
Component: | util-linux | Assignee: | Karel Zak <kzak> | ||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 22 | CC: | iwienand, jonathan, kzak | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-08-05 07:24:06 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Ian Wienand
2015-08-04 05:12:15 UTC
The "-" has no any meaning, it's just place-holder to support formats without delimiters, like "2048 - L *". Note that "-<num>" means reduce size. The unspecified size field means "follow the label driver default" -- it's usually all available space for a new partition. The "+" calls generic resize code if used for *already existing partition*, if the partition does not exist then it's the same as the previous case (driver default). For example: 2048 , , L 2048, -, L 2048, +, L all have the same meaning, for empty disk, but echo "2048, +, L" | sfdisk -N 1 /dev/sdb enlarge the first partition (-N 1) as much as possible. So, it depends on context, for empty disks where you create a new partitions (fdisk_add_partition()) it's always driver default, for existing partition it's about resizing (fdisk_set_partition()). Note that the parser in the script.c has no clue about the current disk layout, it's the reason why it sets fdisk_partition_end_follow_default() as well as FDISK_RESIZE_ENLARGE for alone "+". The final interpretation depends on used function (fdisk_{add,set}_partition()). Please, close if you have enough information :-) Thanks. Created attachment 1059296 [details]
clarification for sfdisk man page
Thank you for the info. Do you think something like the attached patch might help clarify the sfdisk man page?
(In reply to Ian Wienand from comment #2) > Do you think something like the attached patch > might help clarify the sfdisk man page? Applied, thanks. https://github.com/karelzak/util-linux/commit/11aa2aa290d2d654d621bd4729b535234480734b The change will be available in f23. |