System Administration Guide, Volume I
  Sök endast i den här boken
Ladda ner denna bok i PDF

SPARC: Adding a Disk

29

This chapter provides the procedures for adding a disk to a SPARC system.
This is a list of the step-by-step instructions in this chapter.
SPARC: How to Connect a System Disk and Bootpage 464
SPARC: How to Connect a Secondary Disk and Bootpage 465
SPARC: How to Create Disk Slices and Label a Diskpage 467
SPARC: How to Create File Systemspage 474
SPARC: How to Restore File Systemspage 475
SPARC: How to Install a Boot Block on a System Diskpage 476
For overview information about disk management, see Chapter 27, "Overview of Disk Management."

SPARC: 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 system becomes damaged, you have two ways to recover:
  • You can reinstall the entire Solaris environment
  • Or, you can replace the system disk and restore your file systems from a backup medium.
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.

SPARC: Adding a System or Secondary Disk

Table 29-1 SPARC: Adding a System or Secondary Disk
Activity........Description
For Instructions, Go To
Connect the Disk
System Disk
· SPARC: How to

page 464

and Boot
Connect the new disk and boot from a local or remote
Connect a System
Solaris 2.x CD.
Disk and Boot
· SPARC: How to

page 465

Secondary Disk...................Connect a
Connect the new disk and perform a reconfiguration boot,
Secondary Disk and
so the system will recognize the disk.
Boot
Create Slices and
Create disk slices and label the disk if it has not already
· SPARC: How to..page 467
Label the Disk
been done by the disk manufacturer.
Create Disk Slices and Label a Disk
Create File
Create UFS file systems on the disk slices with the newfs
· SPARC: How to..page 474
Systems
command. You must create the root (/) or /usr file
Create File Systems
system (or both) for a system disk.
Restore File
Restore the root (/) or /usr file system (or both) on the
· SPARC: How to

page 475

Systems
system disk. If necessary, restore file systems on the
Restore File
secondary disk.
Systems
Install Boot Block
System Disk Only
· SPARC: How to

page 476

Install the boot block on the root (/) file system, so the
Install a Boot Block
system can boot.
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 2.x CD.

If You Are Booting From ...Then ...
A Solaris 2.x CD from a local CD-ROM drive1. 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 2.x CD from a CD-ROM drive over the networkBoot 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" on page 467.

· SPARC: How to Connect a Secondary Disk and Boot

  1. Become root.

  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" on page 451 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.
  1. Shut down the system.


  # shutdown -i0 -g30 -y  

In this command,
-i0Brings the system down to init state 0 (zero), the power-down state.
-g30Notifies logged-in users that they have n seconds before the system begins to shut down.
-ySpecifies the command should run without user intervention.
The ok or > prompt is displayed after the operating environment is shut down.
  1. Turn off power to the system and all external peripheral devices.

  1. 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.

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

    Refer to the disk's hardware installation guide for installation details.

  3. Turn on the power to all external peripherals.

  4. 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" on page 467.

· SPARC: How to Create Disk Slices and Label a Disk

  1. Become root.

  2. Start the format utility.


  # format  

A list of available disks is displayed.
  1. 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  

At this prompt,
disk-number...Is the number of the disk that you want to repartition.
  1. Go into the partition menu (which lets you set up the slices).


  format> partition  

  1. Display the current partition (slice) table.


  partition> print  

  1. Start the modification process.


  partition> modify  

  1. Set the disk to all free hog.


  Choose base (enter number) [0]? 1  

See "Using the Free Hog Slice" on page 428 for more information about the free hog slice.
  1. 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  

  1. 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), swap (slice 1) and/or
  • /usr (slice 6)
After you identify the slices, the new partition table is displayed.
  1. 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.
  1. Name the partition table.


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

At this prompt,
partition-name..Is the name for the new partition table.
  1. Label the disk with the new partition table when you have finished allocating slices on the new disk.


  Ready to label disk, continue? yes  

  1. Quit the partition menu.


  partition> quit  

  1. Quit the format menu.


  format> quit  

Example--Creating Disk Slices and Labeling a System Disk

The following example uses the format utility to divide a 200-Mbyte disk into two slices: one for the root (/) file system and one for the swap area.

  # format  
  Searching for disks...done  
  AVAILABLE DISK SELECTIONS:  
         0. c0t2d0 <SUN0207 cyl 1254 alt 2 hd 9 sec 36>  
            /sbus@1,f8000000/esp@0,800000/sd@2,0  
         1. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>  
            /sbus@1,f8000000/esp@0,800000/sd@3,0  
  Specify disk (enter its number): 0  
  selecting c0t2d0  
  [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)  
    1       swap    wu       0               0         (0/0/0)  
    2     backup    wu       0 - 1253      198.39MB    (1254/0/0)  
    3 unassigned    wm       0               0         (0/0/0)  
    4 unassigned    wm       0               0         (0/0/0)  
    5 unassigned    wm       0               0         (0/0/0)  
    6        usr    wm       0               0         (0/0/0)  
    7 unassigned    wm       0               0         (0/0/0)  

