Contained Within
Find More Documentation
Featured Support Resources
| Descargar este libro en PDF
Setting Up Disks on Your x86 System
7
- This chapter provides conceptual information and step-by-step procedures for setting up disk drives attached to your x86 system running the Solaris 2.x environment.
- If you are already familiar with disk preparation steps and dividing a disk into slices, use the following 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, how and why disk slices are set up, or how file systems are arranged for different system configurations, read Peripherals Administration before attempting any tasks.
x86 Disk Preparation Steps
- Before you can use a disk to store and retrieve data, it must be formatted. Formatting can involve four separate processes:
-
-
Low-level Formatting - Writing format information to the disk
-
Creating a fdisk partition - Choosing an area of the disk for Solaris
-
Partitioning - Dividing the Solaris disk partition 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 on an x86 system will create the fdisk partition and slices needed for system operation.
- After installation, you may need to repartition a disk. See Peripherals Administration for information on repartitioning a disk.
x86 The Formatting Utilities
- The primary method of formatting disks in the Solaris 2.x environment is 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 Peripherals Administration for reference information on the format utility.
-
Note - Solaris 2.1 for x86 users, the fdisk(1M), fmthard(1M), diskscan(1M), and addbadsec(1M) commands are still available as a command line interface for setting up disks. See Appendix B, "x86: Additional Disk Commands," for instructions on using these commands to set up a disk.
x86 About fdisk Partitions
- A disk partition is a portion of the disk reserved for use by an operating system. Different operating systems, for example, MS-DOS(R) and Solaris 2.x, can reside on the same disk in separate partitions. These partitions are sometimes referred to as fdisk partitions, because fdisk is the name of the program that is used to create them. During installation of the Solaris 2.x software on an x86 system,
- a Solaris partition is created on the primary drive and is made active. Only one fdisk partition on a disk may be active at a time. The active partition is the one whose operating system will be booted by default at system start-up.
- You determine the type and size of the fdisk partitions and which one is to be active. You may decide, for example, to make a Solaris partition the entire disk, or you may want to make it smaller to allow room for a DOS partition. You can also make a new fdisk partition on a disk without disturbing existing partitions (if there is enough room to create a new one).
-
x86 - Some Solaris systems do not support multiple operating systems on the same hard disk. Because of this restriction, some Solaris documentation and programs may refer to a slice as a partition. To avoid confusion, Solaris 2.x documentation tries to distinguish between fdisk partitions (which are supported only on Solaris for x86) and the divisions within the Solaris fdisk partition, which may be called slices or partitions.
x86 Special Areas of the Disk
- The first sector of the disk is reserved for the master boot record. The master boot record contains the fdisk partition table.
- The beginning of a Solaris partition is reserved for various boot programs and the disk label. Included in the disk label is the volume table of contents (VTOC). The VTOC describes how disk slices are arranged on the disk.
x86 Dividing a Disk into Slices
- When you set up a disk's slices using the format utility, you choose not only the size of each fdisk partition, but also which fdisk partition will be active. These choices depend on how you intend to use the system to which the disk is attached.
- x86 The fdisk Partitions on a Disk
- The disk can be divided into a maximum of four fdisk partitions. One of these partitions must be a Solaris partition, and it must be made the active partition on the disk.

