Logical device names are used to access disk devices when you:
Add a new disk to the system
Move a disk from one system to another system
Access or mount a file system residing on a local disk
Back up a local file system
Many administration commands take arguments that refer to a disk slice or file system.
Refer to a disk device by specifying the subdirectory to which it is symbolically linked, either /dev/dsk or /dev/rdsk, followed by a string identifying the particular controller, disk, and slice.
Disk and file administration commands require the use of either a raw (or character) device interface, or a block device interface. The distinction is made by how data is read from the device.
Raw device interfaces transfer only small amounts of data at a time. Block device interfaces include a buffer from which large blocks of data are read at once.
Different commands require different interfaces.
When a command requires the raw device interface, specify the /dev/rdsk subdirectory. (The “r” in rdsk stands for “raw.”)
When a command requires the block device interface, specify the /dev/dsk subdirectory.
When you are not sure whether a command requires use of /dev/dsk or /dev/rdsk, check the man page for that command.
The following table shows which interface is required for some commonly used disk and file system commands.
Table 30–1 Device Interface Type Required by Some Frequently Used Commands
Command |
Interface Type |
Example of Use |
---|---|---|
Block |
df /dev/dsk/c0t3d0s6 |
|
Raw |
fsck -p /dev/rdsk/c0t0d0s0 |
|
Block |
mount /dev/dsk/c1t0d0s7 /export/home |
|
Raw |
newfs /dev/rdsk/c0t0d1s1 |
|
Raw |
prtvtoc /dev/rdsk/c0t0d0s2 |
The string that you use to identify a specific slice on a specific disk depends on the controller type, either direct or bus-oriented. The following table describes the different types of direct or bus-oriented controllers on different platforms.
Table 30–2 Controller Types
Direct controllers |
Bus-Oriented Controllers |
---|---|
IDE (x86) |
SCSI (SPARC/x86) |
|
FCAL (SPARC) |
|
ATA (SPARC/x86) |
The conventions for both types of controllers are explained in the following subsections.
Controller numbers are assigned automatically at system initialization. The numbers are strictly logical and imply no direct mapping to physical controllers.
To specify a slice on a disk with an IDE controller on an x86 based system, follow the naming convention shown in the following figure.
To indicate the entire Solaris fdisk partition, specify slice 2 (s2).
If you have only one controller on your system, w is usually 0.
To specify a slice on a disk with a bus-oriented controller, SCSI for instance, on a SPARC based system, follow the naming convention shown in the following figure.
On a SPARC based system with directly connected disks such as the IDE disks on a Ultra10, the naming convention is the same as that for systems with bus-oriented controllers.
If you have only one controller on your system, w is usually 0.
For SCSI controllers, x is the target address set by the switch on the back of the unit, and y is the logical unit number (LUN) of the drive attached to the target. If the disk has an embedded controller, y is usually 0.
To indicate the whole disk, specify slice 2 (s2).
To specify a slice on a disk with a SCSI controller on an x86 based system, follow the naming convention shown in the following figure.
If you have only one controller on your system, v is usually 0.
For SCSI controllers, w is the target address set by the switch on the back of the unit, and x is the logical unit number (LUN) of the drive attached to the target. If the disk has an embedded controller, x is usually 0.
To indicate the entire Solaris fdisk partition, specify slice 2 (s2).