Contained Within
Find More Documentation
Featured Support Resources
| Scarica il manuale in formato PDF
Overview of Disk Management
27
- This overview chapter provides conceptual information about Solaris disk slices and introduces the format utility.
- This is a list of the overview information in this chapter.
-
- For instructions on how to add a disk drive to your system, see Chapter 29, "SPARC: Adding a Disk," or Chapter 30, "x86: Adding a Disk."
Introduction
- Managing disks in the Solaris 2.x environment usually involves setting up the system and running the Solaris installation program to create the appropriate disk slices and install the operating system. Occasionally, you may need to use the format utility to add a new disk drive or replace a defective one.
Disk Terminology
- Before you can effectively use the information in this section, you should be familiar with basic disk architecture. In particular, you should be familiar with the following terms:
-
- Track
- Cylinder
- Sector
- Disk controller
- Disk label
- Device drivers
- If you are unfamiliar with these terms, refer to the glossary (for a brief definition) or product information from the disk's manufacturer.
About Disk Slices
- Files stored on a disk are contained in file systems. Each file system on a disk is assigned to a slice--a group of cylinders set aside for use by that file system. Each disk slice appears to the operating system (and to the system administrator) as though it were a separate disk drive.
- See "Managing File Systems" in System Administration Guide, Volume I for information about file systems.
-
Note - Slices are sometimes referred to as partitions. This book uses slice, but, certain interfaces, such as the format utility, refer to slices as partitions.
- When setting up slices, remember these rules:
-
- Each disk slice holds only one file system.
- No file system can span multiple slices.
- Slices are set up slightly differently on SPARC and x86 platforms. Table 27-1 summarizes the differences:
-
Table 27-1
| SPARC | x86 |
| Whole disk is devoted to Solaris environment | Disk is divided into fdisk partitions, one per operating environment |
| Disk is divided into eight slices, numbered 0-7 | The Solaris fdisk partition is divided into 10 slices, numbered 0-9 |
SPARC: Disk Slices
- On SPARC systems, Solaris defines eight disk slices and assigns to each a conventional use. These slices are numbered 0 through 7. Table 27-2 summarizes the contents of the eight Solaris slices on a SPARC system.
-
Table 27-2
| Slice | File System | Usually Found on Client or Server Systems? | Purpose |
| 0 | root | both | Holds files and directories that make up the operating system. |
| 1 | swap | both | Provides virtual memory, or swap space. Swap space is used when running programs are too large to fit in a computer's memory. The Solaris operating environment then "swaps" programs from memory to the disk and back as needed. |
| 2 | -- | both | Refers to the entire disk, by convention. It is defined automatically by Sun's format and the Solaris installation programs. The size of this slice should not be changed. |
| 3 | /export | server only | Holds alternative versions of the operating system. These alternative versions are required by client systems whose architectures differ from that of the server. Clients with the same architecture type as the server obtain executables from the /usr file system, usually slice 6. |
| 4 | /export/swap | server only | Provides virtual memory space for client systems. |
| 5 | /opt | both | Holds application software added to a system. If a slice is not allocated for this file system during installation, the /opt directory is put in slice 0. |
| 6 | /usr | both | Holds operating system commands--also known as executables-- designed to be run by users. This slice also holds documentation, system programs (init and syslogd, for example) and library routines. |
| 7 | /home or
/export/home | both | Holds files created by users. |
x86: Disk Slices
- On x86 systems, disks are divided into fdisk partitions. An fdisk partition is a section of the disk reserved for a particular operating environment, such as Solaris.
- Solaris places ten slices, numbered 0-9, on the Solaris fdisk partition on a disk in an x86 system, as shown in Table 27-3.
-
Table 27-3
| Slice | File System | Usually Found on Client or Server Systems? | Purpose |
| 0 | root | both | Holds the files and directories that make up the operating system. |
| 1 | swap | both | Provides virtual memory, or swap space. Swap space is used when running programs are too large to fit in a computer's memory. The Solaris operating environment then "swaps" programs from memory to the disk and back as needed. |
| 2 | -- | both | Refers to the entire disk, by convention. It is defined automatically by Sun's format and the Solaris installation programs. The size of this slice should not be changed. |
| 3 | /export | server only | Holds alternative versions of the operating system. These alternative versions are required by client systems whose architectures differ from that of the server. |
| 4 | /export/swap | server only | Provides virtual memory space for the client systems. |
| 5 | /opt | both | Holds application software added to a system. If a slice is not allocated for this file system during installation, the /opt directory is put in slice 0. |
| 6 | /usr | both | 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 | /home or
/export/home | both | Holds files created by users. |
| 8 | -- | both | 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 | -- | both | Provides an area reserved for alternate disk blocks. Slice 9 is known as the alternate sector slice. |
Slice Arrangements on Multiple Disks
- Although a single disk that is large enough can hold all slices and their corresponding file systems, two or more disks are often used to hold a system's slices and file systems.
-
Note - A slice cannot be split between two or more disks. However, multiple swap slices on separate disks are allowed.
- For instance, a single disk might hold the root (/) file system, a swap area, and the /usr file system, while a separate disk is provided for the /export/home file system and other file systems containing user data.
- In a multiple disk arrangement, the disk containing the operating system software and swap space (that is, the disk holding the root (/) or /usr file systems or the slice for swap space) is called the system disk. Disks other than the system disk are called secondary disks or non-system disks.
- Locating a system's file systems on multiple disks allows you to modify file systems and slices on the secondary disks without having to shut down the system or reload operating system software.
- Having more than one disk also increases input-output (I/O) volume. By distributing disk load across multiple disks, you can avoid I/O bottlenecks.
Determining Which Slices to Use
- When you set up a disk's file systems, you choose not only the size of each slice, but also which slices to use. Your decisions about these matters depend on the configuration of the system to which the disk is attached and the software you want to install on the disk.
- There are five system configurations:
-
- Servers
- Diskless clients
- Standalone systems
- Dataless clients
- AutoClient systems
- Each system configuration requires the use of different slices. Table 27-4 lists these requirements.
-
Table 27-4
| Slice | Servers | Diskless Clients | Standalone Systems | Dataless Clients | AutoClient Systems |
| 0 | root | (on server) | root | root | root |
| 1 | swap | (on server) | swap | swap | swap |
| 2 | -- | -- | -- | -- | -- |
| 3 | /export | -- | -- | -- | -- |
| 4 | /export/swap | -- | -- | -- | -- |
| 5 | /opt | (on server) | /opt | /opt | (on server) |
| 6 | /usr | (on server) | /usr | (on server) | (on server) |
| 7 | /export/home | (on server) | /home | (on server) | (on server) |
- See Chapter 4, "Adding and Maintaining Server and Client Support," for more information about system configurations.
-
Note - The Solaris installation program provides slice size recommendations based on the software you select for installation.
The format Utility
- Read the following information if you want to see a conceptual view of the format utility and what it is used for before proceeding to the "how-to" or reference sections.
Definition
- The format utility is a system administration tool used to prepare hard disk drives for use on your Solaris system. The format utility cannot be used on diskette drives, CD-ROM drives, or tape drives.
Features and Benefits
-
Table 27-5 shows the features and associated benefits that the format utility provides.
-
Table 27-5 format
| Feature | Benefit |
Searches your system for all
attached disk drives | Reports
· Target location
· Disk geometry
· Whether the disk is formatted
· If the disk has mounted partitions |
| Retrieves disk labels | Used in repair operations |
| Repairs defective sectors | Allows administrators to repair disk drives with recoverable errors instead of sending the drive back to the manufacturer |
| Formats and analyzes a disk | Creates sectors on the disk and verifies each sector |
| Partitions a disk | Divides a disk so individual file systems can be created on separate slices |
| Labels a disk | Writes disk name and configuration information to the disk for future retrieval (usually for repair operations) |
- All of the options of the format utility are fully described in Chapter 31, "The format Utility."
When to Use the format Utility
- Disk drives are partitioned and labeled by the Solaris installation program as part of installing the Solaris release. You may need to use the format utility when:
-
- Displaying slice information
- Dividing a disk into slices
- Adding a disk drive to an existing system
- Formatting a disk drive
- Repairing a disk drive
- The main reason a system administrator uses the format utility is to divide a disk into disk slices. These steps are covered in Chapter 29, "SPARC: Adding a Disk" and Chapter 30, "x86: Adding a Disk."
- See Table 27-6 for guidelines on using the format utility.
Guidelines for Using the format Utility
-
Table 27-6 format
| Use the format Utility To ... | Considerations ... | Where to Go ... |
| Format a disk | · Any existing data will be destroyed when a disk is reformatted.
· The need for formatting a disk drive has dropped as more and more manufacturers ship their disk drives formatted and partitioned. You may not need to use the format utility when adding a disk drive to an existing system. · If a disk has been relocated and is displaying a lot of disk errors, you can attempt to reformat it, which will automatically remap any bad sectors.
| "How to Format a Disk" on page 435 |
| Replace a system disk | · Data from the damaged system disk must be restored from a backup medium; otherwise the system will have to be reinstalled by using the installation program. | Chapter 29, "SPARC: Adding a Disk" or Chapter 30, "x86: Adding a Disk" or if the system must be reinstalled, SPARC: Installing Solaris Software or x86: Installing Solaris Software |
| Divide a disk into slices | · Any existing data will be destroyed when a disk with existing slices is repartitioned and relabeled. · Existing data must be copied to backup media before the disk is repartitioned and restored after the disk is relabeled. | Chapter 29, "SPARC: Adding a Disk" or Chapter 30, "x86: Adding a Disk" |
| Add a secondary disk to an existing system | · Any existing data must be restored from backup media if the secondary disk is reformatted or repartitioned. | Chapter 29, "SPARC: Adding a Disk" or Chapter 30, "x86: Adding a Disk" |
| Repair a disk drive | · Some customer sites prefer to replace rather than repair defective drives. If your site has a repair contract with the disk drive manufacturer, you may not need to use the format utility to repair disk drives. · Repairing a disk drive usually means that a bad sector is added to a defect list. New controllers remap bad sectors automatically with no system interruption. · If the system has an older controller, you may need to remap a bad sector and restore any lost data. | Chapter 31, "The format Utility" |
Formatting a Disk
- In most cases, disks are formatted by the manufacturer or reseller and do not need to be reformatted when you install the drive. To determine whether or not a disk is formatted, use the format utility. See "How to Determine If a Disk Is Formatted" on page 434 for more information.
- If you determine that a disk is not formatted, use the format utility to format the disk.
- Formatting a disk accomplishes two steps:
-
- Preparing disk media for use
- Compiling a list of disk defects based on a surface analysis
-
Caution - Formatting is a destructive process--it overwrites data on the disk. For this reason, disks are usually formatted only by the manufacturer or reseller. If you think disk defects are causing recurring problems, you can use the format utility to do a surface analysis, but be careful to use only the commands that do not destroy data. See "How to Format a Disk" on page 435 for details.
- A small percentage of total disk space available for data is used to store defect and formatting information. This percentage varies according to disk geometry, and decreases as the disk ages and develops more defects.
- Formatting may take anywhere from a few minutes to several hours, depending on the type and size of the disk.
About Disk Labels
- A special area of every disk is set aside for storing information about the disk's controller, geometry, and slices. That information is called the disk's label. Another term used to described the disk label is the VTOC (Volume Table of Contents). To label a disk means to write slice information onto the disk. You usually label a disk after changing its slices.
- If you fail to label a disk after creating slices, the slices will be unavailable because the operating system has no way of "knowing" about the slices.
Partition Table
- An important part of the disk label is the partition table which identifies a disk's slices, the slice boundaries (in cylinders), and total size of the slices. A disk's partition table can be displayed using the format utility. Table 27-7 describes partition table terminology.
-
Table 27-7
| Partition Term | Value | Description |
| Number | 0-7 | Partition or (slice number). Valid numbers are 0-7. |
- Tag......0=UNASSIGNED
- A numeric value that usually describes the file system mounted on this partition.
-
-
1=BOOT
2=ROOT
3=SWAP
4=USR
5=BACKUP
7=VAR
8=HOME
- Flags.....wm
- The partition is writable and mountable.
-
| wu | The partition is writable and unmountable. This is the default state of partitions dedicated for swap areas. However, the mount command does not check the "not mountable" flag. |
| rm | The partition is read only and mountable. |
- Partition flags and tag are assigned by convention and require no maintenance.
- See "How to Display Disk Slice Information" on page 438 or "How to Examine a Disk Label" on page 444 for more information on displaying the partition table.
Examples--Partition Tables
- The following partition table example is displayed from a 535-Mbyte disk using the format utility:

