git: gpt(8): Improve "show" command to print a disk summary line

Aaron LI aly at crater.dragonflybsd.org
Thu May 15 20:44:33 PDT 2025


commit ea9e56baff36d69e2cb2f7a183a51c472f959928
Author: Aaron LI <aly at aaronly.me>
Date:   Sun May 11 07:51:06 2025 +0800

    gpt(8): Improve "show" command to print a disk summary line
    
    Before print the partition entries, print a disk summary line like:
    "Disk /dev/da0: 50.0GB (104857600 512-byte sectors)".
    
    In addition, add a blank line between disks.
    
    Example new output:
    ```
    $ sudo gpt show /dev/da0 ad0
    Disk /dev/da0: 50.0GB (104857600 512-byte sectors)
          start       size  index  contents
              0          1      -  PMBR
              1          1      -  Pri GPT header
              2         32      -  Pri GPT table
             34       2014      -  Unused
           2048     262144      0  GPT part - EFI System
         264192  104591360      1  GPT part - DragonFly Label64
      104855552       2015      -  Unused
      104857567         32      -  Sec GPT table
      104857599          1      -  Sec GPT header
    
    Disk ad0: 40.0GB (83886080 512-byte sectors)
         start      size  index  contents
             0         1      -  PMBR
             1         1      -  Pri GPT header
             2        32      -  Pri GPT table
            34      2014      -  Unused
          2048  83881984      0  GPT part - FreeBSD UFS/UFS2
      83884032      2015      -  Unused
      83886047        32      -  Sec GPT table
      83886079         1      -  Sec GPT header
    ```

Summary of changes:
 sbin/gpt/Makefile |  4 +++-
 sbin/gpt/show.c   | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ea9e56baff36d69e2cb2f7a183a51c472f959928


-- 
DragonFly BSD source repository


More information about the Commits mailing list