summaryrefslogtreecommitdiff
path: root/libfdisk/src
AgeCommit message (Collapse)AuthorFilesLines
2014-02-12undef sun in libfdisk/src/sun.cIgor Pashev1-0/+5
2013-11-27libfdisk: (dos) warn on type 0Karel Zak1-0/+3
This is old warning, but somehow lost during rewrite to libfdisk. Sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-27libfdisk: (dos) fix free part counterKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-25fdisk: (gpt) more human readable info about free spaceKarel Zak1-2/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-25fdisk: don't care about partition typeKarel Zak1-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>
2013-11-25fdisk: fix nasty coding styleKarel Zak1-1/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19libfdisk: (sgi) generate partname according to partition positionKarel Zak1-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>
2013-11-01libfdisk: (sun) fix end sectors with +1 errorKarel Zak1-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>
2013-10-31libfdisk: (gpt) add /home GUIDKarel Zak1-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>
2013-10-23libfdisk: (gpt) allow to work with hybrid GPTKarel Zak3-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>
2013-10-23libfdisk: (gpt) improve and cleanup recovery codeKarel Zak1-15/+56
* use AlternativeLBA rather than hardcoded offset to backup GPT * create gpt_copy_header() Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23libfdisk: (gpt) recover from corrupted primary/backup PTKarel Zak1-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>
2013-10-23libfdisk: warn about obsolete signatures on the deviceKarel Zak1-0/+61
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23libfdisk: support extended attributes modificationKarel Zak2-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>
2013-10-23libfdisk: (dos) be more verbose when change bootable flagKarel Zak1-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23libfdisk: fix printf stuffKarel Zak7-68/+67
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23libfdisk: support nested MBRKarel Zak1-4/+10
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-21libfdisk: (gpt) %ld -> %ju in verify functionKarel Zak1-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-18libfdisk: add Intel Rapid Start Technology GUIDKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-16libfdisk: (bsd) leave context if new disklabel unwantedKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15fdisk: fix printf stuffKarel Zak6-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>
2013-10-15libfdisk: (dos) all disklabel locate functionKarel Zak1-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>
2013-10-14textual: equalize four error messages with already existing onesBenno Schulenberg3-5/+5
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-11libfdisk: mark label modified for PMBR mismatchKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11libfdisk: treat size mismatch as a warning, not an errorKarel Zak1-2/+9
Based on kernel patch from Doug Anderson <dianders@chromium.org>. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-09libfdisk: add API to disable specified labelKarel Zak4-4/+55
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-09libfdisk: (gpt) use consistent final period in status messagesBenno Schulenberg1-3/+3
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-09libfdisk: (dos) improve the grammar of an error messageBenno Schulenberg1-1/+1
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-09libfdisk: (dos) correct the grammar of the disk-identifier promptBenno Schulenberg1-1/+1
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola1-3/+3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-10-08textual: change spelling of "disk label" to the more abundant "disklabel"Benno Schulenberg1-1/+1
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08libfdisk: (gpt) fix warningKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-08libfdisk/gpt: partly pluralize one messageBenno Schulenberg1-3/+5
And don't mention the largest when there is only one segment. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08libfdisk/sgi: tweak and harmonize some message stringsBenno Schulenberg1-26/+25
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>
2013-10-08libfdisk/sgi: tweak and harmonize some commentsBenno Schulenberg1-23/+17
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08libfdisk/sgi: properly pluralize three messagesBenno Schulenberg1-12/+20
Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08textual: end both the singular and the plural message with a periodBenno Schulenberg1-1/+1
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-04libfdisk: cleanup warning messagesKarel Zak1-6/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-04libfdisk: improve spelling of two commentsBenno Schulenberg1-2/+2
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-02fdisk: fix possible memleak [coverity scan]Karel Zak1-3/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak2-2/+2
2013-09-30textual: fix misspelled words in -rc1Karel Zak3-8/+10
Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-28Fix various typosYuri Chornoivan2-4/+4
2013-09-26libfdisk: (bds) cleanup includesKarel Zak1-2/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-25libfdisk: (sun) make it more obvious why the first sector movedKarel Zak1-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-25libfdisk: improve fdisk_save_user_geometry()Karel Zak1-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>
2013-09-25libfdisk: use context geometry in SGI and SUNKarel Zak2-47/+30
* 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>
2013-09-25libfdisk: fix possible floating point exceptionKarel Zak1-1/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-25libfdisk: gpt: loosen check fot pmbr size in lbaDavidlohr Bueso1-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>
2013-09-25libfdisk: gpt: avoid unnecessary pmbr checkDavidlohr Bueso1-1/+2
We only jump to the 'check_hybrid' label when a valid pmbr is detected, so we need not recheck again. Move the label's logic so it doesn't include the check. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>