- The partition table contains the following information:
-
| Column Name | Description |
| Part | Partition (or slice number). See Table 27-7 for a description of this column. |
| Tag | Partition tag. See Table 27-7 for a description of this column. |
| Flags | Partition flag. See Table 27-7 for a description of this column. |
| Cylinders | The starting and ending cylinder number for the slice. |
| Size | The slice size in Mbytes. |
| Blocks | The total number of cylinders and the total number of sectors per slice in the far right column. |
- The following example displays a disk label using the prtvtoc command.
-
# prtvtoc /dev/rdsk/c0t3d0s0
* /dev/rdsk/c0t3d0s0 partition map
*
* Dimensions:(1)
* 512 bytes/sector
* 80 sectors/track
* 9 tracks/cylinder
* 720 sectors/cylinder
* 2500 cylinders
* 1151 accessible cylinders
*
* Flags:(2)
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory (3)
0 2 00 0 66240 66239 /
1 3 01 66240 131760 197999
2 5 00 0 828720 828719
3 0 00 198000 66240 264239 /export
4 0 00 264240 66240 330479 /export/swap
5 0 00 330480 72000 402479 /opt
6 4 00 402480 385200 787679 /usr
7 8 00 787680 41040 828719 /export/home
#
|
- The disk label includes the following information:
(1) Dimensions - This section describes the physical dimensions of the disk drive.
(2) Flags - This section describes the flags listed in the partition table section. See Table 27-7 for a description of partition flags.
(3) Partition (or Slice) Table - This section contains the following information:
-
| Column Name | Description |
| Partition | Partition (or slice number). See Table 27-7 for a description of this column. |
| Tag | Partition tag. See Table 27-7 for a description of this column. |
| Flags | Partition flag. See Table 27-7 for a description of this column. |
| First Sector | The first sector of the slice. |
| Sector Count | The total number of sectors in the slice. |
| Last Sector | The last sector number in the slice. |
| Mount Directory | The last mount point directory for the file system. |
Dividing a Disk Into Slices
- The format utility is most often used by system administrators to divide a disk into slices. The steps are:
-
- Determining which slices are needed
- Determining the size of each slice
- Using the format utility to divide the disk into slices
- Labeling the disk with new slice information
- Creating the file system for each slice
- The easiest way to divide a disk into slices is to use the modify command from the partition menu. The modify command allows you to create slices by specifying the size of each slice in megabytes without having to keep track of starting cylinder boundaries. It also keeps tracks of any disk space remainder in the "free hog" slice.
Using the Free Hog Slice
- When you use the format utility to change the size of one or more disk slices, you designate a temporary slice that will expand and shrink to accommodate the resizing operations.
- This temporary slice donates, or "frees," space when you expand a slice, and receives, or "hogs," the discarded space when you shrink a slice. For this reason, the donor slice is sometimes called the free hog.
- The donor slice exists only during installation or when you run the format utility. There is no permanent donor slice during day-to-day, normal operations.
- See "SPARC: How to Create Disk Slices and Label a Disk" on page 467 or "x86: How to Create Disk Slices and Label a Disk" on page 487 for information on using the free hog slice.
|
|