summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|
* sfdisk: --quiet fixesKarel Zak2017-02-101-4/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/412 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add copyright to helpKarel Zak2017-02-021-1/+4
| | | | | | ... to make it obvious this is a new cfdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: support UI refresh on ^LKarel Zak2017-02-011-2/+14
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/404 Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: add --sector-size optionKarel Zak2017-01-132-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /dev/sdc is 4K disk: # fdisk -l /dev/sdc Disk /dev/sdc: 100 MiB, 104857600 bytes, 25600 sectors ... Device Boot Start End Sectors Size Id Type /dev/sdc1 1024 25599 24576 96M 83 Linux let's use it as disk image: # dd if=/dev/sdc of=~/sdc.img # losetup -f ~/sdc.img old version: # partx --show /dev/loop0 NR START END SECTORS SIZE NAME UUID 1 1024 25599 24576 12M 6a4ba75b-01 new version: # partx --show /dev/loop0 --sector-size 4096 NR START END SECTORS SIZE NAME UUID 1 8192 204799 196608 96M 6a4ba75b-01 Addresses: https://github.com/karelzak/util-linux/issues/396 Signed-off-by: Karel Zak <kzak@redhat.com>
* man: fix couple tools/checkmans.sh warningsSami Kerola2017-01-102-2/+2
| | | | | | | | | | <standard input>:407: warning: macro `fi.' not defined (possibly missing space after `fi') From: cat ./disk-utils/fsck.8 | troff -mandoc -ww -z <standard input>:71: warning: escape character ignored before `1' From: cat ./disk-utils/partx.8 | troff -mandoc -ww -z Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: unused parameter 'sf' [-Wunused-parameter]Karel Zak2017-01-051-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils/mkfs.minix: Set ninodes after checking maxNate Clark2017-01-041-1/+1
| | | | | | | | | | | ninodes in the superblock needs to be set after inodes is checked against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES can be attempted to be stored in the superblock. Without this change the command "mkfs.minix -2 -i 65530 <dev>" would write a minix superblock with ninodes set to 0. Signed-off-by: Nate Clark <nate@neworld.us>
* Use --help suggestion on invalid optionKarel Zak2016-12-1917-18/+18
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-1920-20/+20
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: don't be silent when list non-existing deviceKarel Zak2016-12-131-2/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: various pages: Format pathnames as italic (.I)Michael Kerrisk2016-12-092-7/+7
| | | | | | | | | In the majority of pages, pathnames are formatted as Italic, which is the norm. However, there are several cases where they are formatted as bold. This patch fixes a number of those exceptions. Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
* misc: spelling, always use "cannot" instead of "can not"Ruediger Meier2016-11-301-1/+1
| | | | | | Just to be consistent ... Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* sfdisk: support empty label use-caseKarel Zak2016-11-304-9/+50
| | | | | | | | | | | | | | | 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>
* sfdisk: cleanup --dump error messagesKarel Zak2016-11-301-1/+4
| | | | | | | | | | | | | old: # truncate -s 1G empty && ./sfdisk --dump empty sfdisk: failed to dump partition table: Success new: # truncate -s 1G empty && ./sfdisk --dump empty sfdisk: empty: does not contain a recognized partition table. Addresses: https://github.com/karelzak/util-linux/issues/375 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: don't be silent when list non-existing deviceKarel Zak2016-11-291-6/+10
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix formatting errors in page cross referencesMichael Kerrisk (man-pages)2016-11-291-1/+1
| | | | | | | | | | | | These pages had errors such as .BR page (x) . which should be .BR page (x). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* Place SEE ALSO entries in orderMichael Kerrisk (man-pages)2016-11-298-15/+15
| | | | | | | | | | | | This patch does only the following: * Order SEE ALSO entries first by section name, then alphabetically within section * Adds one or two missing commas in SEE ALSO lists * Removes one or two periods that were (inconsistently) used at the end of SEE ALSO lists. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* fdisk: fix memleak in list_disk_geometry()Ruediger Meier2016-10-271-1/+3
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: fix compiler warningKarel Zak2016-10-261-2/+2
| | | | | | | | disk-utils/fdisk-menu.c: In function ‘gpt_menu_cb’: disk-utils/fdisk-menu.c:709: warning: passing argument 6 of ‘fdisk_ask_number’ from incompatible pointer type ./libfdisk/src/libfdisk.h:688: note: expected ‘uintmax_t *’ but argument is of type ‘long unsigned int *’ Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix unsigned int usage for ctype.h functionsKarel Zak2016-10-261-2/+2
| | | | | Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cramfs: revert crc32 changesKarel Zak2016-10-192-11/+21
| | | | | | | | We cannot use our crc32 without changes in the code, because our ul_crc32() assumes that post-conditioning (xor) is done by application. The zlib implementation does everything. Signed-off-by: Karel Zak <kzak@redhat.com>
* cramfs: add missing includesKarel Zak2016-10-192-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/crc32: prefix public functionsGustavo Zacarias2016-10-192-9/+9
| | | | | | | | | | | Make the publicly-visible crc32 library functions prefixed by ul_, such as crc32() -> ul_crc32(). This is because it clashes with the crc32() function from zlib. For newer versions of glib (2.50+) zlib and libblkid are required dependencies and otherwise results in build failure when building statically. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
* isosize: fix read() result checkKarel Zak2016-10-041-1/+1
|
* sfdisk: cleanup before going out of scope [coverity scan]Karel Zak2016-10-041-5/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: free before going out of scope [coverity scan]Karel Zak2016-10-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* isosize: don't ignore read() result [coverity scan]Karel Zak2016-10-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: don't ignore read() result [coverity scan]Karel Zak2016-10-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix mountpoint detectionKarel Zak2016-10-041-21/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=onKarel Zak2016-09-072-0/+4
| | | | | | | | | | | | This env.variable forces libsmartcols to use visible padding chars. The standard debug has to be enabled (to minimize overhead for non-debug execution). For example: $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: remove fs-specific options from man pageKarel Zak2016-09-061-65/+12Star
| | | | | | | | Let's force users to read fs-specific man pages rather than try to be smart and maintain some non-fsck options in fsck.8. Reported-by: Matej Cepl <mcepl@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add --no-tell-kernelKarel Zak2016-09-022-3/+17
| | | | | | | | The option forces sfdisk to not call re-read partitions ioctl after write PT. Requested-by: Scott Moser <smoser@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: make non-interactive output more readableKarel Zak2016-08-311-14/+26
| | | | | | | | | | | | | | | | | | | | | # echo -e ',1M\n,2M' | sfdisk /dev/sdc Old version: >>> Created a new DOS disklabel with disk identifier 0x8fc7d065. Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: New version: >>> Created a new DOS disklabel with disk identifier 0x9afe17c0. /dev/sdc1: Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: Done. Addresses: https://github.com/karelzak/util-linux/issues/337 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use PAGER for 'l' command.Karel Zak2016-08-261-0/+6
| | | | | | | The list of the partition types is too long. Let's try to use $PAGER. Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/closestream: define exit codesKarel Zak2016-08-162-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add show-pt-geometry to usage() and sfdisk.8Karel Zak2016-08-082-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: Add --show-pt-geometry compatibility codeStanislav Brabec2016-08-081-1/+4
| | | | | | | --show-pt-geometry existed since cf3f26bf (2006), and it is used by third party tools. To prevent failure of these tools, add a minimal compatibility code. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-215-42/+30Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Revert "sfdisk: exit with error if rereading partition table fails"Karel Zak2016-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 14f644f386a1708483ed446e983c0976e3976a9d. It seems we have mess in reread-after-write: all old versions to v2.20 -- returns 0 from v2.20 to v2.26 -- returns 1 since v2.26 -- returns 0 I think re-read errors should not be interpreted as fatal errors, because it's pretty common that you want to modify only one partition (e.g. resize) and then another partitions are probably still in use and re-read all PT does not make sense. What we need is to improve granularity for re-read and calls it only when really necessary (all PT modified) and otherwise call BLKPG (add/delete/resize) ioctls. Reported-by: Nikhil Valluru <vvnikhil@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: make -l <dev ...> behaves like fdisk -lThierry Vignaud2016-07-141-1/+6
| | | | | | aka having the same spacing between disks Signed-off-by: Karel Zak <kzak@redhat.com>
* cfisk: add /dev/vda as another default diskKarel Zak2016-07-071-13/+23
| | | | | | | And use array for all default alternative disks. Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use libsmartcols ASCII for non-widechar environmentKarel Zak2016-06-031-0/+4
| | | | | Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: fix endless loop and out of stackKarel Zak2016-06-011-0/+16
| | | | | | | | | It seems there is no elegant way how to recovery if a directory i_zone (and i_size) is out of reality. Let's require human interaction to avoid endless loop when executed with --auto, etc. Addresses: https://github.com/karelzak/util-linux/issues/228 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: Fix typo RequiredPartiton -> RequiredPartitionSebastian Rasmussen2016-05-311-2/+2
| | | | | | | | This typo fix is backwards compatible in that fdisk will accept both the GPT attribute RequiredPartition and RequiredPartiton with the typo. Update documentation and tests to all use the new attribute name. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* misc: Fix various typosSebastian Rasmussen2016-05-319-21/+21
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* docs: Fix various typosSebastian Rasmussen2016-05-313-4/+4
| | | | Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* fsck.minix: Verify more fields in super-block.Tobias Stoeckmann2016-05-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The field s_ninodes in super-block is used for memory allocation and division without verifications. The memory allocation increments the unchecked value by 1, making it vulnerable to an integer overflow on 32 bit systems with minix 3 file systems. I did not find a (good) way to exploit this by crafting a malicious file system, so I consider it as a reliability issue. If it's 0, a division by zero occurs when "-v" has been used. A filesystem without any inodes is definitely wrong, because it means that there's not even the root inode, which is accessed unchecked later on. The field s_firstdatazone has to be checked against s_(n)zones. If it is larger than the highest allowed index, the file system is definitely corrupted -- hard to say which value is wrong though, therefore I decided to simply call die(). A maliciously created file system could do more harm in this way: single bits inside the memory area could be flipped because range checks would fail. Hard to consider it as a security issue though, because these addresses are not arbitrarily accessible without very careful crafting (if at all possible). [kzak@redhat.com: - fix compiler warning (cast get_nzones()) [-Wsign-compare]] Signed-off-by: Karel Zak <kzak@redhat.com>
* man pages: fix spacing between man page name & section numberMike Frysinger2016-05-202-3/+3
| | | | | | Most have standardized correctly, but fix a few latent ones. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-181-0/+8
| | | | Adds an options (l) to the GPT menu to resize the GPT.