Peripherals Administration
  Buscar sólo este libro
Descargar este libro en PDF

Disk Drives

2

This chapter provides conceptual and procedural information for setting up secondary hard disk drives connected to Solaris platforms. For information on administering system hard disk drives which contain the system software, see the Administration Supplement for Solaris Platforms.
Use the following table to find specific information on administering secondary disk drives.
About Hard Disks in Generalpage 28
About Disk Formattingpage 30
About Disk Slicespage 31
About Disk Labelspage 35
Autoconfiguration of SCSI Disk Drivespage 36
Adding a System Diskpage 38
Adding a Secondary Diskpage 38
How to Perform a Reconfiguration Bootpage 39
How to Check If a Disk Is Formattedpage 40
How to Format a Diskpage 41
How to Check If a Disk Has Slicespage 45
How to Create Slices and Label a Diskpage 47
How to Create a File System for Each Slicepage 50
How to Add a Third-Party Diskpage 51
How to Remove a Disk Drivepage 54

About Preparing Hard Disks for Use

Whenever you add a new hard disk to a system or change the system's configuration, you need to prepare the disk to store and access data. Preparing the disk may require:
  • Formatting
  • Slice creation (sometimes referred to as partitioning)
  • Labeling

About Hard Disks in General

Hard disks consist of several separate disks mounted on a common spindle. Data stored on each disk surface is written and read by disk heads.
The circular path that a disk head traces over a spinning disk is called a track. (See Figure 2-1.) Taken together, the set of tracks traced across all the individual disk surfaces for a single position of the heads is called a cylinder.
Each track is made up of a number of sectors laid end-to-end. A sector consists of a header, a trailer, and 512 bytes of data. The header and trailer contain error-checking information that helps ensure the accuracy of the data.

Gráfico

Figure 2-1

Disk Controllers

Associated with every disk is a controller, which may be located on a separate circuit board, or may be embedded, or integrated, in the disk drive itself. The controller is an intelligent device responsible for organizing data on the disk.
Disks may contain areas where data cannot be written to and retrieved from reliably. These areas are called defects. The controller uses the error-checking information in each disk block's trailer to determine whether or not a defect is present in that block. When a block is found to be defective, the controller can be instructed to add it to a defect list and avoid using that block in the future.

Special Areas of the Disk

The beginning and ending portions of the disk are reserved. Either the first or second sector is where the disk label is stored. The disk label describes how information is arranged on the disk.
The last two cylinders are set aside for diagnostic use and for storing the disk defect list and a backup copy of the label.

Disk Drivers

The Solaris operating system does not directly communicate with disk controllers. Controllers for disk drives may require different data formats, protocols, and transmission rates. A device driver is a low-level program that allows the operating system to communicate with a specific piece of hardware such as a disk controller.
The Solaris environment provides a wide range of device drivers for various devices. These device drivers can be found in /kernel/drv.
If you have a disk drive that needs a device driver not listed in /kernel/drv, you will need to add the device driver to your system. See Chapter 5, "Device Drivers," for more information on how to install device drivers.

Disk Administration Tool

The Solaris tool for maintaining disks is the format utility. This name is something of a misnomer, however, because format allows you to:
  • Analyze
  • Format
  • Partition (create slices)
  • Repair
Sun cannot guarantee that its format utility will work properly with all third-party disk driver. If the disk driver is not compatible with the Solaris format utility, the disk drive vendor should supply you with a custom format program.
For reference information on the format utility, see Appendix C, "format Utility."

About Disk Formatting

Before you can use a disk, it must be formatted. Formatting involves two separate processes:
  • Formatting - Writing format information to the disk
  • Surface analysis - Compiling an up-to-date list of disk defects
When you format a disk, header and trailer information (as well as other information) is superimposed on the disk.
During formatting, the controller scans the disk for defects--a process known as surface analysis.
Defects and formatting information reduce the total disk space available for data. This is why a new disk will usually hold only 90 to 95 percent of its capacity after formatting. This percentage varies according to disk geometry, and decreases as the disk ages and develops more defects.

When Should You Format a Disk?

Formatting is a destructive process--it overwrites data on the disk. For this reason, disks are usually formatted only once--by the manufacturer or reseller.
However, if you have reason to believe disk defects are responsible for recurring problems, an additional surface analysis may be warranted. The format utility provides surface analysis commands that do not corrupt data.

Is the Disk Properly Formatted?

