summaryrefslogtreecommitdiff
path: root/fdisks/fdisk.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-19fdisk: fix usage(), -l [<disk>]Karel Zak1-2/+2
Add square brackets, <disk> is optional for -l. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23libfdisk: (gpt) allow to work with hybrid GPTKarel Zak1-1/+5
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-23fdisk: reorder intro warningsKarel Zak1-4/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23fdisk: fix printf stuffKarel Zak1-3/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15fdisk: fix printf stuffKarel Zak1-1/+3
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-09fdisk: add -t <type> to enable only specified typeKarel Zak1-1/+14
In some cases (for example hybrid GPT) it's useful to force fdisk to read only specified disk label and ignore everything else. For example: # fdisk -l /dev/sda Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 3549290F-417C-4941-8503-F7835109B821 Device Start End Size Type /dev/sda1 2048 2050047 1000M EFI System /dev/sda2 2050048 6146047 2G Microsoft basic data /dev/sda3 6146048 26462207 9.7G Linux swap /dev/sda4 26462208 98142207 34.2G Microsoft basic data /dev/sda5 98142208 230662143 63.2G Microsoft basic data /dev/sda6 230662144 312580095 39.1G Microsoft basic data but when GPT is disabled we can access PMBR: # fdisk -l -t dos /dev/sda Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sda1 1 312581807 156290903+ ee GPT Reported-by: Craig <util-linux_contact@magister.com.au> Signed-off-by: Karel Zak <kzak@redhat.com>
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-09-26fdisk: use xalloc stuffKarel Zak1-11/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-25fdisk: print geometry for dos-compatible mode tooKarel Zak1-1/+1
2013-09-17fdisk: separate disks by \n in -l outputKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-17fdisk: add debug message, use colors for -lKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: fix -lKarel Zak1-1/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: remove unused code, coding style changesKarel Zak1-13/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: rewrite dump first sector add dump disklabel commandKarel Zak1-19/+71
Expert command (m for help): D PMBR: offset = 0, size = 512 bytes. 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 000001c0 01 00 ee fe ff ff 01 00 00 00 ff 9f 0f 00 00 00 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa GPT Header: offset = 512, size = 512 bytes. 00000200 45 46 49 20 50 41 52 54 00 00 01 00 00 02 00 00 00000210 ae 36 81 28 00 00 00 00 01 00 00 00 00 00 00 00 00000220 ff 9f 0f 00 00 00 00 00 00 08 00 00 00 00 00 00 00000230 de 9f 0f 00 00 00 00 00 e0 9d d8 d5 d6 da 1a 44 00000240 98 57 e4 11 64 88 ce 3b 02 00 00 00 00 00 00 00 00000250 80 00 00 00 80 00 00 00 4b c7 c9 54 00 00 00 00 00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * GPT Entries: offset = 1024, size = 16384 bytes. 00000400 af 3d c6 0f 83 84 72 47 8e 79 3d 69 d8 47 7d e4 00000410 bc ae 48 5e 22 e5 ca 4c aa 98 14 6d c9 1d 72 f4 00000420 00 08 00 00 00 00 00 00 de 9f 0f 00 00 00 00 00 00000430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: (gpt) use generic 'created partition' messageKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: use fdisk_colon() and fdisk_sinfo()Karel Zak1-12/+12
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: use fdisk_{info,warn} on more placesKarel Zak1-13/+13
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: add -L to colorize outputKarel Zak1-4/+16
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: improve info outputKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: use fdisk_info() to print geometryKarel Zak1-21/+16
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: -l refactoringKarel Zak1-25/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: mark -s option as deprecatedKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: main() refactoringKarel Zak1-32/+35
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: add fdisk_has_user_device_properties()Karel Zak1-12/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: cleanup header fileKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: move sync() and reread PT code from fdisk to libfdiskKarel Zak1-35/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: cleanup write table codeKarel Zak1-15/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: move remaining actions to menu callbacksKarel Zak1-78/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: move expect actions to menu callbackKarel Zak1-48/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: consolidate code in fdisk.cKarel Zak1-78/+36
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: cleanup sgi menu callbackswqKarel Zak1-31/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: move "create label" actions to menu callbackKarel Zak1-12/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: remove common.hKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: add bsd driverKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (bsd) rewrite list disklabel functionKarel Zak1-10/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (bsd) *OSF --> *BSDKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (bsd) implement regular bsd menu callbackKarel Zak1-12/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (bsd) remove generic actions from bsd_command_prompt()Karel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: allow to exchange context pointer in menu callbacksKarel Zak1-2/+10
... to make it possible to switch to nested contexts (nested partition tables). Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: move mbr code to the libraryKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: cleanup warning messagesKarel Zak1-10/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: remove nowarn global variableKarel Zak1-3/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (dos) add dos menu callbackKarel Zak1-36/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: add generic function to set disklabel IDKarel Zak1-2/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: add generic function to get disklabel IDKarel Zak1-4/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (dos) clean up list PT functionsKarel Zak1-3/+1
- use tt.c to list partitions - list extended partitions in expert mode Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (dos) don't check for CHS in move-begin commandKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (dos) remove global ptes[]Karel Zak1-7/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: cleanup warningsKarel Zak1-58/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: move remaining ptes[] code to fdiskdoslabel.cKarel Zak1-5/+0
Signed-off-by: Karel Zak <kzak@redhat.com>