Solaris 1.x to 2.x Transition Guide
この本のみを検索
PDF 文書ファイルをダウンロードする

Device Administration

7

This chapter explains SunOS release 5.5 device naming conventions and discusses changes to device-related tasks such as getting information about disks, adding devices to a system, and using the Volume Management.
This chapter contains the following sections:
Device Naming Conventionspage 61
Obtaining Disk Informationpage 63
Adding Devices to the Systempage 65
Using Volume Managementpage 66

Device Naming Conventions

Device naming conventions have changed between SunOS release 4.x and SunOS release 5.5. 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.5 commands that take device names as arguments must use the SunOS release 5.5 device naming conventions. However, you can still use and recognize the SunOS release 4.x 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.

Imported image(357x113)


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/c02d0s0, 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 SunOS 4.1.x, SCSI target 3 was called sd0, but is now properly named c0t3d0. SCSI target 0 was called sd3, but is now named c0t0d0. Other SCSI disk names translate normally. For example, in SunOS release 5.5 sd2a is c0t2d0s0 and sd2b is c0t2d0s1.

Convention for Tape Drives

Imported image(378x91)

Table 7-1 provides some examples that compare the SunOS release 4.x and SunOS release 5.5 device naming conventions.
Table 7-1
Device DescriptionSunOS release 4.x Device NameSunOS release 5.5 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.5 release have changed. df(1M), 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 those changes.
If you have installed the compatibility packages, SunOS release 4.x 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.5 command differs significantly from that used in the SunOS release 4.x version (see Appendix A, "Commands Reference Table," for more information).
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.5 version produces a full listing with totals.
Finally, use the SunOS release 5.5 device naming conventions when specifying special device names to this command. See "Device Naming Conventions" on page 61 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.x 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.
Figure 7-1 shows output for the SunOS release 5.5 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  
  * Partition  Tag  Flags   Sector     Count    Sector   Mount  
  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  

Figure 7-1 SunOS release 5.5 prtvtoc Command Output

devinfo Command

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

Adding Devices to the System

At boot time, the system does a self-test and checks for all devices that are attached to it. 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 you should be aware that 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.

Using Volume Management

Beginning with the Solaris 2.2 software, 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.
OpenWindows users will notice a slight change to the File Manager -- it has been modified to use Volume Management to provide immediate user access to CDs and diskettes with file systems. See Solaris 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 the CD and diskette file systems when removable media is inserted into the devices. If the CD or diskette contains a file system, it will be automatically mounted in the locations shown in Table 7-2.
Table 7-2
MediaLocation
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 following locations shown in Table 7-3.
Table 7-3
MediaLocation
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 CD-ROMs, see System Administration Guide, Volume I.
Manual 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
/dev/rdsk/c0t6d0s0

and these diskette paths:
/dev/diskette
/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 shown in Table 7-4.
Table 7-4
CommandDescription
rmmount(1)Removable media mounter. Used by vold to automatically mount /cdrom and /floppy when media is installed.
volcancel(1)Cancels a user's request to access a particular CD-ROM or diskette file system
Table 7-4
CommandDescription
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 media 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 floppy devices.