The format utility will tell you if the disk is properly formatted. When you first run the program and select the appropriate disk, you'll see a message similar to the following:

  selecting c0t0d0s0: <CDC Wren IV 94171-344>  
  [disk formatted]  

About Disk Slices

Files stored on a disk are contained in file systems. Each file system on a disk is assigned to a slice--a group of cylinders on the disk that has been set aside for use by a file system. Each disk slice appears to the operating system (and to the system administrator) as though it were a separate disk drive.

Note - Slices are sometimes referred to as partitions. Strictly speaking, a partition is a collection of slices on certain Solaris platforms. This book attempts to use slice whenever possible. However, certain interfaces, such as the format utility, refer to slices as partitions.

The system administrator determines how large each disk slice should be. In so doing, it's important to bear in mind that each disk slice holds only one file system, and that no file system can span multiple slices.
When you set up a disk's slices, you choose not only the size of each slice, but also which slices to use. Your decisions about these matters depend on how you intend to use the system to which the disk is attached. See "Determining Which Slices to Use" for more information on system configurations and the slices each uses.

The Eight Solaris Slices

Solaris defines eight disk slices and assigns to each a conventional use. These slices are numbered 0 through 7. Your Solaris platform may contain more slices. See the Administration Supplement for Solaris Platforms for more information. Table 2-1 summarizes the contents of the eight Solaris slices.
Table 2-1
SliceFile SystemPurpose
0rootHolds the files and directories that make up the operating system.
1swapProvides virtual memory, or swap space. Swap space is used when a new program you need to run is too large to fit in a computer's memory at the same time as other programs that are already running. When this happens, the operating system "swaps" different programs from the computer's memory to the disk--and vice versa--as needed.
2--Used by the operating system to reference the entire disk. It is defined automatically by Sun's format and the Solaris installation programs and should not be altered.
3/exportHolds alternative versions of the operating system. These alternative versions are required by client machines whose architectures differ from that of the server. Clients with the same architecture type as the server obtain executables from slice 6.
4/export/swapProvides virtual memory space for the client rather than for the server.
5/optHolds application software that is added to a system. If there is not enough room on the disk to put the /opt file system in slice 5, the file system is put in slice 0.
6/usrHolds operating system commands--also known as executables-- designed to be run by users. This slice also holds documentation, system programs (init and syslogd, for example) and library routines.
7/home or
/export/home
Holds files that are created, arranged, and maintained by users.

Note - The Solaris installation program provides slice size recommendations based on the software you select for installation.

System vs. Secondary Disks In a multiple disk arrangement, the disk containing the operating system software and swap space (that is, the disk holding slices 0 and 1) is called the system disk. Disks other than the system disk are called secondary disks.
Locating a system's slices on multiple disks allows you to modify file systems and slices on the secondary disks without having to shut down the system or reload operating system software.
Having more than one disk also increases input-output (I/O) volume. By distributing disk load across multiple disks, you can avoid I/O bottlenecks at the controller level.
Single vs. Multiple Disks Although a single disk can hold all eight slices, it is also possible to use two or more disks to hold the slices required by a system.

Note - A slice cannot be split between two or more disks. However, multiple swap slices on separate disks are allowed.

For instance, a single disk might hold slices 0 and 1, while a separate disk is provided for slices 6 and 7.
Determining Which Slices to Use There are five system configurations
  • Servers
  • Diskless clients
  • Standalone systems
  • Single systems
  • Dataless clients
Each system configuration requires the use of different slices. Table 2-2 lists these requirements.
Table 2-2
SliceServersDiskless ClientsStandaloneSingleDataless
0root(on server)rootrootroot
1swap(on server)swapswapswap
2----------
3/export--------
4/export/swap--------
Table 2-2
SliceServersDiskless ClientsStandaloneSingleDataless
1 5/opt(on server)/opt/opt/opt
6/usr(on server)/usr/usr(on server)
7/export/home(on server)/home/home(on server)
1. Slice 5 (for optional software) can be used in the configurations, though it is usually omitted
The Donor, or Free Hog, Slice When you use the format utility to change the size of one or more disk slices, you designate a temporary slice that will expand and shrink to accommodate the resizing operations.
This slice donates, or "frees," space when you expand a slice, and receives, or "hogs," the discarded space when you shrink a slice. For this reason, the donor slice is sometimes called the free hog.
The donor slice exists only during installation or when you run the format utility. There is no permanent donor slice during day-to-day, normal operations.

