summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
* mkswap: fix page size warning messageNoel Cragg2018-11-291-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: disable --activate for Hybrid GPT/MBRKarel Zak2018-10-041-0/+3
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/699 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: be more verbose about PMBR on --activateKarel Zak2018-10-042-0/+5
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/699 Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: properly copy disk nameKarel Zak2018-10-031-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: accept grain script headerKarel Zak2018-09-121-0/+5
| | | | | | | | | | | | The "grain" variable is used to calculate partitions alignment. The default is 1MiB (or minimal I/O size). The libfdisk provides API to overwrite this default, but this feature has been nowhere accessible for end-user. This patch support for "grain: <size>" in libfdisk scripts. Addresses: https://github.com/karelzak/util-linux/issues/688 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: document script GPT headersKarel Zak2018-09-121-0/+9
| | | | | | Add first-lba, last-lba and table-length to the sfdisk man page. 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>
* Fix man page typosJakub Wilk2018-08-162-2/+2
| | | | Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
* man pages: Remove "left" (or change to "l") in the column formats of tablesBjarni Ingi Gislason2018-08-061-1/+1
| | | | | | | | | A developmental version of "groff" issued a warning, for example with "test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z": troff: <logger.1>:299: warning: can't find font 't' Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* fdisk: fix error message on 'd' commandKarel Zak2018-08-011-2/+4
| | | | | | | | | | | Command (m for help): d No partition is defined yet! Could not delete partition 93840461057817 <--- ! Don't print 'Could not delete..' if no partition is defined yet. Addresses: https://github.com/karelzak/util-linux/issues/667 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: Accept negative numbers for last sector inputAwal Garg2018-07-312-7/+12
| | | | | | | | [kzak@redhat.com: - add note to the man page - add '-' to the dialog query - cleanup functions names and libfdisk.sym] Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove redundant conditionKarel Zak2018-07-181-1/+1
| | | | | | | util-linux-2.32.1/disk-utils/mkfs.cramfs.c:362]: (style) Redundant condition: If 'EXPR >= 16777216', the comparison 'EXPR' is always true. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use new ul_path_* APIKarel Zak2018-06-211-12/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: use new ul_path_* APIKarel Zak2018-06-211-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* resizepart: use new ul_path_* APIKarel Zak2018-06-211-8/+10
| | | | 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>
* partx: exit with error code when partition read failedAndreas Henriksson2018-06-181-1/+3
| | | | | | | | | | | | | | | | | | | Make sure partx exits with a non-0 return code when it runs into either code-path where getting the partition table failed (or wasn't even attempted because of previous error condition). Change was tested using: touch /tmp/foobar partx -s - /tmp/foobar Previously that was only printing an error/warning message and then exiting with 0, but after this change it exits with 1. Signed-off-by: Andreas Henriksson <andreas@fatal.se> Reported-by: Juan Céspedes <cespedes@debian.org> Addresses: https://bugs.debian.org/898426
* nls: remove translation stringsSami Kerola2018-05-281-1/+1
| | | | | | | | | | While looking earlier commit I noticed everything but formatting was removed from a message in namei.c file. That inspired me to look if there are more strings that does not need translation project attention. This change removes at least some of them, if not all. Reference: e19cc7b65b31c57f0fe9cb73c9afad5197796f82 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: fix compiler warnings, follow-up 7085f1e4 (#636)Ruediger Meier2018-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Seen on OSX 10.13, xcode 9.3. disk-utils/cfdisk.c:1860:45: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] DBG(UI, ul_debug("get_size (default=%ju)", *res)); ~~~ ^~~~ %llu disk-utils/cfdisk.c:267:60: note: expanded from macro 'DBG' #define DBG(m, x) __UL_DBG(cfdisk, CFDISK_DEBUG_, m, x) ^ ./include/debug.h:67:4: note: expanded from macro '__UL_DBG' x; \ ^ disk-utils/cfdisk.c:1889:25: error: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'uintmax_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types] rc = parse_size(buf, &user, &pwr); /* parse */ ^~~~~ ./include/strutils.h:15:51: note: passing argument to parameter 'res' here extern int parse_size(const char *str, uintmax_t *res, int *power); ^ 2 errors generated. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* cfdisk: use uint64_t to avoid compiler warningsKarel Zak2018-05-241-11/+11
| | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
* man: Use the correct macro for a font change of one argumentBjarni Ingi Gislason2018-05-233-4/+4
| | | | | | | | Use the correct macro (I, B) for the font change of one argument, not those that are used for alternating two fonts, like "BR", "IR", "RB", or "RI". Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* Merge branch 'output-all' of https://github.com/kerolasa/lelux-utiliteetitKarel Zak2018-05-102-1/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'output-all' of https://github.com/kerolasa/lelux-utiliteetit: zramctl: add --output-all option swapon: add --output-all option rfkill: add --output-all option partx: add --output-all option lsns: add --output-all option lsmem: add --output-all option lslogins: add --output-all option lslocks: add --output-all option lscpu: add --output-all option losetup: add --output-all option findmnt: add --output-all option
| * partx: add --output-all optionSami Kerola2018-05-032-1/+11
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | fdisk: fix typo in debug stringVaclav Dolezal2018-05-091-1/+1
|/ | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* fdisk: fix compiler warning [-Wmaybe-uninitialized]Karel Zak2018-05-031-1/+1
| | | | | Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix missing prototype for `get_wch`Patrick Steinhardt2018-04-111-0/+4
| | | | | | | | | | | | The header <ncursesw/ncurses.h> defines the get_wch(3) function only when `NCURSES_WIDECHAR` is defined. This define is actually getting set in the same header file, but only in case `_XOPEN_SOURCE` is defined and has a value of 500 or higher. As we already have the precedence of defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply define it to the minimum required value of 500 in "cfdisk.c". This silences a warning for `get_wch` being unknown. Signed-off-by: Patrick Steinhardt <ps@pks.im>
* libfdisk: (docs) update yearKarel Zak2018-03-202-2/+2
| | | | 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>
* fsck: cleanup find_fsck()Karel Zak2018-02-191-6/+14
| | | | | | | | * remove static variable * return 0 or 1 * optionally return allocated path to the program Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'maybe-for-v2.32' of https://github.com/rudimeier/util-linuxKarel Zak2018-02-163-3/+3
|\ | | | | | | | | | | | | | | | | * 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux: tests: use pgrep instead of ps --ppid ... misc: fix typos using codespell lsns: fix clang compiler warning tests: add udevadm settle to sfdisk/resize build-sys: disable bz2 tarball and fix some am warnings
| * misc: fix typos using codespellRuediger Meier2018-02-163-3/+3
| | | | | | | | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fsck: coding style cleanupKarel Zak2018-02-161-2/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | fsck: use xasprintf to avoid buffer overruns with an insane fs typeTheodore Ts'o2018-02-161-6/+9
|/ | | | | | | | | This prevents a crash when running the command: fsck -t AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA /dev/sda Reported-by: Hornseth_Brenan@bah.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* fsck.cramfs: fix error messageRuediger Meier2018-01-241-1/+6
| | | | | | errno is invalid in case that we just read(3) too short. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: fix crash when superblock size is too smallRuediger Meier2018-01-241-1/+1
| | | | | | | | | | | This hopefully fixes the original problem addressed by the reverted patch 7cb962c7. The bug was introduced by myself in f991dbd3 "fsck.cramfs: allow smaller superblock sizes" CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Revert "fsck.cramfs: Fix bus error on broken file system."Ruediger Meier2018-01-241-7/+6Star
| | | | | | | | | | | | | | | | | | This reverts commit 7cb962c77015e9383b53eeb22ce732cb5216bbc3. It can't be right that we mmap (start + super.size) bytes from a file which is usually only super.size bytes large. The patch "fixed" a problem when super.size is bad but now it fails for the correct case: $ mkdir -p root/subdir $ ./mkfs.cramfs -p root cramfs $ ./fsck.cramfs cramfs Bus error (core dumped) We will fix the original problem later. CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* sfdisk: add hint about udev and flock to the man pageKarel Zak2018-01-171-0/+16
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/563 Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak2018-01-173-3/+3
| | | | | | | Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: cleanup shortcuts in man page tooKarel Zak2018-01-121-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (script) support R (RAID) and V (LVM) shortcutsKarel Zak2018-01-092-2/+8
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/560 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: extend API to provide label specific geometry rangesKarel Zak2018-01-021-8/+26
| | | | | | | Now fdisk provides DOS specific geometry ranges in expert menu. Addresses: https://github.com/karelzak/util-linux/issues/556 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: wait before re-readKarel Zak2018-01-021-1/+8
| | | | | | | | | | | | The original old (v2.13) fdisk had sleep(2) beany ideafore re-read ioctl. It seems overkill, but short sleep is probably a good idea as we call re-read on sfdisk start and at the end. It's possible that sfdisk is too fast and the initial re-read is not gone yet. It would be nice to have something more elegant than sleep, any idea? Addresses: https://github.com/karelzak/util-linux/issues/557 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-6/+7
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: be more explicit for BLKSSZ in blockdev.8Karel Zak2017-11-131-1/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/535 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: create empty label on 'write' commandKarel Zak2017-11-031-1/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/528 Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: Fix bus error on broken file system.Tobias Stoeckmann2017-11-021-6/+7
| | | | | | | | | | | | | | | | | The utility fsck.cramfs is prone to a bus error on file systems for big endian systems with non-standard header sizes. While calculating the crc32 checksum, it does not properly handle a possible offset for bootcodes, resulting in out of boundary access of mmap'ed area. You can trigger the issue with the following commands: $ mkdir -p cramfs-poc/root/subdir $ cd cramfs-poc $ mkfs.cramfs -p -N big root cramfs $ echo -ne \\00\\x4c | dd of=cramfs bs=1 seek=518 count=2 conv=notrunc $ fsck.cramfs cramfs Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* sfdisk: allow to disable bootable flag on all partitionsKarel Zak2017-11-022-5/+13
| | | | | | | | | Let use '-' rather than a partition number to disable the bootable flag on all partitions: sfdisk --activate /dev/sdc - Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: allow to use --activate for PMBRKarel Zak2017-11-021-3/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>