Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX

Certification Objective 5.02—Partitioning a Disk

Exam Objective 2.4: Given a scenario, partition a disk correctly using the appropriate files, commands, and options, and manage disk labels using SMI and EFI labels as they relate to disk sets.

A disk can, and often does, hold a number of file systems. Each file system occupies its own space on the disk, called a slice or a partition. In this section, we will explore what partitions are, how the partition information is stored on the disk, and how a disk is actually partitioned.

Understanding Partitions

As you already know from the previous chapter, a file lives inside a file system. Each file system, in turn, resides in a specific part of the disk called a slice, or a partition. In other words, a slice (or a partition) is a group of cylinders of the disk set aside for use by a specific file system.

You might be wondering, is it a slice or a partition? As you noticed in the previous section, the logical device name still uses "s" in it to refer to a slice on the disk. Slices were called partitions in Solaris 4.x, and as you see in the exam objectives for Solaris 10, they are called partitions as well. In this book, we will be using these two terms interchangeably. Having said that, no confusion is permitted on this issue.

The location of a disk slice is defined by two elements: an offset that specifies the distance from cylinder 0 to mark the beginning of the slice, and a size in cylinders to mark the end of the slice. Usually, the administrator provides the first cylinder and the last cylinder while using a utility to partition a disk. In order to manage slices effectively, remember the following rules about them:

Table 5-2 presents a comparison between disk slices on SPARC and x86 systems. On an x86 system, a disk can be divided into 10 fdisk partitions numbered 0 to 9, an fdisk partition being a slice of the disk reserved for a specific OS. Table 5-3 describes the slices that may be found on a Solaris system.

Table 5-2: Differences between the disk slices on SPARC and x86 systems

Feature

SPARC

x86

Multiple booting

Entire disk is dedicated to Solaris OS.

You can divide the disk into fdisk partitions, one partition per OS.

Volume Table of Contents (VTOC) disk

Disk is divided into 8 slices numbered 0 to 7.

Disk is divided into 10 slices numbered 0 to 9.

Extensible Firmware Interface (EFI) disk.

Disk is divided into 7 slices numbered 0 to 6.

Disk is divided into 7 slices numbered 0 to 6.

Table 5-3: File systems on disk slices

Slice

File System

Content

0

/ (root)

Files and directories that make up the OS.

1

swap

Provides space on the disk to be used as virtual memory.

2

In a disk with a VTOC label, this is reserved for referring to the entire disk, and its size should no be changed. In a disk with an EFI label, you can use it as you wish.

3

For example: /export

Optional slice; you can use it based on your site's need.

4

Optional slice; you can use it based on your site's need.

5

For example: /opt

Optional slice; you can use it based on your site's need.

6

/usr

System-related commands, programs, and library routines.

7

Standalone system: /home

Server: /export /home

Files created by individual users.

8

VTOC: NA

On EFI: reserved slice created by default; do not modify it or delete it. It is similar to slice 9 on VTOC.

9

For x86 only

VTOC: Known as alternate sector slice; reserved for alternate disk blocks. EFI: NA.

Once you partition a disk, you need to make this information available to the operating system, and you do that by labeling the disk, which we explore next.

Exam Watch

In a VTOC disk, slice 2 is reserved for referring to the entire disk, while in an EFI disk, you can use it to meet your needs. Furthermore, you cannot boot a system using a disk with an EFI label.

Labeling the Disk

A disk label is the information about the disk's controller, geometry, and slices. A special area is set aside on each disk to store this information. The process of storing the slice information into this area is called disk labeling. You store this information after you create slices, and if you fail to do so, the OS will have no way to find out about the slices. An important component of a disk label is called a partition table, which identifies each slice, its boundaries by cylinders, and its size.

In order to provide support for multiterabyte disks, Solaris offers the Extensible Firmware Interface (EFI) disk label for both 64-bit and 32-bit Solaris kernels. The EFI label differs from the VTOC label in the following ways:

Let's explore how the disks are actually partitioned.

Performing Disk Partition

When you install the Solaris system, disk drives are partitioned and labeled by the Solaris installation utility. After the system has been installed, you can use the format utility to perform low-level formatting, partitioning, and labeling on additional disks, along with many other tasks. You will mostly be using the format utility just to partition a disk, because the low-level formatting on the disk usually has already been performed. To partition a disk, you will perform the following steps:

The easiest way to partition a disk is to select the partition option provided by the format command, and then select the modify option from the partition menu. The modify command helps you in two ways:

The free hog slice is a temporary slice that automatically expands and shrinks to accommodate the unused disk space during slice-resizing operations. The format utility is used by issuing the format command, which has the following syntax:

format [<options>] <deviceNames>

The <deviceNames> is a list of raw disk logical device names such as /dev/rdsk/c<k>t<l>d<m>s<n>. Following are some typical options for the format command:

When you issue the format command, it displays a long menu that includes the tasks listed in Table 5-4.

Table 5-4: Main tasks that you can perform by using the format utility

Task

Description

analyze

Perform surface analysis on the disk.

current

Display the information about the current disk: device name, path name to the disk device, and disk geometry.

defect

Display defect list. Supported only for SCSI devices.

disk

Select a disk to format.

fdisk

Run the fdisk utility to create an fdisk partition on an x86 system.

format

Do the low-level formatting on SCSI disks. IDE disks are preformatted by their manufacturers.

inquiry

Display the product name, vendor name, and revision level of the current disk.

label

Write label to the current disk.

partition

Create and modify slices.

repair

Repair a specific sector on a disk.

save

Save new disk and slice information.

type

Select and define the disk type.

verify

Display labels.

volname

Assign an 8-character volume name to the disk.

The IDE disks have low-level formatting already performed on them by the manufacturer. You may, however, need to perform low-level formatting on the SCSI disks before you can partition them. You can do this by selecting the format option from the format command menu.

On the Job 

When you are running the format utility, do not select the system, otherwise you will delete the OS and lose the data on the disk.

From time to time you will need to know which devices are connected to the system or which devices the system recognizes. Furthermore, when the system is up and running you will want it to recognize a newly added device. Now, let's explore how to list devices on a Solaris system and how to reconfigure the devices.

Категории