Slice Tables and the format Utility

The partition submenu of the format utility allows you to manipulate a disk's slices by editing what is known as a slice table. A slice table lists the disk slices and contains entries describing each.

  Part   Tag     Flag    Cylinders    Size       Blocks  
  0      root    ru      0             0         (0/0/0)  
  1      swap    wm      0             0         (0/0/0)  
  2      backup  -       0 - 1253     198.39MB    (1254/0/0)  
  3      -       -       0             0         (0/0/0)  
  4      -       -       0             0         (0/0/0)  
  5      -       -       0             0         (0/0/0)  
  6      /usr    rm      0 - 747      118.34MB    (748/0/0)  
  7      /home   wm    748 - 1253      80.05MB    (506/0/0)  

The fields Tag and Flag describe the contents and access privileges associated with each slice. These fields are provided solely as a convenience--the operating system ignores them.
The range of numbers in the Cylinders field shows the first and last cylinder occupied by the slice. The Size field describes the slice size in megabytes or gigabytes, as appropriate.
The Blocks field provides still more size information arranged in a triplet of numbers separated by slashes. The numbers refer to the slice size in cylinders, heads, and sectors, respectively.

Note - To eliminate a slice, you simply set its size to 0 (see, for instance, slice 5 above).

About Disk Labels

A special area of every disk is set aside for storing information about the disk's controller, geometry, and slices. That information is called the disk's label.
To label a disk means to write slice information onto the disk. You label a disk only after changing its slices.
If you fail to label a disk after creating slices, the operating system has no way of "knowing" about the slices, so the disk will not work.

How to Examine a Label

You can examine some of the most important information stored on a disk's label by using the prtvtoc command:

  # prtvtoc /dev/rdsk/c0t0d0s0  
  * c0t0d0s0 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      2    00          0     37260     37259   /  
         1      3    01      37260     77760    115019  
         2      5    01          0    406296    406295  
         6      4    00     115020    283824    398843   /usr  
         7      6    00     398844      7452    406295   /home  

The label shows the number of cylinders (1272) and heads (which is the same as the number of tracks per cylinder, in this case 9), as well as how the disk's slices are arranged.

Autoconfiguration of SCSI Disk Drives

In Solaris 2.3 and subsequent releases, the format utility automatically configures SCSI disk drives even if that specific type of drive is not listed in the /etc/format.dat file. This feature enables you to format, slice, and label any disk drive compliant with SCSI-2 specification for mode sense pages. The SCSI disk drives must been turned on when a reconfiguration boot is performed so the format utility can issue SCSI commands to obtain the disk geometry and
capacity information. The partition table is then automatically generated by format. Here's the default slice rules that format uses to create the partition table.
Table 2-3
Disk sizeRootSwap
0 - 180 Mbytes 16 Mbytes 16 Mbytes
180 Mbytes - 280 Mbytes 16 Mbytes 32 Mbytes
280 Mbytes - 380 Mbytes 24 Mbytes 32 Mbytes
380 Mbytes - 600 Mbytes 32 Mbytes 32 Mbytes
600 Mbytes - 1.0 Gbytes 32 Mbytes 64 Mbytes
1.0 Gbytes - 2.0 Gbytes 64 Mbytes 128 Mbytes
2.0 Gbytes -128 Mbytes 128 Mbytes
In all cases, slice 6 (/usr) gets the remainder of the space on the disk.
Here's an example of a format-generated partition table for a 1.3Gb SCSI disk drive.

  Part      Tag    Flag     Cylinders        Size       Blocks  
  0         root    wm       0 -   96       64.41MB    (97/0/0)  
  1         swap    wu      97 -  289      128.16MB    (193/0/0)  
  2       backup    wu       0 - 1964        1.27GB    (1965/0/0)  
  6         usr     wm     290 - 1964        1.09GB    (1675/0/0)  

Instructions for Setting Up Disks

This section includes step-by-step instructions for performing tasks related to disks. For some tasks, you will find an example of the screen input and output after the instructions.

Note - You must be superuser to perform the following procedures.

Adding a System Disk

See the Solaris installation guides--SPARC: Installing Solaris Software and x86: Installing Solaris Software-- for the specific tasks of adding a system disk. Adding a system disk includes:
  • Loading Solaris from CD-ROM
  • Selecting and loading the appropriate software clusters

Adding a Secondary Disk

