System Administration Guide, Volume 1

SPARC: Adding a System or Secondary Disk Task Map

Table 30-1 SPARC: 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.  

"SPARC: 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.  

"SPARC: 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.  

"SPARC: 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.

"SPARC: 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.

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

SPARC: How to Connect a System Disk and Boot

This procedure assumes that the system is shut 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.

  4. Follow the instructions in the table below depending on whether you are booting from a local or remote Solaris CD.

    If You Are Booting From ... 

    Then ... 

    A Solaris CD from a local CD-ROM drive 

    1. Make sure the CD is in the CD-ROM drive. 

    2. Boot from the CD to single-user mode: 

    ok boot cdrom -s

    A Solaris CD from a CD-ROM drive over the network 

    Boot from the net to single-user mode:  

    ok boot net -s

     

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

Where to Go From Here

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

SPARC: How to Connect a Secondary Disk and Boot

  1. Become superuser.

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

    If necessary, see "How to Create a format.dat Entry" for information on creating a format.dat entry for the disk.

  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 ok or > prompt is displayed after the operating environment is shut down.

  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.

  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.

Where to Go From Here

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

SPARC: How to Create Disk Slices and Label a Disk

  1. Become superuser.

  2. Start the format(1M) utility.


    # format
    

    A list of available disks is displayed.

  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 y when prompted to continue.


    Do you wish to continue creating a new partition table based on 
    above table[yes]? y
    
  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 y when asked.


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

    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> q
    
  14. Verify the disk label using the verify command.


    format> verify
    
  15. Quit the format menu.


    format> q
    

SPARC: Example--Creating Disk Slices and Labeling a System Disk

The following example uses the format utility to divide a 1-Gbyte disk into three slices: one for the root (/) file system, one for the swap area, and one for the /usr file system.


# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
   0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
   1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 0
selecting c0t1d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
	0. Current partition table (original)
	1. All Free Hog
Choose base (enter number) [0]? 1
 
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0               0         (0/0/0)          0
  1       swap    wu       0               0         (0/0/0)          0
  2     backup    wu       0 - 2035     1002.09MB    (2036/0/0) 2052288
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6        usr    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 6
Enter size of partition `0' [0b, 0c, 0.00mb]: 200mb
Enter size of partition `1' [0b, 0c, 0.00mb]: 200mb
Enter size of partition `3' [0b, 0c, 0.00mb]:
Enter size of partition `4' [0b, 0c, 0.00mb]:
Enter size of partition `6' [0b, 0c, 0.00mb]:
Enter size of partition `7' [0b, 0c, 0.00mb]:
 
 Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -  406      200.32MB    (407/0/0)   410256
  1       swap    wu     407 -  813      200.32MB    (407/0/0)   410256
  2     backup    wu       0 - 2035     1002.09MB    (2036/0/0) 2052288
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6        usr    wm     814 - 2035      601.45MB    (1222/0/0) 1231776
  7 unassigned    wm       0               0         (0/0/0)          0
 
Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "disk0"
Ready to label disk, continue? yes
partition> quit
format> verify
format> quit

SPARC: Example--Creating Disk Slices and Labeling a Secondary Disk

The following example uses the format utility to divide a 1-Gbyte disk into one slice for the /export/home file system.


# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
   0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
   1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 0
selecting c0t1d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
	0. Current partition table (original)
	1. All Free Hog
Choose base (enter number) [0]? 1
 
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0               0         (0/0/0)          0
  1       swap    wu       0               0         (0/0/0)          0
  2     backup    wu       0 - 2035     1002.09MB    (2036/0/0) 2052288
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6        usr    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
Do you wish to continue creating a new partition
table based on above table[yes]? y
Free Hog partition[6]? 7
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
 Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0               0         (0/0/0)          0
  1       swap    wu       0               0         (0/0/0)          0
  2     backup    wu       0 - 2035     1002.09MB    (2036/0/0) 2052288
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6        usr    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0 - 2035     1002.09MB    (2036/0/0) 2052288 
Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "home"
Ready to label disk, continue? y
partition> q
format> verify
format> q
# 

Where to Go From Here

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

SPARC: 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/cwtxdysx

    Raw device for the file system to be created. 

    See Chapter 35, Creating 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
    lost+found

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 "SPARC: 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.

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

  1. Become superuser.

  2. Install a boot block on a system disk using the installboot(1M) command.


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

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

    Boot block code. 

    /dev/rdsk/cwtxdys0

    Raw device of the root (/) file system.

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


    # init 6
    

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

The following example installs the boot block on a SPARCstation 10.


# installboot /usr/platform/sun4m/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0