Example--Creating Disk Slices and Labeling a System Disk (Continued)


  Do you wish to continue creating a new partition  
  table based on above table[yes]? yes  
  Free Hog partition[6]? 5  
  Enter size of partition '0' [0b, 0c, 0.00mb]: 100mb  
  Enter size of partition '1' [0b, 0c, 0.00mb]: 98mb  
  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 -  632      100.14MB    (633/0/0)  
    1       swap    wu     633 - 1233       95.08MB    (601/0/0)  
    2     backup    wu       0 - 1253      198.39MB    (1254/0/0)  
    3 unassigned    wm       0               0         (0/0/0)  
    4 unassigned    wm       0               0         (0/0/0)  
    5 unassigned    wm    1234 - 1253        3.16MB    (20/0/0)  
    6        usr    wm       0               0         (0/0/0)  
    7 unassigned    wm       0               0         (0/0/0)  
  
  Okay to make this the current partition table[yes]? yes  
  Enter table name (remember quotes): "disk2"  
  Ready to label disk, continue? yes  
  
  partition> quit  
  format> quit  

Example--Creating Disk Slices and Labeling a Secondary Disk

The following example uses the format utility to divide a 200-Mbyte disk into one slice for the /export/home1 file system.

  # format  
  Searching for disks...done  
  AVAILABLE DISK SELECTIONS:  
         0. c0t2d0 <SUN0207 cyl 1254 alt 2 hd 9 sec 36>  
            /sbus@1,f8000000/esp@0,800000/sd@2,0  
         1. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>  
            /sbus@1,f8000000/esp@0,800000/sd@3,0  
  Specify disk (enter its number): 0  
  selecting c0t2d0  
  [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)  
    1       swap    wu       0               0         (0/0/0)  
    2     backup    wu       0 - 1253      198.39MB    (1254/0/0)  
    3 unassigned    wm       0               0         (0/0/0)  
    4 unassigned    wm       0               0         (0/0/0)  
    5 unassigned    wm       0               0         (0/0/0)  
    6        usr    wm       0               0         (0/0/0)  
    7 unassigned    wm       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]? 5  
  Enter size of partition '0' [0b, 0c, 0.00mb]:  
  Enter size of partition '1' [0b, 0c, 0.00mb]:  
  Enter size of partition '3' [0b, 0c, 0.00mb]:  
  Enter size of partition '4' [0b, 0c, 0.00mb]: 198mb  
  Enter size of partition '6' [0b, 0c, 0.00mb]:  
  Enter size of partition '7' [0b, 0c, 0.00mb]:  

Example--Creating Disk Slices and Labeling a Secondary Disk (Continued)


  Part      Tag    Flag     Cylinders        Size       Blocks  
    0       root    wm       0               0         (0/0/0)  
    1       swap    wu       0               0         (0/0/0)  
    2     backup    wu       0 - 1253      198.39MB    (1254/0/0)  
    3 unassigned    wm       0               0         (0/0/0)  
    4 unassigned    wm       0 - 1251      198.07MB    (1252/0/0)  
    5 unassigned    wm    1252 - 1253        0.32MB    (2/0/0)  
    6        usr    wm       0               0         (0/0/0)  
    7 unassigned    wm       0               0         (0/0/0)  
  
  Okay to make this the current partition table[yes]? yes  
  Enter table name (remember quotes): "home1"  
  
  Ready to label disk, continue? yes  
  
  partition> quit  
  format> quit  
  #  

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" on page 474.

· SPARC: How to Create File Systems

  1. Become root.

  2. Create a file system for each slice with the newfs command.


  # newfs /dev/rdsk/cntndnsn  

In this command,
/dev/rdsk/cntndnsn Is the raw device for the file system to be created.
See Chapter 33, "Creating File Systems," for more information about the newfs command.

Where to Go From Here

If You Are Adding A ...Then ...
System DiskYou need to restore the root (/) and /usr file systems on the disk. Go to Chapter 43, "Restoring Files and File Systems."
Secondary DiskYou may need to restore file systems on the new disk. Go to Chapter 43, "Restoring Files and File Systems."

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

· SPARC: How to Restore File Systems

To restore the root (/) and /usr file systems on a system disk or to restore other file systems on a secondary disk, see Chapter 43, "Restoring Files and File Systems."

Where to Go From Here

If you are adding a system disk, you must install a boot block on the disk. Go to "SPARC: How to Install a Boot Block on a System Disk" on page 476.

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

  1. Become root.

  2. Install a boot block on a system disk using the installboot command.


  # /usr/sbin/installboot /usr/platform/'uname -i'/lib/fs/ufs/bootblk  
  /dev/rdsk/cntndns0  

In this command,
/usr/platform/                  Is the boot block code.
'uname -i'/lib/fs/ufs/
bootblk

/dev/rdsk/cntndns0              Is the raw device of the root (/) file system.

  1. Reboot the system to multi-user mode.


  # 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  

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

If the system boots to multi-user mode, the boot block has been installed correctly.