To add a secondary disk, you may need to follow some or all of these procedures:
Many disk drives are shipped already formatted. To determine if your disk is already formatted, see "How to Check If a Disk Is Formatted."

· How to Perform a Reconfiguration Boot

  1. Create a file called /reconfiguration that will be read when the system is booting.


  # touch /reconfigure  

The /reconfigure file will cause the SunOS(TM) software to check for the presence of any newly installed peripheral devices when you power on or boot your system later.
  1. Change directories to / and shut down the system.


  # cd /  
  # /usr/sbin/shutdown -y -g30 -i0  
  .  
  .  
  .  
  ok  


Note - The 0 in i0 is a zero.

In the example above, the command sends a message to all users who are logged in stating they have 30 seconds (-g30) before the system begins to shut down. The ok or > prompt is displayed once the operating environment is shut down.
  1. Turn off power to the system after the ok or > prompt is displayed. Refer to the hardware installation guide that accompanies your system for the location of the power switch.

  2. Turn off power to all external peripheral devices.

    For location of power switches on any peripheral devices, refer to the hardware installation guides that accompany your peripheral devices.

  3. Install the peripheral device.

    Refer to the hardware installation guides that accompany the peripheral devices for information on how to install and connect those devices.

  4. Turn on the power to all external peripherals.

  1. Turn on the power to the system.

    The system will boot and you will be shown the login prompt.

· How to Check If a Disk Is Formatted

In most cases, disks are formatted by the manufacturer or reseller and do not need to be reformatted when you install the drive. To check a disk to see if it is already formatted, follow these steps.
  1. Enter the format utility by typing format at the root prompt and pressing Return.

  2. Enter the number of the disk that you want to check from the list displayed on your screen.

    If the disk you chose is formatted, you will see the following message:

[disk formatted]

Here's an example where the second external disk drive is checked.

  # format  
  Searching for disks...done  
  
  AVAILABLE DISK SELECTIONS:  
         0. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>  
            /sbus@1,f8000000/esp@0,800000/sd@3,0  
         1. c1t1d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
             /sbus@1,f8000000/esp@0,8000000/sd@1,0  
          2. c1t2d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
             /sbus@1,f8000000/esp@0,8000000/sd@2,0  
  Specify disk (enter its number):2  
   selecting c1t2d0  
  [disk formatted]  

· How to Format a Disk


Note - Formatting a disk may not be necessary. Many disks are formatted by the manufacturer or reseller. To determine if your disk is formatted, see "How to Check If a Disk Is Formatted" on page 40.

Follow these steps to format a disk:
  1. Enter the format utility by typing format at the root prompt and pressing Return.

  2. Enter the number of the disk that you want to format from the list displayed on your screen.

    If the disks have already been labeled, the system then displays information similar to the following.


  Searching for disks...done  
  AVAILABLE DISK SELECTIONS:  
       0.  c0t3d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@3,0  
       1.  c1t1d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@1,0  
       2.  c1t2d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@2,0  
  Specify disk (enter its number):1  

In this example, disk drive 0 is the system disk and disk drives 1 and 2 are external drives that have been added to the system. Drive 1 with address c1t1d0 is the first external hard disk that is connected to a SCSI card. Drive 2, with address c1t2d0, is the second external hard disk.

CAUTION Caution - Do not select the system disk. Formatting your system disk deletes your operating system and any data that you may have on this disk.

If the Solaris software had been unable to automatically label drive 1 with address c1t1d0, the following is displayed:

  Searching for disks...done  
  
  c1t1d0:  configured with capacity of 198 MB  
  
  AVAILABLE DISK SELECTIONS:  
       0.  c0t3d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@3,0  
       1.  c1t1d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@1,0  
       2.  c1t2d0 <SUN0207 cyl  1214 alt 2 hd 9 sec 36>  
           /sbus@1,f8000000/esp@0,8000000/sd@2,0  
  Specify disk (enter its number):1  
  
  Selecting c1t1d0  
  [disk formatted]  
  Disk not labeled. Label it now? y  

The following prompts are only displayed when the operating system is unable to label a disk.
cntndn:configured with capacity . . .
Disk not labeled. Label it now?

