Solaris Transition Guide

Obtaining Disk Information

The commands that report disk information in the SunOS release 5.7 software have changed. df(1M) and du(1M) are still available, but have changed. dkinfo(8), and devinfo(1M) are replaced by prtvtoc and sysdef -d. This section provides an overview of these changes.

If you have installed the compatibility packages, SunOS release 4 command versions can be found under /usr/ucb/df and /usr/ucb/du.

df Command

The df command has been changed to support the VFS architecture. As with the other VFS commands, there are generic and file-system versions of the command. The syntax in the SunOS release 5.7 command differs significantly from that used in the SunOS release 4 version (see Appendix A, Commands Reference Table, for more information). For more information on VFS, see "Virtual File System Architecture".

The df command now reports disk space in 512-byte blocks instead of kilobytes, but the -k option can be used to report disk space in kilobytes. Also, the -t option behaves differently; formerly, it restricted the output to file systems of a specified type (for example, "nfs" or "4.2"). The SunOS release 5.7 version produces a full listing with totals.

Finally, use the SunOS release 5.7 device naming conventions when specifying special device names to this command. See "Device Naming Conventions" for details.

du Command

Like df, the du command reports disk usage in 512-byte blocks instead of kilobytes. There's also a -r option that causes the normally "silent" command to generate messages when it has difficulty reading a directory or opening a file.

dkinfo Command

The SunOS release 4 dkinfo command is no longer available. To print device information, use prtvtoc(1M) instead of dkinfo.

The prtvtoc command reports the important information stored on a disk's label, including information on the disk's partitions. For more information about prtvtoc, see System Administration Guide, Volume I.

The following screen shows sample output for the SunOS release 5.7 prtvtoc command.

# prtvtoc /dev/rdsk/c0t2d0s2 
* /dev/rdsk/c0t2d0s2 partition map 
* Dimensions: 
*     512 bytes/sector 
*      36 sectors/track 
*       9 tracks/cylinder 
*     324 sectors/cylinder 
*    1272 cylinders 
*    1254 accessible cylinders 
* Flags: 
*   1: unmountable 
*  10: read-only 
*                         First   Sector      Last       Mount
*  Partition  Tag  Flags  Sector   Count    Sector   Directory
        0       0     00       0   32724    32723       / 
        1       0     00   32724   65448    98171
        2       0     00       0  406296   406295
        6       0     00   98172  308124   406295       /usr

devinfo Command

The SunOS release 4 version of devinfo is incompatible with the SunOS release 5.7 version. To produce output similar to the SunOS release 4 version, use prtconf with the -v option.