This chapter provides overview information about Solaris disk slices and introduces the format utility.
This is a list of overview information in this chapter.
For instructions on how to add a disk to your system, see Chapter 12, SPARC: Adding a Disk (Tasks) or Chapter 13, x86: Adding a Disk (Tasks).
This section describes new disk management features in this Solaris release.
Solaris 9 4/03 – Provides support for disks that are larger than 1 terabyte on systems that run a 64-bit Solaris kernel.
You can download the EFI specification at http://www.intel.com/technology/efi/main_specification.htm.
The EFI label provides support for physical disks and virtual disk volumes. This release also includes updated disk utilities for managing disks greater than 1 terabyte. The UFS file system is compatible with the EFI disk label, and you can create a UFS file system greater than 1 terabyte. For information on creating a multiterabyte UFS file system, see SPARC: Support of Multiterabyte UFS File Systems.
The unbundled Sun QFS file system is also available if you need to create file systems greater than 1 terabyte. For information on the Sun QFS file system, see http://docs.sun.com/db/doc/816-2542-10.
The Solaris Volume Manager software can also be used to manage disks greater than 1 terabyte in this Solaris release. For information on using Solaris Volume Manager, see Solaris Volume Manager Administration Guide.
The VTOC label is still available for disks less than 1 terabyte in size. If you are only using disks smaller than 1 terabyte on your systems, managing disks will be the same as in previous Solaris releases. In addition, you can use the format-e command to label a disk less than 1 terabyte with an EFI label. For more information, see Example 11–6.
The EFI disk label differs from the VTOC disk label in the following ways:
Provides support for disks greater than 1 terabyte in size.
Provides usable slices 0–6, where slice 2 is just another slice.
Partitions (or slices) cannot overlap with the primary or backup label, nor with any other partitions. The size of the EFI label is usually 34 sectors, so partitions start at sector 34. This feature means no partition can start at sector zero (0).
No cylinder, head, or sector information is stored in the label. Sizes are reported in blocks.
Information that was stored in the alternate cylinders area, the last two cylinders of the disk, is now stored in slice 8.
If you use the format utility to change partition sizes, the unassigned partition tag is assigned to partitions with sizes equal to zero. By default, the format utility assigns the usr partition tag to any partition with a size greater than zero. You can use the partition change menu to reassign partition tags after the partitions are changed. However, you cannot change a partition with a non-zero size to the unassigned partition tag.
Keep the following restrictions in mind when determining whether to use disks greater than 1 terabyte is appropriate for your environment:
The SCSI driver, ssd, currently only supports up to 2 terabytes. If you need greater disk capacity than 2 terabytes, use a volume management product like Solaris Volume Manager to create a larger device.
Layered software products intended for systems with EFI-labeled disks might be incapable of accessing a disk with an EFI disk label.
A disk with an EFI disk label is not recognized on systems running previous Solaris releases.
The EFI disk label is not supported on IDE disks.
You cannot boot from a disk with an EFI disk label.
You cannot use the Solaris Management Console's Disk Manager Tool to manage disks with EFI labels. Use the format utility to partition disks with EFI labels. Then, you can use the Solaris Management Console's Enhanced Storage Tool to manage volumes and disksets with EFI-labeled disks.
The EFI specification prohibits overlapping slices. The whole disk is represented by cxtydz.
Provides information about disk or partition sizes in sectors and blocks, but not in cylinders and heads.
The following format options are either not supported or are not applicable on disks with EFI labels:
The save option is not supported because disks with EFI labels do not need an entry in the format.dat file.
The backup option is not applicable because the disk driver finds the primary label and writes it back to the disk.
The Solaris installation utilities automatically recognize disks with EFI labels, but cannot use the Solaris installation utilities to repartition these disks. You must use the format utility to repartition this disk before or after installation. The Solaris Upgrade and Live Upgrade utilities also recognize a disk with an EFI label. However, you cannot boot a system from an EFI-labeled disk.
After the Solaris release is installed on a system with an EFI-labeled disk, the partition table looks similar to the following:
Current partition table (original): Total disk sectors available: 2576924638 + 16384 (reserved sectors) Part Tag Flag First Sector Size Last Sector 0 root wm 34 1.20TB 2576924636 1 unassigned wm 0 0 0 2 unassigned wm 0 0 0 3 unassigned wm 0 0 0 4 unassigned wm 0 0 0 5 unassigned wm 0 0 0 6 unassigned wm 0 0 0 8 reserved wm 2576924638 8.00MB 2576941021 |
Use the following table to locate information on managing disks with EFI disk labels.
Task |
For More Information |
---|---|
If the system is already installed, connect the disk to the system and perform a reconfiguration boot. | |
Repartition the disk with the format utility, if necessary. | |
Create disk volumes, and if needed, create soft partitions with Solaris Volume Manager. |
Chapter 2, Storage Management Concepts, in Solaris Volume Manager Administration Guide |
Create UFS file systems for the new disk with the newfs command. | |
Or, create a QFS file system. |
In previous Solaris releases, slice 2 (s2) was used to represent the whole disk. You could use the dd command to clone or copy disks by using syntax similar to the following:
dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t2d0s2 bs=128k |
Now, you must use a slightly different procedure to clone or copy disks larger than 1 terabyte so that the UUID of cloned disks are unique. For example:
Use the dd command to clone the disk with an EFI label:
# dd if=/dev/rdsk/c0t0d0 of=/dev/rdsk/c0t2d0 bs=128k |
Pipe the prtvtoc output of the disk to be copied to the fmthard command to create a new label for the cloned disk.
# prtvtoc /dev/rdsk/c0t0d0 | fmthard -s - /dev/rdsk/c0t2d0 |
If you do not create a new label for the cloned disk, other software products might corrupt data on EFI-labeled disks if they encounter duplicate UUIDs.
Use the following error messages and solutions to troubleshooting problems with EFI-labeled disks.
The capacity of this LUN is too large. Reconfigure this LUN so that it is < 2TB. |
You attempted to create a partition on a SCSI device that is larger than 2 terabytes.
Create a partition on a SCSI device that is less than 2 terabytes.
Dec 3 09:26:48 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/ sf@1,0/ssd@w50020f23000002a4,0 (ssd1): Dec 3 09:26:48 holoship disk has 2576941056 blocks, which is too large for a 32-bit kernel |
You attempted to boot a system running a 32-bit SPARC kernel with a disk greater than 1 terabyte.
Boot a system running a 64-bit SPARC kernel with a disk greater than 1 terabyte.
Dec 3 09:12:17 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/ sf@1,0/ssd@w50020f23000002a4,0 (ssd1): Dec 3 09:12:17 holoship corrupt label - wrong magic number |
You attempted to add this disk to a system running an older Solaris release.
Add this disk to a system running the Solaris release that supports the EFI disk label.
Use these references to find step-by-step instructions for managing disks.
Disk Management Task |
For More Information |
---|---|
Format a disk and examine a disk label | |
Add a new disk to a SPARC system | |
Add a new disk to an x86 system | |
Hot-Plug a SCSI or PCI disk |
The management of disks in the Solaris environment usually involves setting up the system and running the Solaris installation program to create the appropriate disk slices and file systems and to install the operating system. Occasionally, you might need to use the format utility to add a new disk drive or replace a defective one.
The Solaris operating system runs on two types of hardware, or platforms—SPARC and x86. The Solaris operating system runs on both 64–bit and 32–bit address spaces. The information in this document pertains to both platforms and address spaces unless called out in a special chapter, section, note, bullet, figure, table, example, or code example.
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:
Disk Term |
Description |
---|---|
Track |
A concentric ring on a disk that passes under a single stationary disk head as the disk rotates. |
Cylinder |
The set of tracks with the same nominal distance from the axis about which the disk rotates. |
Sector |
Section of each disk platter. A sector holds 512 bytes. |
Block |
A data storage area on a disk. A disk block is 512 bytes. |
Disk controller |
A chip and its associated circuitry that controls the disk drive. |
Disk label |
The first sector of a disk that contains disk geometry and partition information. |
Device driver |
A device driver is a kernel module that controls a hardware or virtual device. |
For additional information, see the product information from your disk's manufacturer.
Files stored on a disk are contained in file systems. Each file system on a disk is assigned to a slice, which is a group of sectors 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.
For information about file systems, see Chapter 15, Managing File Systems (Overview).
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. The following table summarizes the differences.
Table 10–1 Slice Differences on Platforms
SPARC Platform |
x86 Platform |
---|---|
Whole disk is devoted to Solaris environment. |
Disk is divided into fdisk partitions, one fdisk partition per operating system. |
VTOC – Disk is divided into 8 slices, numbered 0–7. EFI – Disk is divided into 7 slices, numbered 0–6. |
VTOC – The Solaris fdisk partition is divided into 10 slices, numbered 0–9. |
Solaris Volume Manager, previously Solstice DiskSuiteTM, has a partitioning feature, soft partitioning, that enables more than eight partitions per disk.
For general information about Solaris Volume Manager, see Chapter 2, Storage Management Concepts, in Solaris Volume Manager Administration Guide. For information on soft partitioning, see Chapter 12, Soft Partitions (Overview), in Solaris Volume Manager Administration Guide.
The following table describes the slices on a SPARC based system.
Table 10–2 SPARC: Customary Disk Slices
Slice |
File System |
Usually Found on Client or Server Systems? |
Comments |
---|---|---|---|
0 |
root (/) |
Both |
Holds files and directories that make up the operating system. EFI – You cannot boot from a disk with an EFI label. |
1 |
swap |
Both |
Provides virtual memory, or swap space. |
2 |
— |
Both |
VTOC – Refers to the entire disk, by convention. The size of this slice should not be changed. EFI – Optional slice to be defined based on your site's needs. |
3 |
/export |
Both |
Optional slice that can be defined based on your site's needs. Can be used on a server to hold alternative versions of operating systems that are required by client systems. |
4 |
|
Both |
Optional slice to be defined based on your site's needs. |
5 |
|
Both |
Optional slice to be defined based on your site's needs. Can be used to hold application software added to a system. If a slice is not allocated for the /opt file system during installation, the /opt directory is put in slice 0. |
6 |
/usr |
Both |
Holds operating system commands (also known as executables). This slice also holds documentation, system programs (init and syslogd, for example) and library routines. |
7 |
/home or /export/home |
Both |
VTOC – Holds files that are created by users. EFI – Not applicable. |
8 |
N/A |
N/A |
VTOC – Not applicable. EFI – A reserved slice created by default. This area is similar to the VTOC's alternate cylinders. Do not modify nor delete this slice. |
On x86 based systems, disks are divided into fdisk partitions. An fdisk partition is a section of the disk that reserved for a particular operating system, such as the Solaris release.
The Solaris release places ten slices, numbered 0–9, on a Solaris fdisk partition as shown in the following table.
Table 10–3 x86: Customary Disk Slices
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. |
2 |
— |
Both |
Refers to the entire disk, by convention. The size of this slice should not be changed. |
3 |
/export |
Both |
Optional slice to be defined based on your site's needs. Can be used on a server to hold alternative versions of operating systems that are required by client systems. |
4 |
|
|
Optional slice to be defined based on your site's needs. |
5 |
|
Both |
Optional slice to be defined based on your site's needs. Can be used to hold application software added to a system. If a slice is not allocated for the /opt file system during installation, the /opt directory is put in slice 0. |
6 |
/usr |
Both |
Holds operating system commands (also known as executables). This slice also holds documentation, system programs (init and syslogd, for example) and library routines. |
7 |
/home or /export/home |
Both |
Holds files that are created by users. |
8 |
— |
Both |
Contains information necessary for to boot the Solaris environment from the hard disk. The slice resides at the beginning of the Solaris fdisk partition (although the slice number itself does not indicate this fact), and is known as the boot slice. |
9 |
— |
Both |
Provides an area that is reserved for alternate disk blocks. Slice 9 is known as the alternate sector slice. |
The SunOS operating system stores the disk label in block 0 of each disk. So, third-party database applications that create raw data slices must not start at block 0, or the disk label will be overwritten and the data on the disk will be inaccessible.
Do not use the following areas of the disk for raw data slices, which are sometimes created by third-party database applications:
Block 0 where the disk label is stored
Slice 2, which represents the entire disk with a VTOC label
Although a single large disk 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.
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 another disk holds the /export/home file system and other file systems that contain user data.
In a multiple disk arrangement, the disk that contains the operating system software and swap space (that is, the disk that holds the root (/) and /usr file systems and the slice for swap space) is called the system disk. Other disks are called secondary disks or non-system disks.
When you arrange a system's file systems on multiple disks, you can modify file systems and slices on the secondary disks without having to shut down the system or reload operating system software.
When you have more than one disk, you also increase input-output (I/O) volume. By distributing disk load across multiple disks, you can avoid I/O bottlenecks.
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.
System configurations that need disk space are as follows:
Servers
Standalone systems
Each system configuration can use slices in a different way. The following table lists some examples.
Table 10–4 System Configurations and Slices
Slice |
Servers |
Standalone Systems |
---|---|---|
0 |
root |
root |
1 |
swap |
swap |
2 |
— |
— |
3 |
/export |
— |
6 |
/usr |
/usr |
7 |
/export/home |
/home |
For more information about system configurations, see Overview of System Types in System Administration Guide: Basic Administration.
The Solaris installation program provides default slice sizes based on the software you select for installation.
Read the following overview of the format utility and its uses before proceeding to the “how-to” or reference sections.
The format utility is a system administration tool that is used to prepare hard disk drives for use on your Solaris system.
The following table shows the features and associated benefits that the format utility provides.
Table 10–5 Features and Benefits of the format Utility
The format utility options are fully described in Chapter 14, The format Utility (Reference).
Disk drives are partitioned and labeled by the Solaris installation program when you install the Solaris release. You can use the format utility to do the following:
Display slice information
Divide a disk into slices
Add a disk drive to an existing system
Format a disk drive
Label a disk
Repair a disk drive
Analyze a disk for errors
The main reason a system administrator uses the format utility is to divide a disk into disk slices. These steps are covered in Chapter 12, SPARC: Adding a Disk (Tasks) and Chapter 13, x86: Adding a Disk (Tasks).
See the following section for guidelines on using the format utility.
Task |
Guidelines |
For More Information |
---|---|---|
Format a disk |
| |
Replace a system disk |
|
SPARC: How to Connect a System Disk and Boot or x86: How to Connect a System Disk and Boot or, if the system must be reinstalled, Solaris 9 9/04 Installation Guide |
Divide a disk into slices |
|
SPARC: How to Create Disk Slices and Label a Disk or x86: How to Create Disk Slices and Label a Disk |
Add a secondary disk to an existing system |
|
SPARC: How to Connect a Secondary Disk and Boot or x86: How to Connect a Secondary Disk and Boot |
Repair a disk drive |
|
In most cases, disks are formatted by the manufacturer or reseller. So, they do not need to be reformatted when you install the drive. To determine if a disk is formatted, use the format utility. For more information, see How to Determine if a Disk is Formatted.
If you determine that a disk is not formatted, use the format utility to format the disk.
When you format a disk, you accomplishes two steps:
The disk media is prepared for use
A list of disk defects based on a surface analysis is compiled
Formatting a disk is a destructive process because 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 the cause of recurring problems, you can use the format utility to do a surface analysis. However, be careful to use only the commands that do not destroy data. For details, see How to Format a Disk.
A small percentage of total disk space that is 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 a disk might take anywhere from a few minutes to several hours, depending on the type and size of the disk.
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 that is used to described the disk label is the VTOC (Volume Table of Contents) on a disk with a VTOC label. To label a disk means to write slice information onto the disk. You usually label a disk after you change its slices.
If you fail to label a disk after you create slices, the slices will be unavailable because the operating system has no way of “knowing” about the slices.
An important part of the disk label is the partition table, which identifies a disk's slices, the slice boundaries (in cylinders), and the total size of the slices. You can display a disk's partition table by using the format utility. The following table describes partition table terminology.
Table 10–7 Partition Table Terminology
Partition Term |
Value |
Description |
---|---|---|
Number |
0-7 |
VTOC – Partitions or slices, numbered 0–7. EFI – Partitions or slices, numbered 0–6. |
Tag |
0=UNASSIGNED 1=BOOT 2=ROOT 3=SWAP 4=USR 5=BACKUP 7=VAR 8=HOME 11=RESERVED |
A numeric value that usually describes the file system mounted on this partition. |
Flags |
wm |
The partition is writable and mountable. |
|
wu rm |
The partition is writable and unmountable. This is the default state of partitions that are 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 tags are assigned by convention and require no maintenance.
For more information on displaying the partition table, see How to Display Disk Slice Information or How to Examine a Disk Label.
The following is an example of a partition table from a 4.0-Gbyte disk with a VTOC label displayed from the format utility:
Total disk cylinders available: 8892 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 1110 - 4687 1.61GB (0/3578/0) 3381210 1 swap wu 0 - 1109 512.00MB (0/1110/0) 1048950 2 backup wm 0 - 8891 4.01GB (0/8892/0) 8402940 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 home wm 4688 - 8891 1.89GB (0/4204/0) 3972780 |
The partition table displayed by the format utility contains the following information:
Column Name |
Description |
---|---|
Part |
Partition (or slice number). See Table 10–7 for a description of this column. |
Tag |
Partition tag. See Table 10–7 for a description of this column. |
Flags |
Partition flag. See Table 10–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. |
First Sector |
EFI – The starting block number. |
Last Sector |
EFI – The ending block number. |
The following is an example of a EFI disk label displayed by using the prtvtoc command.
# prtvtoc /dev/rdsk/c4t1d0s0 * /dev/rdsk/c4t1d0s0 partition map * * Dimensions: * 512 bytes/sector * 2576941056 sectors * 2576940989 accessible sectors * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 34 629145600 629145633 1 4 00 629145634 629145600 1258291233 6 4 00 1258291234 1318633404 2576924637 8 11 00 2576924638 16384 2576941021 * Flags: * 1: unmountable * 10: read-only * |
The prtvtoc command provides the following information:
Column Name |
Description |
---|---|
Dimensions |
This section describes the physical dimensions of the disk drive. |
Flags |
This section describes the flags listed in the partition table section. For a description of partition flags, see Table 10–7. |
Partition (or Slice) Table |
This section contains the following information: |
Partition |
Partition (or slice number). For a description of this column, see Table 10–7. |
Tag |
Partition tag. For a description of this column, see Table 10–7. |
Flags |
Partition flag. For a description of this column, see Table 10–7. |
First Sector |
The first sector of the slice. |
Sector Count |
The total number of sectors in the slice. |
Last Sector |
The last sector of the slice. |
Mount Directory |
The last mount point directory for the file system. |
The format utility is most often used by system administrators to divide a disk into slices. The steps are as follows:
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 of the format utility. The modify command allows you to create slices by specifying the size of each slice without having to keep track of the starting cylinder boundaries. The modify command also keeps tracks of any disk space that remains in 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 free hog slice exists only during installation or when you run the format utility. There is no permanent free hog slice during day-to-day operations.
For information on using the free hog slice, see SPARC: How to Create Disk Slices and Label a Disk or x86: How to Create Disk Slices and Label a Disk.