If the format utility does not recognize the disk drive, you may need to create a format.dat entry. See "How to Add a Third-Party Disk" for instructions on how to add a format.dat entry. Another possible reason that the format utility does not recognize the disk drive is that the disk drive hardware is malfunctioning. Check the documentation accompanying the drive for troubleshooting procedures.
  1. Enter the defect menu by typing defect option at the format> prompt and pressing Return.

    The Defect menu entries that are displayed depend on the type of disk drive that you are trying to format. The menu that your system displays may differ from the one below.


  format> defect  
  
  DEFECT MENU:  
  
     primary - extract manufacturer's defect list  
     print   - display working list  
     dump    - dump working list to file  
     commit  - set current list = working list  
     quit  
  
  format>  

  1. Check the Defect menu to see if your disk drive has a SCSI interface.

    If your disk drive has a SCSI interface, the commit option is not displayed. If this is the case, go to Step 7.

  2. Extract the manufacturer's defect list by typing primary at the defect> prompt and pressing Return.


  defect> primary  
  
  Extracting manufacturer's defect list ... Extraction complete.  
  Current Defect List updated, total of 20 defects.  

  1. To use the manufacturer's defect list while formatting the disk drive, type

    commit and press Return. Confirm your choice by typing y.


  defect> commit  
  Ready to update Current Defect List, continue? y  
  Current Defect List updated, total of 20 defects.  
  Disk must be reformatted for changes to take effect.  

  1. Leave the Defect menu.


  defect> quit  

  1. To begin formatting the disk, type format at the format> prompt. Confirm the command by typing y.


  format> format  
  Ready to format. Formatting cannot be interrupted  
  and takes 10 minutes (estimated). Continue? y  
  Beginning format. The current time is Tue May  3 17:44:42 1994  
  
  Formatting ...  
  done  
  
  Verifying media ...  
  pass 0 - pattern = 0xc6dec6de  
  pass 1 - pattern = 0x6db6db6d  
  total of 0 defective blocks repaired.  
  format>  


Note - Formatting may take anywhere from a few minutes to several hours, depending on the type and size of the disk.

· How to Check If a Disk Has Slices

This procedure assumes that you have selected the disk drive you want to examine when you entered the format utility.

Note - The format utility uses the term partition in place of slice.

  1. Enter the partition menu by typing partition at the format> prompt.


  format> partition  
  PARTITION MENU:  
          0      - change '0' partition  
          1      - change '1' partition  
          2      - change '2' partition  
          3      - change '3' partition  
          4      - change '4' partition  
          5      - change '5' partition  
          6      - change '6' partition  
          7      - change '7' partition  
          select - select a predefined table  
          modify - modify a predefined partition table  
          name   - name the current table  
          print  - display the current table  
          label  - write partition map and label to the disk  
          quit  
  partition>  

  1. At the partition> prompt, type print to display the slice table for the current disk drive.


  partition> print  
  Current partition table (original):  
  Part      Tag    Flag     Cylinders        Size       Blocks  
    0       root    wm       0 -  136       48.16MB    (137/0/0)  
    1       swap    wu     137 -  228       32.34MB    (92/0/0)  
    2     backup    wm       0 - 1150      404.65MB    (1151/0/0)  
    3 unassigned    wm       0               0         (0/0/0)  
    4          -    wm     229 -  285       20.04MB    (57/0/0)  
    5          -    wm     286 -  414       45.35MB    (129/0/0)  
    6        usr    wm     415 -  926      180.00MB    (512/0/0)  
    7       home    wm     927 - 1150       78.75MB    (224/0/0)  

In this example, the drive has slices. Specific slice tags and sizes have been assigned. If you see that no slice sizes are assigned, the disk drive probably does not have slices.

· How to Create Slices and Label a Disk

Creating slices on a disk may not be necessary. Many manufacturers or resellers create slices on disks before shipping the disks. To determine if your disk has slices, see "How to Check If a Disk Has Slices."

