summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk-list.c
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: use 2 decimal places for size in disk summaryKarel Zak2019-02-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In the disk summary it seems nice, but I'm not sure about lists (SIZE columns). It seems more readable to keep the lists with one decimal place only. New output: # sfdisk --list /dev/sda Old output: Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors New output: Disk /dev/sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors The rest is unchanged: ... Device Start End Sectors Size Type /dev/sda1 2048 411647 409600 200M EFI System /dev/sda2 411648 821247 409600 200M Linux filesystem /dev/sda3 821248 274087935 273266688 130.3G Linux filesystem /dev/sda4 274087936 378945535 104857600 50G Linux filesystem /dev/sda5 378945536 468862094 89916559 42.9G Linux filesystem Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1673452 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add "Disk model:" to the print outputKarel Zak2018-08-301-0/+3
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/682 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use new ul_path_* APIKarel Zak2018-06-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private Stratis devicesTony Asleson2018-03-091-1/+1
| | | | | | | | [kzak@redhat.com: - tiny coding style changes] References: 20e1c3dc03399d6988ef35dedc1364cfc12e9263 Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't use CDROM_GET_CAPABILITY ioctl for DM devicesKarel Zak2017-07-121-1/+1
| | | | | | | | | For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64 add extra warning when the ioctl is used for DM devices. It seems we can avoid this ioctl when the device has dm/uuid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate usage() "Available columns"Karel Zak2017-06-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate smartcols error messagesKarel Zak2017-05-181-3/+8
| | | | | | ... just to keep translators happy Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: check scols_line_refer_data() return code [coverity scan]Karel Zak2017-05-171-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: inform on 'p' about wiped partitionsKarel Zak2017-05-091-0/+7
| | | | | | | | | | | | | | | The wipe operation is potentially dangerous. Let's inform about it always by 'p' (list) command to make sure user knowns about it. Command (m for help): p ... Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 204799 202752 99M 83 Linux Filesystem/RAID signature on partition 1 will be wiped. Addresses: https://github.com/karelzak/util-linux/issues/437 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: support empty label use-caseKarel Zak2016-11-301-8/+15
| | | | | | | | | | | | | | | By default sfdisk creates partition table when a first partition is specified, otherwise the device is not modified. This force users to create at least one partition. This commit allows to create empty label without partitions if "label: <name>" header line is specified by script. The commit also modifies "New situation:" output to list label name and label identifier. Addresses: https://github.com/karelzak/util-linux/issues/374 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix memleak in list_disk_geometry()Ruediger Meier2016-10-271-1/+3
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* docs: fix typos found by codespellRuediger Meier2016-02-031-1/+1
| | | | | | Using "codespell" from https://github.com/lucasdemarchi/codespell Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/tty: Pass default width to get_terminal_width()Boris Egorov2016-01-061-3/+1Star
| | | | | | | | | | Almost any code calling get_terminal_width() checks returned width for non-positive values and sets it to some default value (say, 80). So, let's pass this default value directly to the function. [kzak@redhat.com: - get_terminal_width() refactoring] Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: don't print extra linebreaks on --quietKarel Zak2015-07-301-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add 'F' command to list free unpartitioned spaceKarel Zak2015-07-281-0/+122
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add new API to read label specific dataKarel Zak2015-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * removes list() label operation from internal API The list() has been based on fdisk_info() it was useless for anything else than print on stdout... * add a new get_item() label operation and fdisk_get_disklabel_item() public API The new API provides abstract and pretty simple way how to get label specific disk label information, for example fdisk_get_disklabel_item(cxt, GPT_LABELITEM_ENTRIESLBA, &iterm); return LBA of the array with GPT entries. Note that this patch does not implement public functions to get data from the @item object. * removes get_id() label operation -- it's subset of the new get_item() * the new internal API is also used to implement backwardly compatible fdisk_list_disklabel() and fdisk_get_disklabel_id() Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: fix string_add_to_idarray() int vs. size_tKarel Zak2015-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | The function uses "int" as argument, but for array size (and index) is better to use unsigned type (size_t). If we mix "size_t" in util (e.g. fdisk) and "int" in lib/strutils.c then result is unexpected behavior on ppc64. # sfdisk --list -o DEVICE,START,SIZE /dev/sdb Disk /dev/sdb: 50 MiB, 52428800 bytes, 102400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Disklabel type: gpt Disk identifier: 3B8559DB-33AF-43E9-BEFC-C331D829B539 lt-sfdisk: libfdisk/src/label.c:178: fdisk_label_get_field: Assertion `id > 0' failed. The patch cleanup all code to use size_t everywhere. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, sfdisk: fix -o <list> backendKarel Zak2015-04-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: actually translate the table headers by calling gettext()Benno Schulenberg2015-02-021-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix spellos and inconsistencies in several program messagesBenno Schulenberg2015-01-261-3/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fdisk: fix and improve -l warningsKarel Zak2014-11-071-2/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make it possible to use zero for size and startKarel Zak2014-10-151-0/+2
| | | | | | | | | | | | | | | | The zero may be valid size and start of the partition. This patch introduces: fdisk_partition_has_start() fdisk_partition_has_size() fdisk_partition_unset_size() fdisk_partition_unset_start() to make it possible to work with zero. The feature is internally implemented by magic constant ((type) -1) for undefined sizes and offsets. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: reset cached output fields when change disk labelKarel Zak2014-10-091-5/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix typoKarel Zak2014-10-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add --output <list> for print command(s)Karel Zak2014-10-071-2/+116
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add --verifyKarel Zak2014-10-071-5/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: refactor /proc/partitions usageKarel Zak2014-10-071-33/+46
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: improve --list outputKarel Zak2014-10-071-0/+241
Signed-off-by: Karel Zak <kzak@redhat.com>