Project

General

Profile

Actions

Bug #13934

closed

prtvtoc(1M) could display sector count on MBR disks

Added by Jason King 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

When invoking prtvtoc(1M) on an MBR-formatted disk, we get output similar to:

* /dev/rdsk/c2t0d0s0 partition map
*
* Dimensions:
*         512 bytes/sector
*          63 sectors/track
*         255 tracks/cylinder
*       16065 sectors/cylinder
*        8353 cylinders
*        8351 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*         First       Sector      Last
*         Sector       Count      Sector
*             0       16065       16064
*
*                            First       Sector      Last
* Partition  Tag  Flags      Sector       Count      Sector  Mount Directory
       0      2    00        16065   134142750   134158814
       2      5    01            0   134158815   134158814
       8      1    01            0       16065       16064

Note that the total number of sectors is missing. However for a GPT/EFI formatted disk, we see:

* /dev/rdsk/c2t0d0s0 EFI partition map
*
* Dimensions:
*         512 bytes/sector
*    83886080 sectors
*    83886013 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*         First       Sector      Last
*         Sector       Count      Sector
*            34         222         255
*
*                            First       Sector      Last
* Partition  Tag  Flags      Sector       Count      Sector  Mount Directory
       0     12    00          256      524288      524543
       1      4    00       524544    83345119    83869662
       8     11    00     83869663       16384    83886046

It would be handy for anyone with MBR formatted disks (which is likely to be the case for some time still) or Sparc, to also show sectors + accessible sectors.

Actions #1

Updated by Electric Monk 3 months ago

  • Gerrit CR set to 1596
Actions #2

Updated by Jason King 3 months ago

To test, I ran the new prtvtoc on both an EFI and MBR formatted disk and examined the output.

As an example of MBR (as that's what changed here):

* /dev/rdsk/c3t0d0s0 partition map
*
* Dimensions:
*         512 bytes/sector
*          63 sectors/track
*         255 tracks/cylinder
*       16065 sectors/cylinder
*        1304 cylinders
*        1304 accessible cylinders
*    20948760 sectors
*    20948760 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*         First       Sector      Last
*         Sector       Count      Sector
*             0       48195       48194
*
*                            First       Sector      Last
* Partition  Tag  Flags      Sector       Count      Sector  Mount Directory
       0      2    00        48195      273105      321299
       1      3    01       321300      273105      594404
       2      5    01            0    20948760    20948759
       6      4    00       594405    20354355    20948759
       8      1    01            0       16065       16064
       9      9    00        16065       32130       48194

(This is a small virtual disk).

Actions #3

Updated by Electric Monk 3 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 83a62956cac74f8f8fd1ab47df92935cb767d7e8

commit  83a62956cac74f8f8fd1ab47df92935cb767d7e8
Author: Jason King <jason.brian.king@gmail.com>
Date:   2021-07-16T18:58:58.000Z

    13934 prtvtoc(1M) could display sector count on MBR disks
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF