Contained Within
Find More Documentation
Featured Support Resources
| Download this book in PDF
Setting Up Disks on Your SPARC System
3
- This chapter describes the disk slices found on a SPARC system running the Solaris 2.x environment, and the steps for setting up a system disk connected to a Solaris 2.x system.
- If you are already familiar with the formatting utility and disk slice assignments, use this table to proceed directly to the task-oriented sections. Otherwise, continue to the next page.
-
-
If you are not familiar with hard disk concepts or terminology, or how and why disks are divided into slices, read Peripherals Administration before attempting any tasks.
SPARC Disk Preparation Steps
- Before you can use a disk to store and retrieve data it must be formatted. Formatting can involve three separate processes:
-
-
Low-level Formatting - Writing format information to the disk
-
Partitioning - Dividing the disk into manageable areas
-
Surface analysis - Compiling an up-to-date list of disk defects
- Disks purchased from Sun are already formatted and provide a manufacturer's defect list that is loaded automatically. Using the suninstall utility to install Solaris 2.x will create the slices needed for system operation.
- After installation, you may need to repartition a disk. See the Peripherals Administration guide for information on repartitioning a disk.
SPARC The format Utility
- The Solaris operating system tool for maintaining disks is called the format utility. This name is something of a misnomer, however, because format enables you to analyze, partition, and label disks, as well as format them. Its repair option can even help you recover from file system difficulties brought on by a defective disk.
- See the Peripherals Administration guide for reference information on the format utility.
SPARC Special Areas of the Disk
- The beginning of the disk is reserved for an important use, storing the disk label or Volume Table of Contents (VTOC) that describes the entire disk.
- The last two cylinders are set aside for diagnostic use, as well as for storing the disk defect list and a backup copy of the label.
SPARC Dividing a Disk into Slices
- When you set up a disk's slices, you choose not only the size of each slice, but also which slice to use for a particular purpose. Your decisions about these matters depend on how you intend to use the system to which the disk is attached.
SPARC Customary Slices
- Disks are divided into eight disk slices, each assigned a conventional use. These slices are numbered 0 through 7. Table 3-1 summarizes the contents of each disk slice.
-
Table 3-1
| Slice | File System | Purpose |
| 0 | root | Holds the files and directories that make up the operating system. |
| 1 | swap | Provides 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 installation programs and should not be altered. |
| 3 | /export | Holds alternative versions of the operating system. These alternative versions are required by client machines whose architectures differ from that of the server. |
| 4 | /export/swap | Provides virtual memory space for the client rather than for the server. |
| 5 | /opt | Holds 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 /opt directory is put in slice 0. |
| 6 | /usr | Holds operating system commands--also known as executables-- that are run by users. This slice also holds documentation, system programs (init and syslogd, for example) and library routines. |
| 7 | /export/home
or /home | Holds files that are created by users. |
- The Solaris installation program provides slice size recommendations based on the software you select for installation.
SPARC Instructions for Setting Up Disks
- This section includes instructions for performing tasks related to disks.
- You will find an example of the screen input and output associated with the task with each set of instructions. Your screen output will vary based on your system configuration.
-
SPARC - You must be superuser to perform the following procedures.
- SPARC Adding a Secondary Disk
- Adding a secondary disk entails some or all of these procedures:
-
- Performing a reconfiguration boot
- Extracting a defect list
- Formatting a disk
- Dividing a disk into slices and labeling the disk
- Performing a reconfiguration boot is covered on the following pages. This step is necessary when adding new hardware to the system so the appropriate device files are linked in the /dev directory.
- The other procedures listed above are covered in the Peripherals Administration manual.
- SPARC Adding a System Disk
- If your system disk is damaged and you do not want to reinstall the Solaris 2.x environment, you can restore your system disk using the following steps:
-
- Physically connecting the new disk drive
- Booting the Solaris 2.x installation media from CD or the network to single-user mode
- Repartitioning the disk to create partitions for root and swap and restoring the root and /usr file systems
-
SPARC How to Perform a Reconfiguration Boot
-
-
Load the new device driver, if necessary, following the instructions included with the hardware.
-
Create the /reconfigure file that will be read when the system is booted.
-
- 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.
-
-
Shut down the system.
-
# /usr/sbin/shutdown -y -g30 -i0
|
-
SPARC - 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 after the operating environment is shut down.
-
-
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.
-
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.
-
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.
-
Turn on the power to all external peripherals.
-
Turn on the power to the system. The system will boot and you will be shown the login prompt.
-
SPARC How to Add a System Disk
- The following procedure assumes your system disk has become disabled and you need to replace it with a new one. The best way to solve this problem without reinstalling the Solaris environment is to replace the disk and restore your file systems from a backup medium. See File System Administration for information about restoring file systems to disk.
-
SPARC - This procedure displays screen output as an example and will vary from system to system.
- The disk used as an example in this procedure is 200 Mbytes in size and is repartitioned into three slices:
-
- 50-Mbyte root file system
- 50-Mbyte swap area
- 100-Mbyte /var file system
-
-
Connect the disk to the system and check the physical connections.
Make sure that any cables connecting the disk unit to the system are securely attached. See SPARC Hardware Platform Guide about hardware configuration requirements that should be checked before installation.
-
Boot the Solaris 2.4 media from the CD-ROM drive or the network to single-user mode using one of the following commands:
-
-
boot cdrom -s
boot net -s
-
-
Enter the format utility to repartition the disk, if necessary, by typing format at the root prompt and pressing Return.
See Peripherals Administration for information on using the format utility to repartition a disk.
a. Enter the number of the disk that you want to repartition from the list displayed on your screen.
b. Enter the partition menu (which lets you set up the slices) by typing
partition at the format> prompt.
c. Display the current partition (slice) table by typing print at the partition> prompt.
-
d. Modify the current table by typing modify at the partition> prompt. Type 1 at the Choose base prompt to set the disk to all Free Hog.

-
e. Create a new partition table by typing yes at the above prompt.
-
f. Identify the Free Hog partition (slice) and the sizes of the root and swap slice when prompted.
-
Free Hog partition[6]? 5
Enter size of partition '0' [0b, 0c, 0.00mb]: 50mb
Enter size of partition '1' [0b, 0c, 0.00mb]: 50mb
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]:
|
- The new partition table is displayed.

-
g. Answer yes to the Okay to make this the current partition table? prompt.
-
h. Name the partition table using quotes.
-
Enter table name (remember quotes): "disk0"
|
-
i. Label the disk with the new partition table when you have finished allocating slices on the new disk.
-
partition> label
Ready to label disk, continue? yes
|
-
j. Quit the partition menu. k. Quit the format menu.
-
-
Create the file systems for the newly partitioned disk using the newfs command.
-
# newfs /dev/rdsk/devicename
|
-
-
Run the installboot command to install a boot block for the root file system.
-
# installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/devicename
|
- The root slice must have a boot block. See "Installing a Boot Block on a ufs File System" on page 26 for more information on installboot.
- See Chapter 4, "Managing File Systems on a SPARC System," for step-by-step instructions on restoring the root or /usr file systems.
|
|