Note - The format utility uses the term partition in place of slice.

  1. Enter the partition menu by typing partition at the format> prompt.


  format> partition  
  PARTITION MENU:  
          0      - change '0' partition  
          1      - change '1' partition  
          2      - change '2' partition  
          3      - change '3' partition  
          4      - change '4' partition  
          5      - change '5' partition  
          6      - change '6' partition  
          7      - change '7' partition  
          select - select a predefined table  
          modify - modify a predefined partition table  
          name   - name the current table  
          print  - display the current table  
          label  - write partition map and label to the disk  
          quit  
  partition>  

  1. At the partition> prompt, type modify.


  partition> modify  

  1. Type 0 for Current partition table, and type y to confirm your choice.


  Select partitioning base:  
   0. Current partition table (original sd3)  
   1. All Free Hog  
  Choose base (enter number) [0]? 0  
  
  Part     Tag         Flag      Cylinders       Size           Blocks  
   0       unassig     flag      0 - 505         80.05MB        (506/0/0)  
            ned  
   1       -           -         506 - 568       9.97MB         (63/0/0)  
   2       -           -         0 - 1253        198.39MB       (1254/0/0)  
   3       -           -         0               0              (0/0/0)  
   4       -           -         0               0              (0/0/0)  
   5       -           -         0               0              (0/0/0)  
   6       -           -         569 - 937       58.38MB        (369/0/0)  
   7       -           -         938 - 1253      49.99MB        (316/0/0)  
  
  Do you wish to continue creating a new partition  
  table based on above table[yes]? y  

  1. Type the number of the slice you choose as the donor (free hog) slice.


  Free Hog partition[6]? 6  

  1. For each slice, type the desired size in megabytes.

    Type the letters mb (for megabytes) after the size, and press Return after each entry.


  Enter size of partition '0' [163944b, 506c, 80.05mb]: 0  
  Enter size of partition '1' [20412b, 63c, 9.97mb]: 0  
  Enter size of partition '3' [0b, 0c, 0.00mb]: 0  
  Enter size of partition '4' [0b, 0c, 0.00mb]: 0  
  Enter size of partition '5' [0b, 0c, 0.00mb]: 0  
  Enter size of partition '7' [102384b, 316c, 49.99mb]: 80mb  


CAUTION Caution - When editing a slice table, be careful to avoid having slices overlap. This will cause problems!

  1. Type y to confirm that the altered slice table is correct.


  Part     Tag         Flag      Cylinders       Size           Blocks  
   0       -           -         0               0              (0/0/0)  
   1       -           -         0               0              (0/0/0)  
   2       -           -         0 - 1253        198.39MB       (1254/0/0)  
   3       -           -         0               0              (0/0/0)  
   4       -           -         0               0              (0/0/0)  
   5       -           -         0               0              (0/0/0)  
   6       -           -         0 - 747         118.34MB       (748/0/0)  
   7       -           -         748 - 1253      80.05MB        (506/0/0)  
  
  Okay to make this the current partition table[yes]? y  

  1. (Optional) Type a name for the new slice table.

    If you do not want to name the slice table, just press Return. If you use a name that includes embedded spaces, enclose the name in quotation marks.


  Enter table name (remember quotes): new_improved  

  1. At the partition> prompt, type label. At the confirmation prompt, type y.


  partition> label  
  ok to label disk? y  

  1. Type q twice to exit from the format utility.