- The fdisk command can be used to create a partition for DOS also, but DOS commands must be used to complete the creation of DOS partitions.
- x86 Locating fdisk Partitions on a Disk
- There are two rules to remember when deciding how to partition the disk.
-
- Solaris fdisk partitions must begin on cylinder boundaries.
- Solaris fdisk partitions must begin at cylinder 1, not cylinder 0, on the first disk because additional boot information, including the master boot record, is written in sector 0. To avoid overwriting the master boot record, begin a Solaris fdisk partition at cylinder 1.
- x86 Customary Slices
- Solaris fdisk partitions can be divided up into a maximum of ten slices. These slices are numbered 0 through 9, although 8 and 9 are not configurable by administrators. The slice number does not necessarily match the order in which the slice appears on the Solaris fdisk partition.
-
Table 7-1 on the next page summarizes the customary contents of the disk slices.
-
Table 7-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 | Holds files that are created by users. |
| 8 | -- | Contains information necessary for Solaris to boot from the hard disk. It resides at the beginning of the Solaris partition (although the slice number itself does not indicate this), and is known as the boot slice. |
| 9 | -- | Area reserved for alternate disk blocks, and is known as the alternate sector slice. |
- The Solaris installation program provides slice size recommendations based on the software you select for installation.
x86 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.
-
x86 - You must be superuser to perform the following procedures.
- x86 Adding a Secondary Disk
- To add a secondary disk, you may need to follow some or all of these procedures:
-
- Performing a reconfiguration boot
- Extracting a defect list
- Formatting a disk
- Dividing a disk into slices and labelling 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 Peripherals Administration.
- x86 Adding a System Disk
- If your system disk fails and the root file system 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-ROM or the network to single-user mode
- Creating the Solaris fdisk partition and dividing the disk into slices
- Creating the boot blocks on the Solaris fdisk partition
- Restoring the root (/) and /usr file systems
- This procedure is covered on the pages to follow.
- x86 Maintaining Disk Drives
- The format utility can be used to perform disk diagnostics on SCSI or IDE disks, if needed.
- An example of using the format utility is at the end of this chapter in the section called "How to Remap a Bad Block on an IDE Disk Drive."
- Examples of using the format utility to perform disk diagnostics on SCSI disks can be found in Peripherals Administration.
- x86 Installing Boot Blocks on a Solaris fdisk Partition
- If you want to make a disk bootable, you must install the boot blocks. Ordinarily, you do not need to install boot blocks. You may need to use this procedure if the root file system becomes damaged because you cannot restore the boot block from tape.
-
x86 How to Install a Boot Block on a Solaris fdisk Partition
-
-
Identify the disk you want to use as a bootable disk.
-
Type the following command:
-
# /usr/sbin/installboot /usr/lib/fs/ufs/pboot
/usr/lib/fs/ufs/bootblk /dev/rdsk/cn[tn]dns2
|
- The contents of the pboot file (the partition boot block) are installed in the first sector of the Solaris slice. The contents of the bootblk file (the primary boot program) are installed after the disk label in the Solaris slice.
-
x86 How to Perform a Reconfiguration Boot
-
-
Create a /reconfigure file that will be read when the system is booting.
-
- 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
|
-
x86 - 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 type any key to continue prompt is displayed after the system is shut down.
-
-
Turn off power to the system after the type any key to continue 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.
-
x86 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 restore your file systems from a backup medium. See File System Administration for information about restoring file systems to disk.
-
x86 - This procedure displays screen output as an example and will vary from system to 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 x86 Device Configuration 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.
a. Insert the Solaris boot diskette into the diskette drive. b. 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 shutdown.
The Multiple Device Boot Subsystem menu is displayed after a few minutes.
c. Select the CD-ROM drive or net(work) as the boot device from the Multiple Device Boot menu.
The Secondary Boot Subsystem Menu is displayed.
d. Type b -s at the Select the type of installation: prompt.
After a few minutes, the single-user mode # prompt is displayed.
-
Enter the format utility by typing format at the root prompt and pressing Return.
The format utility is used to create the Solaris fdisk partition and assign slices to the root and swap areas.
a. Enter the number of the disk that you want to partition from the list displayed on your screen.
-
b. Enter the fdisk menu by typing fdisk at the format> prompt and select the interactive option. The following message is displayed.
-
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
fdisk> q
|
-
c. Type y(es) to create and activate a Solaris fdisk partition spanning the entire disk.
-
d. Exit the fdisk menu by typing 4 (Update disk configuration and exit) at the Selection: prompt. Type q (quit) at the fdisk> prompt.
-
x86 - In this next section, the format utility refers to a slice as a partition. The partition menu is used to divide a disk into slices. A partition table refers to a table of slice information.
-
e. Enter the partition menu (which lets you set up the slices) 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
8 - change '8' partition
9 - change '9' 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>
|
-
f. Display the current partition (slice) table by typing print at the partition> prompt.
-
g. Modify the current table by typing modify at the partition> prompt. Type 1 at the Choose base prompt to set the Free Hog.
- The following information is displayed.
-
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0)
1 unassigned wm 0 0 (0/0/0)
2 backup wm 0 - 1463 411.75MB (1464/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 unassigned wm 0 0 (0/0/0)
7 unassigned wm 0 0 (0/0/0)
8 boot wu 0 .24MB (1/0/0)
9 alternates wm 1-2 .48MB (2/0/0)
Do you wish to continue creating a new partition table based on
above table[yes]?
|
-
h. Create a new partition table by typing yes at the above prompt.
-
i. Identify the Free Hog partition (slice) and the sizes of the root and swap slice when prompted.
-
Free Hog partition[6]?
Enter size of partition '0' [0b, 0c, 0.00mb]: 100mb
Enter size of partition '1' [0b, 0c, 0.00mb]: 100mb
Enter size of partition '3' [0b, 0c, 0.00mb]:
Enter size of partition '4' [0b, 0c, 0.00mb]:
Enter size of partition '5' [0b, 0c, 0.00mb]:
Enter size of partition '7' [0b, 0c, 0.00mb]: 200mb
Enter size of partition '9' [0b, 0c, 0.00mb]: 2c
|
-
j. Answer yes to the Okay to make this the current partition table? prompt.
-
k. Name the partition table using quotes.
-
Enter table name (remember quotes): "disk0"
|
-
l. 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
|
-
m. Exit the partition menu by typing quit at the partition> prompt.
-
n. Exit the format menu by typing quit at the format> prompt.
-
-
Create the file systems for the newly partitioned disk using the newfs command.
-
# newfs /dev/rdsk/devicename
|
-
-
Run the installboot command to install the boot blocks.
-
# /usr/sbin/installboot /usr/lib/fs/ufs/pboot
/usr/lib/fs/ufs/bootblk /dev/rdsk/cw[tx]dys2
|
- The root slice must have a boot block. See "How to Install a Boot Block on a Solaris fdisk Partition" on page 61 for more information on installboot.
- See Chapter 8, "Managing File Systems on an x86 System," for step-by-step instructions on restoring the root (/) or /usr file systems.
-
x86 How to Remap a Bad Block on an IDE Disk Drive
- IDE disk drives do not automatically map out bad blocks like other drives supported by Solaris software. Before installing Solaris on an IDE disk, you may want to perform a surface analysis on the disk.
-
-
Use the fdisk program to create a Solaris partition on the disk, if necessary. (If a Solaris fdisk partition already exists, leave it alone.)
-
After you create a Solaris fdisk partition, you can use the format program to map out bad blocks. To start the format program, type format.
-
-
Specify the IDE disk drive on which you want to perform a surface analysis.
-
x86 - IDE drives do not include a target number. The IDE drive naming convention is cndn, where cn is the controller number and dn is the device number.
-
-
At the format> prompt, type analyze.
-
At the analyze> prompt, type config. This will show you the current settings for a surface analysis. If you want to change any settings, type setup.
-
At the analyze> prompt, type read, write, or compare for the type of surface analysis to be performed. If format finds bad blocks, it will remap them.
-
At the analyze> prompt, type quit.
-
You may want to specify blocks to remap. If so, at the format> prompt, type repair.
-
Type quit to quit the format program.
|
|