]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fdisk: add -t <type> to enable only specified type
authorKarel Zak <kzak@redhat.com>
Wed, 9 Oct 2013 14:02:42 +0000 (16:02 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Oct 2013 14:11:31 +0000 (16:11 +0200)
commit565b7da63e87211ef78a7b4e67dcc66119813640
tree9ee4431d070a12ee3b82b2ce0406c867a3b374ce
parent7a188aedbf4468e9753200716ec845a00dd8b30e
fdisk: add -t <type> to enable only specified type

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>
fdisks/fdisk.8
fdisks/fdisk.c