$ whatis prtvtoc
prtvtoc - report information about a disk geometry and partitioning
I need to know the device name for my disk, in this case it is a Virtual Box logical disk
under the Controler 7, target 0 and disk 0 with the device path name as /dev/dsk/c7t0d0 and the
raw device path as /dev/rdsk/c7t0d0. The print volume table of contents 'prtvtoc' requires the
/dev/rdsk/c7t0d0s2 for slice 2 which is the entire disk in Solaris OS format commands as shown
later on below:
# cfgadm -alv
Ap_Id Receptacle Occupant Condition Information
When Type Busy Phys_Id
sata0/0::dsk/c7t0d0 connected configured ok
Mod: VBOX HARDDISK FRev: 1.0 SN: VBb55e6ed2-54625e7f
unavailable disk n /devices/pci@0,0/pci8086,2829@d:0
sata0/1::dsk/c7t1d0 connected configured ok
Mod: VBOX CD-ROM FRev: 1.0 SN: VB1-1a2b3c4d
unavailable cd/dvd n /devices/pci@0,0/pci8086,2829@d:1
usb2/1 connected configured ok
Mfg: VirtualBox Product: USB Tablet NConfigs: 1 Config: 0
unavailable usb-input n /devices/pci@0,0/pci106b,3f@6:1
usb2/2 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:2
usb2/3 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:3
usb2/4 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:4
usb2/5 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:5
usb2/6 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:6
usb2/7 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:7
usb2/8 empty unconfigured ok
unavailable unknown n /devices/pci@0,0/pci106b,3f@6:8
Below, I am using the format command to see what is the disk device information.
It is important not to make any changes inadvertently while using the format command.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c7t0d0
/pci@0,0/pci8086,2829@d/disk@0,0
Specify disk (enter its number): 0
selecting c7t0d0
[disk formatted]
/dev/dsk/c7t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> partition
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition> print
Current partition table (original):
Total disk cylinders available: 5290 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 5289 40.52GB (5289/0/0) 84967785
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 5289 40.52GB (5290/0/0) 84983850
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0
partition> quit
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> quit
Now, I use the prtvtoc to read the disk parition map and dimensions information.
# prtvtoc /dev/rdsk/c7t0d0s2
* /dev/rdsk/c7t0d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 255 tracks/cylinder
* 16065 sectors/cylinder
* 5292 cylinders
* 5290 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 84967785 84983849
2 5 01 0 84983850 84983849
8 1 01 0 16065 16064
Please click on " man prtvtoc. " to see the Manual Page for this command.