· How to Create a File System for Each Slice

  1. Type the command prtvtoc /dev/rdsk/devices2 Substitute the device identifier of the disk you're adding for device. (Don't type any spaces between device and s2.)


  # prtvtoc /dev/rdsk/c0t2d0s2  
  
  [...]  
  
  *                               First      Sector     Last       Mount  
  *Partition     Tag    Flags     Sector     Count      Sector     Directory  
  2              5      01        0          406296     406295  
  6              4      00        0          327564     327563  
  7              0      00        327564     78732      406295  

  1. Note what slices are available on the disk.

  2. Prepare a file system for each slice. Type the command: newfs /dev/rdsk/deviceslice, and then type y to confirm. Substitute the proper device and slice identifiers for device and slice. (Don't type any spaces between device and slice.)


  # newfs /dev/rdsk/c0t2d0s7  
  newfs: construct a new file system /dev/rdsk/c0t2d0s7 (y/n)? y  
  /dev/rdsk/c0t2d0s7:   A sectors in B cylinders of C tracks...  
       83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)  
  super-block backups (for fsck -b #) at:  
   32, 5264, 10496, 15728, 20960, 26192, 31424...  
  [...]  
  #  

  1. Repeat the newfs command (as above) for each disk slice.

  2. Mount the file systems.

    The disk is ready for you to mount the file systems. For information about mounting file systems, see File System Administration.

· How to Add a Third-Party Disk

The Solaris environment supports many third-party disks. However, you may need to supply either a device driver, a format.dat entry, or both of these.
If the third-party disk was designed to work with standard SunOS operating system-compatible device drivers, creating an appropriate format.dat entry should be enough to allow the disk to be recognized by the format utility. In other cases, you'll need to load a third-party device driver to support the disk.
This section discusses what to do if some of this software support is missing. Typically, this occurs when you invoke the format utility and find that the disk type is not recognized.
Supply the missing software as described in this section, and then refer to the appropriate configuration procedure for system disks (page 38) or secondary disks (page 38).
· Adding a Device Driver
If a nonstandard device driver is required, it should be provided by the third-party vendor. Following the instructions in Chapter 5, "Device Drivers," for adding a device driver.

Note - Sun cannot guarantee that its format utility will work properly with all third-party disk driver. If the disk driver is not compatible with the Solaris format utility, the disk drive vendor should supply you with a custom format program.

· Creating a format.dat Entry
Unrecognized disks cannot be formatted without precise information about the disk's geometry and operating parameters. This information is supplied in the /etc/format.dat file.

Note - SCSI-2 drives do not require a format.dat entry. Starting in Solaris 2.3, the format utility automatically configures the SCSI-2 drives if the drives are powered on during a reconfiguration boot.

If your disk was not recognized, use a text editor to create an entry in format.dat for the disk. You'll need to gather all the pertinent technical specifications about the disk and its controller before you start. This information should have been provided with the disk. If not, contact the disk manufacturer or your supplier. See Appendix C, "format Utility," for more information on the /etc/format.dat file.
The type of information generally required is shown in Table 2-4. Following the table is a sample format.dat entry.

Note - The values shown in Table 2-4 are examples; they are not necessarily the correct values to describe your disk's geometry and operating parameters.

Table 2-4 /etc/format.dat
Information NeededHow SpecifiedNotes
Controller typectlr = XY450Controllers supported by SunOS operating system utilities: . Xylogics(R) XY450 or XY451 SMD . Xylogics 7053 (SMD) . Emulex(R) MD21: SCSI with ESDI devices . SCSI: True SCSI (CCS or SCSI-2) . ISP-80: IPI controller
Alternate cylindersacyl = 2
Alternate sectors per trackasect = 2
Alternate tracksatrks = 2
Formatting time per cylinderfmt_time = 4
Number of logical cylindersncyl = 840Required
Number of logical headsnhead = 20Required
Number of logical sectors per tracknsect = 46Required
Number of physical cylinderspcyl = 842Required
Table 2-4 /etc/format.dat(Continued)
Information NeededHow SpecifiedNotes
Number of physical headsphead = 20
Number of physical sectors per trackpsect = 48psect = nsect + asect
Rotational speedrpm = 3961Required
Number of bytes per trackbpt = 28160Required--SMD disks only
Number of bytes per sectorbps = 595Required--SMD disks only
Drive typedrive_type = 1Required--XY450 SMD disks only
Read retriesread_retries = 1SCSI and MD-21 disks only
Write retrieswrite_retries = 1SCSI and MD-21 disks only
Cylinder skewcyl_skew = 2SCSI and MD-21 disks only
Track skewtrk_skew = 2SCSI and MD-21 disks only
Tracks per zonetrks_zone = 15SCSI and MD-21 disks only
Cache parametercache = 0x11SCSI and MD-21 disks only
Prefetch parameterprefetch = 2SCSI and MD-21 disks only
Maximum prefetchmax_prefetch = 5SCSI and MD-21 disks only
Minimum prefetchmin_prefetch = 2SCSI and MD-21 disks only

Example of a format.dat Entry

The following is a sample entry from a format.dat file:

  disk_type = "Fujitsu-M2351 Eagle" \  
   : ctlr = XY450 : fmt_time = 4 \  
   : ncyl = 840 : acyl = 2 : pcyl = 842 : nhead = 20 : nsect = 46 \  
   : rpm = 3961 : bpt = 28160 : bps = 595 : drive_type = 0  

· How to Remove a Disk Drive

You would remove a disk drive from a system to:
  • Replace a disk that is defective or inadequate
  • Move the drive to another system that needs the extra disk space

Replacing a Defective Disk

To replace a defective disk, do the following:
  1. Back up any data you want to save. See File System Administration for more information on backing up files.

  2. Unmount any file systems that may be mounted on the defective disk with unshare(1M).

  3. Physically disconnect the defective drive and connect the replacement.

  4. Turn to the appropriate instructions in this document for adding a system disk (page 38) or a secondary disk (page 38).

  5. Restore any data you previously backed up. See File System Administration for more information on backing up files.