Solaris Transition Guide

Chapter 7 Device Administration

This chapter explains SunOS release 5.7 device naming conventions and discusses changes to device-related tasks such as getting information about disks, adding devices to a system, and using Volume Management.

Device Naming Conventions

Device naming conventions have changed between the SunOS release 4 and SunOS release 5.7 platforms. In addition, the /dev directory, which contains the special device names, has been changed from a flat directory to a hierarchical one, with a separate subdirectory for each category of device. For example, the location of disk device files is /dev/dsk, while raw disks are located in /dev/rdsk.

SunOS release 5.7 commands that take device names as arguments must use the SunOS release 5.7 device naming conventions. However, you can still use and recognize the SunOS release 4 device names if you install the SunOS/BSD Source Compatibility Package. See Source Compatibility Guide for additional information.

Convention for Disks

The disk partition slice numbers (0 through 7) correspond to partitions a through h of previous SunOS releases.

Graphic
Note -

Most SCSI disks have embedded controllers. This means that the drive number will always be 0 but the target number varies. For example, if an external disk drive has its rear switch set to 2, the device name for the first slice is /dev/dsk/c0t2d0s0, not /dev/dsk/c0t0d2s0.


Because the names for SCSI targets 0 and 3 were reversed on some sun4c systems, device naming can be confusing. Under the SunOS 4.1.x software, SCSI target 3 was called sd0(), but it is now properly named c0t3d0. SCSI target 0 was called sd3(), but it is now named c0t0d0. Other SCSI disk names translate normally. For example, in the SunOS release 5.7 software, sd2a is c0t2d0s0 and sd2b is c0t2d0s1.

Convention for Tape Drives

Graphic

Table 7-1 provides some examples that compare the SunOS release 4 and SunOS release 5.7 device naming conventions.

Table 7-1 SunOS release 4 and SunOS Release 5.7 Device Names

Device Description 

SunOS Release 4 Device Name 

SunOS Release 5.7 Device Name

Disk devices

/dev/sd0g

/dev/dsk/c0t3d0s6

 

/dev/rsd3b

/dev/rdsk/c0t0d0s1

 

/dev/rsd3a

/dev/rdsk/c0t0d0s0

Magnetic tape devices 

/dev/nrmt8

/dev/rmt/8hn

 

/dev/rst0

/dev/rmt/0

CD-ROM device

/dev/sr0

/dev/dsk/c0t6d0s2

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.

Adding Devices to the System

When you boot the system, it does a self-test and checks for all attached devices that are attached. After you add a new device to the system, use boot -r to activate dynamic reconfiguration of the kernel. A reconfiguration script is run to load all the device drivers listed in the module's directories and to create the corresponding hardware nodes. See the kernel(1M) man page for more information.

You can also use boot -a to interactively add drivers or modules to the system, but if you do, you will be asked to provide other boot parameters, including what to boot and where the root file system is.

Paths to the system files and kernel modules are stored in /etc/system. When the system boots, it reads the information in /etc/system to determine which modules to load. You can specify a different path by using the MODDIR syntax of the system(4) file or by using boot -a.

For more information about boot(1m) or about adding devices and drivers, see System Administration Guide, Volume I.

Dynamic Reconfiguration

Dynamic reconfiguration, available on certain SPARC servers with the Solaris 7 release, allows a service provider to remove or replace hot-pluggable system I/O boards in a running system, eliminating the time lost in rebooting. Also, if a replacement board is not immediately available, the system administrator can use dynamic reconfiguration to shut down a failing board while allowing the system to continue operation.

See your hardware manufacturer's documentation for information about whether dynamic reconfiguration is supported on your server.

Using Volume Management

Beginning with the Solaris 2.2 release, a new layer of software manages CD-ROM and diskette devices -- Volume Management. This software automates the interaction between you and your CDs and diskettes.

The OpenWindows and CDE File Manager applications have been modified to use Volume Management to provide immediate user access to CDs and diskettes with file systems. See OpenWindows User's Guide for more information on File Manager's new features.

There are also several new commands to help you administer Volume Management on your system.

Volume Management automatically mounts CD and diskette file systems when removable media is inserted into the devices. Any CD or diskette file system will be automatically mounted in the locations described in Table 7-2.

Table 7-2 Location of CD-ROM and Diskette With a File System

Media 

Location 

CD

/cdrom/cdrom_name

Diskette

/floppy/floppy_name

If the CD or diskette does not contain a file system, it will be accessible in the locations described in Table 7-3.

Table 7-3 Location of CD-ROM and Diskette Without a File System

Media 

Location 

CD

/vol/dev/aliases/cdrom0

Diskette

/vol/dev/aliases/floppy0

For security reasons, these file systems are mounted setuid. See the mount(1M) man page for a description of this and other mount options.

For more information on configuring Volume Management and on using diskettes and CDs, see System Administration Guide, Volume I.

Man pages for Volume Management components are also available. See rmmount(1), rmmount.conf(4), volcancel(1), volcheck(1), vold(1M), volmgt(3), vold.conf(4), volfs(7), and volmissing(1).


Note -

Volume Management now controls these CD-ROM paths: /dev/dsk/c0t6d0s0 and /dev/rdsk/c0t6d0s0; and these diskette paths: /dev/diskette and /dev/rdiskette. Attempts to mount or access a CD or diskette using these paths will result in an error message.


There are several new commands to help you administer Volume Management on your system, as described in Table 7-4.

Table 7-4 Volume Management Commands

Command 

Description  

rmmount(1)

Removable media mounter. Used by vold to automatically mount /cdrom and /floppy when a CD or diskette is installed.

volcancel(1)

Cancels a user's request to access a particular CD-ROM or diskette file system 

volcheck(1)

Checks drive for installed media. By default, checks drive pointed to by /dev/diskette.

volmissing(1)

Notifies user when an attempt is made to access a CD or diskette that is no longer in the drive 

vold(1)

Volume Management daemon, controlled by /etc/vold.conf

There are also two configuration files to define Volume Management's actions: /etc/vold.conf and /etc/rmmount.conf. See the vold.conf(4) and rmmount.conf(4) man pages for descriptions of these files, and see System Administration Guide, Volume I for information on managing CD-ROM and diskette devices.