1.gdisk
gdisk -l /dev/vdd1 GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Disk /dev/vdd1: 419426304 sectors, 200.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 8BD94ECE-A26D-4511-8DC0-08C86229F8A1 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 419426270 Partitions will be aligned on 2048-sector boundaries Total free space is 419426237 sectors (200.0 GiB) Number Start (sector) End (sector) Size Code Name
2.使用srpm包查看源码:gdisk-0.8.10-3.el7.centos.es.src.rpm
[root@node-3 data]# ls -l total 200 drwxr-xr-x 2 root 50 Jan 19 17:45 . drwxrwxrwt. 15 root 4096 Jan 19 17:45 .. -rw-r--r-- 1 root 198310 Jan 19 17:39 gdisk-0.8.10-3.el7.centos.es.src.rpm
[root@node-3 data]# rpm2cpio gdisk-0.8.10-3.el7.centos.es.src.rpm |cpio -iv warning: Macro %el6 needs whitespace before body gdisk-0.8.10-exit-code.patch gdisk.spec gptfdisk-0.8.10.tar.gz 385 blocks [root@node-3 data]# ls -l total 400 drwxr-xr-x 2 root 134 Jan 19 17:45 . drwxrwxrwt. 15 root 4096 Jan 19 17:45 .. -rw-r--r-- 1 root 198310 Jan 19 17:39 gdisk-0.8.10-3.el7.centos.es.src.rpm -rw-rw-r-- 1 root 1337 Jan 19 17:45 gdisk-0.8.10-exit-code.patch -rw-rw-r-- 1 root 4465 Jan 19 17:45 gdisk.spec -rw-rw-r-- 1 root 190666 Jan 19 17:45 gptfdisk-0.8.10.tar.gz [root@node-3 data]#
[root@node-3 data]# gunzip gptfdisk-0.8.10.tar.gz [root@node-3 data]# ls -l total 924 drwxr-xr-x 2 root 131 Jan 19 17:45 . drwxrwxrwt. 15 root 4096 Jan 19 17:45 .. -rw-r--r-- 1 root 198310 Jan 19 17:39 gdisk-0.8.10-3.el7.centos.es.src.rpm -rw-rw-r-- 1 root 1337 Jan 19 17:45 gdisk-0.8.10-exit-code.patch -rw-rw-r-- 1 root 4465 Jan 19 17:45 gdisk.spec -rw-rw-r-- 1 root 727040 Jan 19 17:45 gptfdisk-0.8.10.tar
#源码 [root@node-3 data]# tar -xvf gptfdisk-0.8.10.tar gptfdisk-0.8.10/ gptfdisk-0.8.10/gdisk_test.sh gptfdisk-0.8.10/gpttext.h gptfdisk-0.8.10/sgdisk.html gptfdisk-0.8.10/gptcl.cc gptfdisk-0.8.10/gptcurses.h