summaryrefslogtreecommitdiffstats
path: root/libfdisk
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: don't connect _DEPENDENCIES and _LIBADDKarel Zak2014-03-051-3/+3
| | | | | | | | | The _DEPENDENCIES has to be used for dependencies on another in-tree files, but _LIBADD is to specify additional libs (including external libs). Reported-by: oleid <notifications@github.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) warn on type 0Karel Zak2013-11-271-0/+3
| | | | | | This is old warning, but somehow lost during rewrite to libfdisk. Sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) fix free part counterKarel Zak2013-11-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (gpt) more human readable info about free spaceKarel Zak2013-11-251-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: don't care about partition typeKarel Zak2013-11-251-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fdisk allows to overwrite existing partition if the partition has partition type set to zero (very unusual, but possible). This is incorrect because such partition is pretty valid (and Linux kernel does not care about the type at all). For example: Device Boot Start End Blocks Id System /dev/sdb1 2048 22527 10240 83 Linux /dev/sdb2 22528 227327 102400 0 Empty ^^^^^ ^^^^^^^^ Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): Using default response p Partition number (3,4, default 3): First sector (22528-1228799, default 22528): ^^^^^^^ .. if user follows the default then the result are overlapping partitions: Device Boot Start End Blocks Id System /dev/sdb1 2048 22527 10240 83 Linux /dev/sdb2 22528 227327 102400 0 Empty /dev/sdb3 22528 1228799 603136 83 Linux ^^^^^ ... and if you call "mkfs /dev/sdb3" then you lost data on sdb2. Sad thing. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix nasty coding styleKarel Zak2013-11-251-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) generate partname according to partition positionKarel Zak2013-11-191-4/+6
| | | | | | | | | | | | | | | | | | | The SGI drive currently counts only usable partitions, that's wrong as Linux kernel counts all partition to generate partition number. For example: Kernel: sdb 8:16 0 600M 0 disk ├─sdb9 8:25 0 2M 0 part └─sdb11 8:27 0 596.2M 0 part Fdisk: Pt# Device Info Start End Sectors Id System 9: /dev/sdb1 0 4095 4096 0 SGI volhdr 11: /dev/sdb2 0 1220939 1220940 6 SGI volume Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sun) fix end sectors with +1 errorKarel Zak2013-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | partx (or parted, etc.): NR START END SECTORS SIZE NAME UUID 1 0 410047 410048 200.2M 2 410048 82329055 81919008 39.1G 4 82329056 102807615 20478560 9.8G 5 102807616 110999039 8191424 3.9G 6 110999040 312580543 201581504 96.1G and the same with fdisk: Device Flag Start End Blocks Id System /dev/loop0p1 0 410048 205024 1 Boot /dev/loop0p2 410048 82329056 40959504 83 Linux native /dev/loop0p3 0 312580544 156290272 5 Whole disk /dev/loop0p4 82329056 102807616 10239280 83 Linux native /dev/loop0p5 102807616 110999040 4095712 83 Linux native /dev/loop0p6 110999040 312580544 100790752 8e Linux LVM Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) add /home GUIDKarel Zak2013-10-311-0/+1
| | | | | | Reported-by: andreas.hanke@gmx-topmail.de References: http://cgit.freedesktop.org/systemd/systemd/commit/?id=1a14a53cfded6e78c6e8dfb73fdff0039971d642 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) allow to work with hybrid GPTKarel Zak2013-10-233-6/+19
| | | | | | | | | | | Notes: * fdisk don't sync hybrid MBR with GPT * hybrid MBR is ignored and not overwritten by PBMR * users is informed about expert command 'M' to toggle between MBR and GPT mode. It's possible to manually modify hybrid MBR. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) improve and cleanup recovery codeKarel Zak2013-10-231-15/+56
| | | | | | | * use AlternativeLBA rather than hardcoded offset to backup GPT * create gpt_copy_header() Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) recover from corrupted primary/backup PTKarel Zak2013-10-231-12/+32
| | | | | | | | We already have all code to support this feature, unfortunately it was not used in gpt_probe_label()... References: https://bugzilla.redhat.com/show_bug.cgi?id=1022217 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: warn about obsolete signatures on the deviceKarel Zak2013-10-231-0/+61
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support extended attributes modificationKarel Zak2013-10-232-0/+130
| | | | | | | | * GPT attributes defined by standard (e.g. legacy boot etc.) * attributes (bits 48-63) reserved for GUID specific attributes (used for example by MS Windows) Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) be more verbose when change bootable flagKarel Zak2013-10-231-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix printf stuffKarel Zak2013-10-237-68/+67Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support nested MBRKarel Zak2013-10-231-4/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) %ld -> %ju in verify functionKarel Zak2013-10-211-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add Intel Rapid Start Technology GUIDKarel Zak2013-10-181-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (bsd) leave context if new disklabel unwantedKarel Zak2013-10-161-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix printf stuffKarel Zak2013-10-156-25/+31
| | | | | | | | | | | Unfortunately, fdisk_warn/info/.. function was not marked by printf __attribute__. We don't want to break gettext stuff now, so all compiler warnings have been fixed by casts. This is temporary solution, after release it will be necessary to fix all the strings. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) all disklabel locate functionKarel Zak2013-10-151-0/+34
| | | | | | | | | .. to make 'D'ump expert command usable also for MBR. Yes, we have -rc2 now and this is a new feature, but it's tiny change without any interaction to the rest of the code and without gettext stuff. Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: equalize four error messages with already existing onesBenno Schulenberg2013-10-143-5/+5
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: mark label modified for PMBR mismatchKarel Zak2013-10-111-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: treat size mismatch as a warning, not an errorKarel Zak2013-10-111-2/+9
| | | | | | Based on kernel patch from Doug Anderson <dianders@chromium.org>. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add API to disable specified labelKarel Zak2013-10-094-4/+55
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) use consistent final period in status messagesBenno Schulenberg2013-10-091-3/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: (dos) improve the grammar of an error messageBenno Schulenberg2013-10-091-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: (dos) correct the grammar of the disk-identifier promptBenno Schulenberg2013-10-091-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola2013-10-081-3/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* COPYING: fix grammar of referring phrase, and indicate location betterBenno Schulenberg2013-10-081-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: change spelling of "disk label" to the more abundant "disklabel"Benno Schulenberg2013-10-081-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: (gpt) fix warningKarel Zak2013-10-081-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk/gpt: partly pluralize one messageBenno Schulenberg2013-10-081-3/+5
| | | | | | And don't mention the largest when there is only one segment. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: tweak and harmonize some message stringsBenno Schulenberg2013-10-081-26/+25Star
| | | | | | | | Using consistent capitals and lowercase, adding missing periods and a missing space, repositioning commas for clarity, improving grammar, and aligning substrings for esthetics. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: tweak and harmonize some commentsBenno Schulenberg2013-10-081-23/+17Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: properly pluralize three messagesBenno Schulenberg2013-10-081-12/+20
| | | | | Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: end both the singular and the plural message with a periodBenno Schulenberg2013-10-081-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: cleanup warning messagesKarel Zak2013-10-041-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: improve spelling of two commentsBenno Schulenberg2013-10-041-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fdisk: fix possible memleak [coverity scan]Karel Zak2013-10-021-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak2013-09-302-2/+2
|\
| * Fix various typosYuri Chornoivan2013-09-282-4/+4
| |
* | textual: fix misspelled words in -rc1Karel Zak2013-09-303-8/+10
|/ | | | | Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (bds) cleanup includesKarel Zak2013-09-261-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sun) make it more obvious why the first sector movedKarel Zak2013-09-251-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: improve fdisk_save_user_geometry()Karel Zak2013-09-251-4/+9
| | | | | | | The functions should not overwrite old setting if the new value (C/H/S) is zero. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use context geometry in SGI and SUNKarel Zak2013-09-252-47/+30Star
| | | | | | | | * don't call HDIO_GETGEO ioctls in the drivers * use context geometry (so user can overwrite it by -C/H/S options) * use default geometry is ioctl does not return anything Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix possible floating point exceptionKarel Zak2013-09-251-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: gpt: loosen check fot pmbr size in lbaDavidlohr Bueso2013-09-251-2/+6
| | | | | | | | | | | | | | | While most disk partitioning tools out there create a pMBR's size in lba to be the lesser of the whole disk or 2Tib, Microsoft apparently does not[1]. It always sets the entry to the maximum 32-bit limitation - even though a drive may be smaller than that. Loosen this check and only verify that the size is either the whole disk or 0xFFFFFFFF. No tool in its right mind would set it to any value other than these. [1] http://thestarman.pcministry.com/asm/mbr/GPT.htm#GPTPT Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>