System Administration Guide, Volume 1

Chapter 31 IA: Adding a Disk (Tasks)

This chapter provides the procedures for adding a disk on an IA based system. This is a list of the step-by-step instructions in this chapter.

For overview information about disk management, see Chapter 28, Disk Management (Overview). For step-by-step instructions on adding a disk to a SPARC based system, see Chapter 30, SPARC: Adding a Disk (Tasks).

IA: About System and Secondary Disks

A system disk contains the root (/) or /usr file systems, or both. If the disk containing either of these file systems becomes damaged, you have two ways to recover:

A secondary disk doesn't contain the root (/) and /usr file systems. It usually contains space for user files. You can add a secondary disk to a system for more disk space or you can replace a damaged secondary disk. If you replace a secondary disk on a system, you can restore the old disk's data on the new disk.

IA: Adding a System or Secondary Disk Task Map

Table 31-1 IA: Adding a System or Secondary Disk Task Map

Task 

Description 

For Instructions, Go To 

1. Connect the Disk and Boot 

System Disk

Connect the new disk and boot from a local or remote Solaris CD.  

"IA: How to Connect a System Disk and Boot"

 

Secondary Disk

Connect the new disk and perform a reconfiguration boot, so the system will recognize the disk.  

"IA: How to Connect a Secondary Disk and Boot"

2. Create Slices and Label the Disk 

Create disk slices and label the disk if it has not already been done by the disk manufacturer.  

"IA: How to Create a Solaris fdisk Partition" and "IA: How to Create Disk Slices and Label a Disk"

3. Create File Systems 

Create UFS file systems on the disk slices with the newfs command. You must create the root (/) or /usr file system (or both) for a system disk.

"IA: How to Create File Systems"

4. Restore File Systems 

Restore the root (/) or /usr file system (or both) on the system disk. If necessary, restore file systems on the secondary disk.

Chapter 44, Restoring Files and File Systems (Tasks)

5. Install Boot Block 

System Disk Only. Install the boot block on the root (/) file system, so the system can boot.

"IA: How to Install a Boot Block on a System Disk"

IA: Guidelines for Creating an fdisk Partition

Follow these guidelines when setting up the fdisk partition.


x86 only -

