UNIX System Administration Handbook - Evi Nemeth [91]
8.5 VENDOR SPECIFICS
Unfortunately, the installation of new disks is a task that every UNIX vendor has decided to handle differently. For each vendor, we list the commands needed to add a disk and then present a bloody, blow-by-blow example of the procedure. Even a single vendor’s commands may vary among hardware architectures and OS releases.
Each example shows the addition of a SCSI disk with several partitions: one partition is a backup root partition (mounted on /bkroot), one is a swap partition, and one stores user files (mounted on /new). The disk we add is a Seagate ST446452W wide Ultra SCSI disk with an unformatted capacity of 63GB and a formatted capacity of about 47GB.
In many cases, seemingly arbitrary values are passed to the formatting programs. The reason is that many of the arguments are not meaningful for SCSI disks.11 In the olden days, you really had to know the exact layout of each disk; now, you just use the numbers made up by the manufacturer or the software.
Adding a disk to Solaris
In this section we review the process used to add a disk to a SPARC-based Solaris system. The procedure is similar for Solaris on Intel hardware, but the device names differ and the tasks vary somewhat.
After you connect the new disk (with the power off), run the probe-scsi command from the PROM monitor to check the target numbers of all SCSI devices.12 If your system continuously auto-reboots with no message but
rebooting...
you have an address conflict or a termination problem. If the system boots, you can look at the console messages to be sure the disk was found.
Our probe-scsi output looked like this:
ok probe-scsi
...
Target 3
Unit 0 Disk SEAGATE ST446452W 0001
ok boot -r
Specifying the -r flag when booting tells Solaris to reconfigure itself by scanning for new hardware and creating the appropriate device files for you. Once the system is booted, look in the output of dmesg to find the kernel messages relating to the new disk. In our case, the kernel complains because we have not yet written a Solaris label on the disk. However, that’s actually a good sign, because it means that the kernel is aware that the disk is present.
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@3,0
WARNING: /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@3,0 (sd3):
corrupt label - wrong magic number
Vendor 'SEAGATE', product 'ST446452W', 91923356
512 byte blocks
The block and character (raw) device files for the disk will appear under /dev/dsk and /dev/rdsk, respectively. The names of device files for disks are of the form
/dev/[r]dsk/cWtXdYsZ
where W is the controller number, X is the SCSI target number, Y is the SCSI logical unit number (or LUN, almost always 0), and Z is the partition (slice) number. These device files are actually just symbolic links into the /devices tree, where the real device files live. You should use always use the links located in /dev, however, as the files in /devices are hard to type and subject to change.
Whenever you add new hardware, you should run boot -r from the boot monitor to make sure that links for the new devices are set up properly. You can also create the appropriate links for disks with the drvconfig and disks commands (which actually run devfsadm). They take no arguments:
# drvconfig; disks
Under Solaris, partition 2 typically refers to the entire disk. We’ll use that partition when formatting and labeling the disk. Since our disk is SCSI target 3, the raw device file we will use to refer to the entire disk is /dev/rdsk/c0t3d0s2.
The format program formats and partitions disks. It is menu driven:
# format /dev/rdsk/c0t3d0s2
/dev/rdsk/c0t3d0s2: configured with capacity of 43.77GB
selecting /dev/rdsk/c0t3d0s2
[disk formatted]
FORMAT MENU:
...
If the disk was not previously labeled or if it was formerly used on another operating system, format might ask if you want to label the disk immediately. If you say yes, format installs a generic Solaris label.