Defining a Disk’s Geometry
Before creating a file system on a disk, you need to understand the basic geometry of a disk drive. Disks come in many shapes and sizes. The number of heads, tracks, and sectors and the disk capacity vary from one model to another. Basic disk terminology is described in Table 4-3.
Table 4-3 Disk Terminology
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 control the disk drive. |
Disk label |
The first sector of a disk (block 0) that contains disk geometry and partition information. Also referred to as the VTOC. To label a disk means to write slice information onto the disk. You usually label a disk after you change its slices using the format command. |
Device driver |
A kernel module that controls a hardware or virtual device. |
A hard disk consists of several separate disk platters mounted on a common spindle. Data stored on each platter surface is written and read by disk heads. The circular path that a disk head traces over a spinning disk platter is called a “track.”
Each track is made up of a number of sectors laid end to end. A sector consists of a header, a trailer, and 512 bytes of data. The header and trailer contain error-checking information to help ensure the accuracy of the data. Taken together, the set of tracks traced across all the individual disk platter surfaces for a single position of the heads is called a “cylinder.”
Disk Controllers
Associated with every disk is a controller, an intelligent device responsible for organizing data on the disk. Some disk controllers are located on a separate circuit board, such as SCSI. Other controller types are integrated with the disk drive, such as SATA and IDE.
Defect List
Disks might contain areas where data cannot be written and retrieved reliably. These areas are called “defects.” The controller uses the error-checking information in each disk block’s trailer to determine whether a defect is present in that block. When a block is found to be defective, the controller can be instructed to add it to a defect list and avoid using that block in the future. The last two cylinders of a disk are set aside for diagnostic use and for storing the disk defect list.
Disk Labels
A special area of every disk is set aside for storing information about the disk’s controller, geometry, and slices. This information is called the disk’s label or VTOC.
To label a disk means to write slice information onto the disk. You usually label a disk after defining its slices. If you fail to label a disk after creating slices, the slices will be unavailable because the OS has no way of knowing about them.
Oracle Solaris supports two types of disk labels:
- SMI: The traditional VTOC disk label used for boot disks and disks smaller than two terabytes (2TB)
- EFI: The Extensible Firmware Interface label for disks larger than 2TB
The advantages of the EFI disk label over the SMI disk label are as follows:
- Provides support for disks greater than 2TB 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 that no partition can start at sector zero (0).
- No cylinder, head, or sector information is stored in the EFI 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.
- Oracle Solaris ZFS file systems use EFI labels by default when the entire disk is selected.
The following are restrictions of the EFI disk label:
- A disk with an EFI label may not be recognized on systems running older releases.
- Up until Oracle Solaris 11.1, the x86- and SPARC-based systems could not boot from a disk with an EFI disk label. In Oracle Solaris 11.1, x86-based systems can now boot to an EFI (GPT) labeled disk using GRUB2 (an updated version of GRUB). As of this writing, this feature is not currently available on SPARC-based systems. A boot disk on a SPARC-based system is installed with a legacy VTOC (SMI) label.
- The EFI specification prohibits overlapping slices. The entire disk is represented by c#t#d#.
- The EFI disk label 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.
It may be necessary to change a disk label from SMI to EFI or vice versa. Use the format command with the –e option as described in the section titled, “Using the format Utility to Create Slices: SPARC” later in this chapter.
Partition Tables
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. A disk’s partition table can be displayed by using the format utility described in the “Disk Slices” section that follows.