Solaris slices are sometimes called partitions. This user guide uses the term slice, but some Solaris documentation and programs might refer to a slice as a partition. To avoid confusion, Solaris documentation tries to distinguish between fdisk partitions (which are supported only on SolarisTM (Intel Platform Edition) and the divisions within the Solaris fdisk partition, which might be called slices or partitions.


IA: How to Connect a System Disk and Boot

This procedure assumes that the system is down.

  1. Disconnect the damaged system disk from the system.

  2. Make sure the disk you are adding has a different target number than the other devices on the system.

    You will often find a small switch located at the back of the disk for this purpose.

  3. Connect the replacement system disk to the system and check the physical connections.

    Refer to the disk's hardware installation guide for installation details. Also, refer to the Solaris 8 (Intel Platform Edition) Device Configuration Guide about hardware configuration requirements specific to the disk.

  4. Follow steps a-e if you are booting from a local or remote Solaris CD.

    If you are booting from the network, skip step a.

    1. Insert the Solaris installation CD into the CD-ROM drive.

    2. Insert the Solaris boot diskette into the primary diskette drive (DOS drive A).

    3. Press any key to reboot the system if the system displays the Type any key to reboot prompt. Or, use the reset button to restart the system if the system is shut down.

      The Boot Solaris screen is displayed after a few minutes.

    4. Select the CD-ROM drive or net(work) as the boot device from the Boot Solaris screen.

      The Current Boot Parameters screen is displayed.

    5. Boot the system in single-user mode.


      Select the type of installation: b -s
      

      After a few minutes, the root prompt (#) is displayed.

IA: Where to Go From Here

After you boot the system, you can create slices and a disk label on the disk. Go to "IA: How to Create Disk Slices and Label a Disk".

IA: How to Connect a Secondary Disk and Boot

  1. Become superuser.

  2. If the disk is unsupported by the Solaris software, add the device driver for the disk by following the instructions included with the hardware.

  3. Create the /reconfigure file that will be read when the system is booted.


    # touch /reconfigure
    

    The /reconfigure file will cause the SunOS software to check for the presence of any newly installed peripheral devices when you power on or boot your system later.

  4. Shut down the system.


    # shutdown -i0 -g30 -y
    

    -i0

    Brings the system down to init state 0 (zero), the power-down state. 

    -gn

    Notifies logged-in users that they have n seconds before the system begins to shut down.

    -y

    Specifies the command should run without user intervention. 

    The Type any key to reboot prompt is displayed.

  5. Turn off power to the system and all external peripheral devices.

  6. Make sure the disk you are adding has a different target number than the other devices on the system.

    You will often find a small switch located at the back of the disk for this purpose.

  7. Connect the disk to the system and check the physical connections.

    Refer to the disk's hardware installation guide for installation details. Also, refer to the Solaris 8 (Intel Platform Edition) Device Configuration Guide for hardware configuration requirements specific to the disk.

  8. Turn on the power to all external peripherals.

  9. Turn on the power to the system.

    The system will boot and display the login prompt.

IA: Where to Go From Here

After you boot the system, you can create slices and a disk label on the disk. Go to "IA: How to Create Disk Slices and Label a Disk".

IA: How to Create a Solaris fdisk Partition

  1. Make sure you have read "IA: Guidelines for Creating an fdisk Partition".

  2. Become superuser.

  3. Start the format(1M) utility.


    # format
    
  4. Enter the number of the disk on which to create a Solaris fdisk partition from the list displayed on your screen.


    Specify disk (enter its number): disk-number
    

    disk-number

    Is the number of the disk on which to create a Solaris fdisk partition.

  5. Go into the fdisk menu.


    format> fdisk
    

    The fdisk menu displayed is dependent upon whether the disk has existing fdisk partitions. Determine the next step using the following table.

    If You Want To ... 

    Go To ... 

    See ... 

    Create a Solaris fdisk partition to span the entire disk.

    Step 6 

    "IA: Example--Creating a Solaris fdisk Partition That Spans the Entire Drive"

    Create a Solaris fdisk partition and preserve existing non-Solaris fdisk partition(s).

    Step 7 

    "IA: Example--Creating a Solaris fdisk Partition and Preserving an Existing fdisk Partition"

    Create a Solaris fdisk partition and additional non-Solaris fdisk partition(s).

    Step 7 

    "IA: Example--Creating a Solaris fdisk Partition and an Additional fdisk Partition"

  6. Create and activate a Solaris fdisk partition spanning the entire disk by specifying y at the prompt. Then go to step 14.


    The recommended default partitioning for your disk is:
     
      a 100% "SOLARIS System" partition.
     
    To select this, please type "y".  To partition your disk
    differently, type "n" and the "fdisk" program will
    let you select other partitions. y
    
  7. Specify n at the prompt if you do not want the Solaris fdisk partition to span the entire disk.


    To select this, please type "y".  To partition your disk
    differently, type "n" and the "fdisk" program will let you
    select other partitions. n
    Total disk size is 2694 cylinders
                 Cylinder size is 765 (512 byte) blocks
                                              Cylinders
        Partition   Status    Type      Start   End   Length    %
        =========   ======    ========  =====   ===   ======   ===
    THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE
    FOLLOWING:
     
         1.   Create a partition
         2.   Change Active (Boot from) partition
         3.   Delete a partition
         4.   Exit (Update disk configuration and exit)
         5.   Cancel (Exit without updating disk configuration)
    Enter Selection: 
  8. Select option 1, Create a partition, to create an fdisk partition.


                 Total disk size is 2694 cylinders
                 Cylinder size is 765 (512 byte) blocks
                                              Cylinders
        Partition   Status    Type      Start   End   Length    %
        =========   ======    ========  =====   ===   ======   ===
    THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE
    FOLLOWING:
    
         1.   Create a partition
         2.   Change Active (Boot from) partition
         3.   Delete a partition
         4.   Exit (Update disk configuration and exit)
         5.   Cancel (Exit without updating disk configuration)
    Enter Selection: 1
    
  9. Create a Solaris fdisk partition by selecting 1(=Solaris).


    Indicate the type of partition you want to create
      (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
      (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ? 1
    
  10. Identify the percentage of disk to be reserved for the Solaris fdisk partition. Keep in mind the size of any existing fdisk partitions when calculating this percentage.


    Indicate the percentage of the disk you want this partition
    to use (or enter "c" to specify in cylinders). nn
    
  11. Activate the Solaris fdisk partition by typing y at the prompt.


    Do you want this to become the Active partition? If so, it will be 
    activated each time you reset your computer or when you turn it on 
    again. Please type "y" or "n". y
    

    The Enter Selection: prompt is displayed after the fdisk partition is activated.

  12. Select option 1, Create a partition, to create another fdisk partition.

    See steps 9-11 for instructions on creating an fdisk partition.

  13. Update the disk configuration and exit the fdisk menu from the selection menu.


    Selection: 4 
    
  14. Relabel the disk using the label command.


    WARNING: Solaris fdisk partition changed - Please relabel the disk
    format> label
    Ready to label disk, continue? yes
    format> 
  15. Quit the format menu.


    format> quit
    

IA: Where to Go From Here

After you create a Solaris fdisk partition on the disk, you can create slices on the disk. Go to "IA: How to Create Disk Slices and Label a Disk".

IA: Example--Creating a Solaris fdisk Partition That Spans the Entire Drive

The following example uses the format's utility's fdisk option to create a Solaris fdisk partition that spans the entire drive.


# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 2466 alt 2 hd 16 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
       2. c1d0 <DEFAULT cyl 13102 alt 2 hd 16 sec 63>
          /pci@0,0/pci-ide@7,1/ide@1/cmdk@0,0
Specify disk (enter its number): 0
selecting c0d0
Controller working list found
[disk formatted]
format> fdisk
The recommended default partitioning for your disk is:
 
  a 100% "SOLARIS System" partition.
 
To select this, please type "y".  To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. y
 
WARNING: Solaris fdisk partition changed - Please relabel the disk
format> label
Ready to label disk, continue? yes
format> quit

IA: Example--Creating a Solaris fdisk Partition and Preserving an Existing fdisk Partition

The following example describes how to create a Solaris fdisk partition on a disk that has an existing DOS-BIG fdisk partition.


format> fdisk
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
     Partition   Status    Type     Start  End   Length    %
     =========   ======   ========  =====   ===   ====== ===
        1                 DOS-BIG       1   538     538   20
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?1
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". y
Partition 2 is now the Active partition Total disk size is 2694 
cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
        2       Active    SOLARIS     539  2693    2155     80
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: Selection: 4
WARNING: Solaris fdisk partition changed - Please relabel the disk
format> label
Ready to label disk, continue? yes
format> q

IA: Example--Creating a Solaris fdisk Partition and an Additional fdisk Partition

This following example describes how to create a Solaris fdisk partition and a DOSBIG fdisk partition.


format> fdisk
The recommended default partitioning for your disk is:
   a 100% "SOLARIS System" partition.
To select this, please type "y".  To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. n
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?8
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 20
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". n
             Total disk size is 2694 cylinders
             Cylinder size is 765 (512 byte) blocks
                                        Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)Enter
Selection: 1
Indicate the type of partition you want to create
  (1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
  (5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ?1
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
Do you want this to become the Active partition? If so, it will be 
activated each time you reset your computer or when you turn it on 
again. Please type "y" or "n". y
Partition 2 is now the Active partition Total disk size is 2694 
cylinders
            Cylinder size is 765 (512 byte) blocks
                                         Cylinders
    Partition   Status    Type      Start   End   Length    %
    =========   ======    ========  =====   ===   ======   ===
        1                 DOS-BIG       1   538     538     20
        2       Active    SOLARIS     539  2693    2155     80
 
SELECT ONE OF THE FOLLOWING:
     1.   Create a partition
     2.   Change Active (Boot from) partition
     3.   Delete a partition
     4.   Exit (Update disk configuration and exit)
     5.   Cancel (Exit without updating disk configuration)
Enter Selection: 4
format> q

IA: How to Create Disk Slices and Label a Disk

  1. Become superuser.

  2. Start the format utility.


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


    Specify disk (enter its number): disk-number
    

    disk-number

    Is the number of the disk that you want to repartition. 

  4. Go into the partition menu (which lets you set up the slices).


    format> partition
    
  5. Display the current partition (slice) table.


    partition> print
    
  6. Start the modification process.


    partition> modify
    
  7. Set the disk to all free hog.


    Choose base (enter number) [0]? 1
    

    See "Using the Free Hog Slice" for more information about the free hog slice.

  8. Create a new partition table by answering yes when prompted to continue.


    Do you wish to continue creating a new partition
    table based on above table[yes]? yes
    
  9. Identify the free hog partition (slice) and the sizes of the slices when prompted.

    When adding a system disk, you must set up slices for:

    • root (slice 0) and swap (slice 1) and/or

    • /usr (slice 6)

    After you identify the slices, the new partition table is displayed.

  10. Make the displayed partition table the current partition table by answering yes when asked.


    Okay to make this the current partition table[yes]? yes
    

    If you don't want the current partition table and you want to change it, answer no and go to Step 6.

  11. Name the partition table.


    Enter table name (remember quotes): "partition-name"
    

    partition-name

    Is the name for the new partition table. 

  12. Label the disk with the new partition table when you have finished allocating slices on the new disk.


    Ready to label disk, continue? yes
    
  13. Quit the partition menu.


    partition> quit
    
  14. Verify the new disk label with verify command.


    format> verify
    
  15. Quit the format menu.


    format> quit
    

IA: Where to Go From Here

After you create disk slices and label the disk, you can create file systems on the disk. Go to "IA: How to Create File Systems".

IA: How to Create File Systems

  1. Become superuser.

  2. Create a file system for each slice with the newfs(1M) command.


    # newfs /dev/rdsk/cwtxdysz
    

    /dev/rdsk/cwtxdysz

    Raw device for the file system to be created. 

    See Chapter 36, Mounting and Unmounting File Systems (Tasks) for more information about the newfs command.

  3. Verify the new file system by mounting it on an unused mount point.


    # mount /dev/dsk/cwtxdysz /mnt
    # ls /mnt
    lost+found

IA: Where to Go From Here

If You Are Adding A ... 

Then ... 

System Disk 

You need to restore the root (/) and /usr file systems on the disk. Go to Chapter 44, Restoring Files and File Systems (Tasks).

After the root (/) and /usr file systems are restored, install the boot block. Go to "IA: How to Install a Boot Block on a System Disk".

Secondary Disk 

You might need to restore file systems on the new disk. Go to Chapter 44, Restoring Files and File Systems (Tasks).

 

If you are not restoring file systems on the new disk, you are finished adding a secondary disk. See Chapter 36, Mounting and Unmounting File Systems (Tasks) for information on making the file systems available to users.

IA: How to Install a Boot Block on a System Disk

  1. Become superuser.

  2. Install the boot block.


    # installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`
    /lib/fs/ufs/bootblk /dev/rdsk/cwtxdys2
    

    /usr/platform/`uname -i`/lib/fs/ufs/pboot

    Is the partition boot file. 

    /usr/platform/`uname -i`/lib/fs/ufs/bootblk

    Is the boot block code. 

    /dev/rdsk/cwtxdys2

    Is the raw device name that represents the whole disk. 

  3. Verify the boot blocks are installed by rebooting the system to run level 3.


    # init 6
    

IA: Example--Installing a Boot Block on a System Disk


# installboot /usr/platform/i86pc/lib/fs/ufs/pboot
 /usr/platform/i86pc/lib/fs/ufs/bootblk /dev/rdsk/c0t6d0s2