This chapter contains disk administration procedures. Many procedures described in this chapter are optional if you are already familiar with how disks are managed on systems running the Oracle Solaris OS.
For information on the procedures associated with administering disks, see Administering Disks (Task Map).
For overview information about disk management, see Chapter 10, Managing Disks (Overview).
Task |
Description |
For Instructions |
---|---|---|
Identify the disks on a system. |
If you are not sure of the types of disks on a system, use the format utility to identify the disk types. | |
Format the disk. |
Determine whether a disk is already formatted by using the format utility. | |
|
In most cases, disks are already formatted. Use the format utility if you need to format a disk. | |
Display slice information. |
Display slice information by using the format utility. | |
Label the disk. |
Create the disk label by using the format utility. | |
Examine the disk label. |
Examine the disk label by using the prtvtoc command. | |
Recover a corrupted disk label. |
You can attempt to recover a disk label that was damaged due to a system or power failure. | |
Create a format.dat entry. |
Create a format.dat entry to support a third-party disk. | |
Automatically configure a SCSI disk. |
You can automatically configure a SCSI disk with the SCSI-2 specification for disk device mode sense pages even if the specific drive type is not listed in the /etc/format.dat file. | |
Identify a defective disk sector. |
Identify a defective disk sector by using the format utility. |
How to Identify a Defective Sector by Using Surface Analysis |
If necessary, fix a defective disk sector. |
Fix a defective disk sector by using the format utility. |
Use the format utility to discover the types of disks that are connected to a system. You can also use the format utility to verify that a disk is known to the system. For detailed information on using the format utility, see Chapter 15, The format Utility (Reference).
Become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Identify the disks that are recognized on the system by using the format utility.
# format |
The format utility displays a list of disks that it recognizes under AVAILABLE DISK SELECTIONS.
The following example shows format command output is from a system with one disk.
# format AVAILABLE DISK SELECTIONS: 0. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0 |
The output associates a disk's physical and logical device name to the disk's marketing name, which appears in angle brackets <>. See the example below. This method is an easy way to identify which logical device names represent the disks that are connected to your system. For a description of logical and physical device names, see Device Naming Conventions.
The following example uses a wildcard to display the four disks that are connected to a second controller.
# format /dev/rdsk/c2* AVAILABLE DISK SELECTIONS: 0. /dev/rdsk/c2t10d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /sbus@3,0/SUNW,fas@3,8800000/sd@a,0 1. /dev/rdsk/c2t11d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /sbus@3,0/SUNW,fas@3,8800000/sd@b,0 2. /dev/rdsk/c2t14d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@3,0/SUNW,fas@3,8800000/sd@e,0 3. /dev/rdsk/c2t15d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@3,0/SUNW,fas@3,8800000/sd@f,0 Specify disk (enter its number): |
The following example shows how to identify the disks on a SPARC based system.
# format 0. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0 Specify disk (enter its number): |
The output identifies that disk 0 (target 1) is connected to the second SCSI host adapter (scsi@2), which is connected to the second PCI interface (/pci@1f0/pci@1,1...). The output also associates both the physical and logical device name to the disk's marketing name, SUN36G.
The following example shows how to identify the disks on an x86 based system.
# format AVAILABLE DISK SELECTIONS: 0. c0d0 <DEFAULT cyl 615 alt 2 hd 64 sec 63> /pci@0,0/pci-ide@7,1/ata@0/cmdk@0,0 1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63> /pci@0,0/pci-ide@7,1/ata@0/cmdk@1,0 2. c1d0 <DEFAULT cyl 817 alt 2 hd 256 sec 63> /pci@0,0/pci-ide@7,1/ata@1/cmdk@0,0 Specify disk (enter its number): |
The output shows that disk 0 is connected to the first PCI host adapter (pci-ide@7...), which is connected to the ATA interface (ata...). If the format output on an x86 based system does not identify disks by their marketing names, then you can use the format utility's type and label features as described in the following steps to include the disk's marketing name.
The following steps must be done while the disk or system is inactive, which means booting from an installation DVD or the network. In addition, the final step is to relabel the disk, which can remove any existing partition information or data.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <DEFAULT cyl 49779 alt 2 hd 4 sec 720> /pci@0,0/pci1022,7450@a/pci17c2,10@4/sd@0,0 1. c1t1d0 <DEFAULT cyl 8921 alt 2 hd 255 sec 63> /pci@0,0/pci1022,7450@a/pci17c2,10@4/sd@1,0 2. c2t1d0 <SEAGATE-ST318404LSUN18G-4203-16.87GB> /pci@0,0/pci1022,7450@b/pci1000,10c0@1/sd@1,0 3. c2t2d0 <SEAGATE-ST318404LSUN18G-4203-16.87GB> /pci@0,0/pci1022,7450@b/pci1000,10c0@1/sd@2,0 . . . Specify disk (enter its number): 7 selecting c2t6d0 [disk formatted] format> type AVAILABLE DRIVE TYPES: 0. Auto configure 1. other Specify disk type (enter its number)[1]: 0 c2t6d0: configured with capacity of 16.87GB <IBM-DDYST1835SUN18G-S94N-16.87GB> selecting c2t6d0 [disk formatted] format> label Ready to label disk, continue? yes format> disk AVAILABLE DISK SELECTIONS: 0. c1t0d0 <DEFAULT cyl 49779 alt 2 hd 4 sec 720> /pci@0,0/pci1022,7450@a/pci17c2,10@4/sd@0,0 1. c1t1d0 <DEFAULT cyl 8921 alt 2 hd 255 sec 63> . . . 7. c2t6d0 <IBM-DDYST1835SUN18G-S94N-16.87GB> /pci@0,0/pci1022,7450@b/pci1000,10c0@1/sd@6,0 |
Go to Chapter 12, SPARC: Adding a Disk (Tasks) or Chapter 13, x86: Adding a Disk (Tasks).
Go to Creating a format.dat Entry.
Go to How to Label a Disk.
Connect the disk to the system by using your disk hardware documentation.
Disks are typically formatted by the manufacturer or reseller. They usually do not need to be reformatted when you install the drive.
A disk must be formatted before you can do the following:
Write data to the disk. However, most disks are already formatted.
Use the Solaris installation utility to install the system.
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.
Become superuser or assume an equivalent role.
# format |
A numbered list of disks is displayed.
Type the number of the disk that you want to check.
Specify disk (enter its number): 0 |
Verify that the disk you chose is formatted by noting the following message:
[disk formatted] |
The following example shows that disk c1t0d0 is formatted.
# format /dev/rdsk/c1* AVAILABLE DISK SELECTIONS: 0. /dev/rdsk/c1t0d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@0,0 1. /dev/rdsk/c1t1d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@1,0 2. /dev/rdsk/c1t8d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@8,0 3. /dev/rdsk/c1t9d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@9,0 Specify disk (enter its number): 0 selecting /dev/rdsk/c1t0d0s0 [disk formatted] |
Become superuser or assume an equivalent role.
Invoke the format utility.
# format |
A numbered list of disks is displayed.
Type the number of the disk that you want to format.
Specify disk (enter its number): 0 |
Do not select the system disk. If you format your system disk, you delete the OS and any data on this disk.
To begin formatting the disk, type format at the format> prompt. Confirm the command by typing y.
format> format Ready to format. Formatting cannot be interrupted and takes 23 minutes (estimated). Continue? yes |
Verify that the disk format was successful by noting the following messages:
Beginning format. The current time Tue ABC xx xx:xx:xx xxxx Formatting... done Verifying media... pass 0 - pattern = 0xc6dec6de 2035/12/18 pass 1 - pattern = 0x6db6db6d 2035/12/18 Total of 0 defective blocks repaired. |
Exit the format utility.
format> quit |
The following example shows how to format the disk c0t6d0.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SUNW18G cyl 7506 alt 2 hd 19 sec 248 /pci@1f,0/pci@1,1/scsi@2/sd@0,0 1. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0 2. c0t2d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@2,0 3. c0t3d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@3,0 4. c0t4d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@4,0 5. c0t5d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@5,0 6. c0t6d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@6,0 Specify disk (enter its number): 6 selecting c0t6d0 [disk formatted] format> format Ready to format. Formatting cannot be interrupted and takes 332 minutes (estimated). Continue? y Beginning format. The current time is Mon Jul 12 10:52:10 2010 Formatting... Verifying media... Total of 0 defective blocks repaired. format> quit |
You can use the format utility to check whether a disk has the appropriate disk slices. If you determine that a disk does not contain the slices you want to use, use the format utility to re-create them and label the disk. For information on creating disk slices, see SPARC: How to Create Disk Slices and Label a Disk or x86: How to Create Disk Slices and Label a Disk.
The format utility uses the term partition instead of slice.
Become superuser or assume an equivalent role.
Invoke the format utility.
# format |
A numbered list of disks is displayed.
Type the number of the disk for which you want to display slice information.
Specify disk (enter its number):1 |
Select the partition menu.
format> partition |
Display the slice information for the selected disk.
partition> print |
Exit the format utility.
partition> q format> q # |
Verify the displayed slice information by identifying specific slice tags and slices.
If the screen output shows that no slice sizes are assigned, the disk probably does not have slices.
The following example displays slice information for a disk with a VTOC label.
# format Searching for disks...done Specify disk (enter its number):1 Selecting c0t0d0 format> partition partition> print Current partition table (original): 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 partition> q format> q # |
For a detailed description of the slice information in these examples, see Chapter 10, Managing Disks (Overview).
The following example shows the slice information for a disk with an EFI label.
# format Searching for disks...done Specify disk (enter its number): 9 selecting c4t1d0 [disk formatted] format> partition partition> print Current partition table (original): partition> q format> q Part Tag Flag First Sector Size Last Sector 0 root wm 34 300.00GB 629145633 1 usr wm 629145634 300.00GB 1258291233 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 usr wm 1258291234 628.77GB 2576924637 8 reserved wm 2576924638 8.00MB 2576941021 |
The labeling of a disk is usually done during system installation or when you are creating new disk slices. You might need to relabel a disk if the disk label becomes corrupted. For example, from a power failure.
The format utility attempts to automatically configure any unlabeled SCSI disk. If the format utility is able to automatically configure an unlabeled disk, it displays a message similar to the following:
c0t0d1: configured with capacity of 4.00GB |
For information on labeling multiple disks with the same disk label, see Labeling Multiple Disks by Using the prtvtoc and fmthard Commands.
You can use the following procedure to do the following:
Label a disk with a VTOC or an EFI label for a disk 2 terabytes in size.
Label a disk that is greater than 2 terabytes in size with an EFI label.
If you want to put an EFI label on disk smaller than 2 terabytes, see Example 11–6.
Become superuser or assume an equivalent role.
Invoke the format utility.
# format |
A numbered list of disks is displayed.
Type the number of the disk that you want to label.
Specify disk (enter its number):1 |
If the format utility recognizes the disk type, the next step is to search for a backup label to label the disk. Labeling the disk with the backup label labels the disk with the correct partitioning information, the disk type, and disk geometry.
Select one of the following to label the disk:
If the disk is unlabeled and was successfully configured, go to Step 5 to label the disk.
The format utility will ask if you want to label the disk.
If the disk is labeled but you want to change the disk type, or if the format utility was not able to automatically configure the disk, proceed to Step 6 to set the disk type and label the disk.
Label the disk by typing y at the Label it now? prompt.
Disk not labeled. Label it now? y |
The disk is now labeled. Go to step 10 to exit the format utility.
Enter type at the format> prompt.
format> type |
The Available Drive Types menu is displayed.
Select a disk type from the list of possible disk types.
Specify disk type (enter its number)[12]: 12 |
Or, select 0 to automatically configure a SCSI-2 disk. For more information, see How to Automatically Configure a SCSI Drive.
Label the disk. If the disk is not labeled, the following message is displayed.
Disk not labeled. Label it now? y |
Otherwise, you are prompted with this message:
Ready to label disk, continue? y |
Verify the disk label.
format> verify |
Exit the format utility.
format> q # |
The following example shows how to automatically configure and label a 1.05-GB disk.
# format c1t0d0: configured with capacity of 1002.09MB AVAILABLE DISK SELECTIONS: 0. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c1t0d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 Specify disk (enter its number): 1 Disk not labeled. Label it now? yes format> verify format> q # |
The following example shows how to use the format -e command to label a disk that is 2 terabytes or less with an EFI label. Remember to verify that your layered software products will continue to work on systems with EFI-labeled disks. For general information on EFI label restrictions, see Restrictions of the EFI Disk Label.
# format -e Searching for disks...done AVAILABLE DISK SELECTIONS: 1. c1t0d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@0,0 2. c1t1d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@1,0 3. c1t8d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@8,0 4. c1t9d0 <SUNW18g cyl 7506 alt 2 hd 19 sec 248> /sbus@2,0/QLGC,isp@2,10000/sd@9,0 Specify disk (enter its number): 4 selecting c1t9d0 [disk formatted] format> label [0] SMI Label [1] EFI Label Specify Label type[0]: 1 Ready to label disk, continue? yes format> quit |
Examine disk label information by using the prtvtoc command. For a detailed description of the disk label and the information that is displayed by the prtvtoc command, see Chapter 10, Managing Disks (Overview).
Become superuser or assume an equivalent role.
Display the disk label information.
# prtvtoc /dev/rdsk/device-name |
where device-name is the raw disk device you want to examine.
The following example shows disk label information for a disk with a VTOC label.
# prtvtoc /dev/rdsk/c0t0d0s0 * /dev/rdsk/c0t0d0s0 partition map * * Dimensions: * 512 bytes/sector * 63 sectors/track * 15 tracks/cylinder * 945 sectors/cylinder * 8894 cylinders * 8892 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 1048950 3381210 4430159 / 1 3 01 0 1048950 1048949 2 5 00 0 8402940 8402939 7 8 00 4430160 3972780 8402939 /export/home |
The following example shows disk label information for a disk with an EFI label.
# prtvtoc /dev/rdsk/c3t1d0s0 * /dev/rdsk/c3t1d0s0 partition map * * Dimensions: * 512 bytes/sector * 2479267840 sectors * 2479267773 accessible sectors * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 34 262144 262177 1 3 01 262178 262144 524321 6 4 00 524322 2478727100 2479251421 8 11 00 2479251422 16384 2479267805 |
Sometimes, a power or system failure causes a disk's label to become unrecognizable. A corrupted disk label doesn't always mean that the slice information or the disk's data must be re-created or restored.
The first step to recovering a corrupted disk label is to label the disk with the correct geometry and disk type information. You can complete this step through the normal disk labeling method, by using either automatic configuration or manual disk type specification.
If the format utility recognizes the disk type, the next step is to search for a backup label to label the disk. Labeling the disk with the backup label labels the disk with the correct partitioning information, the disk type, and disk geometry.
Boot the system to single-user mode.
If necessary, boot the system from a local Solaris DVD or the network in single-user mode to access the disk.
See Chapter 12, Booting an Oracle Solaris System (Tasks), in System Administration Guide: Basic Administration or Booting an x86 Based System by Using GRUB (Task Map) in System Administration Guide: Basic Administration for information on booting the system.
# format |
The format utility attempts to automatically configure any unlabeled SCSI disk. If the format utility is able to configure the unlabeled and corrupted disk, it will display this message:
cwtxdy: configured with capacity of abcMB |
The format utility then displays a numbered list of disks on the system.
Type the number of the disk that you need to recover.
Specify disk (enter its number): 1 |
Select one of the following to determine how to label the disk.
If the disk was configured successfully, follow Steps 5 and 6. Then go to step 12.
If the disk was not configured successfully, follow Steps 7–11. Then go to step 12.
Search for the backup label.
format> verify Warning: Could not read primary label. Warning: Check the current partitioning and 'label' the disk or use the 'backup' command. Backup label contents: Volume name = < > ascii name = <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> pcyl = 2038 ncyl = 2036 acyl = 2 nhead = 14 nsect = 72 Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 300 148.15MB (301/0/0) 303408 1 swap wu 301 - 524 110.25MB (224/0/0) 225792 2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288 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 usr wm 525 - 2035 743.70MB (1511/0/0) 1523088 7 unassigned wm 0 0 (0/0/0) 0 |
If the format utility was able to find a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.
format> backup Disk has a primary label, still continue? y Searching for backup labels...found. Restoring primary label |
The disk label has been recovered. Go to Step 12.
If the format utility was not able to automatically configure the disk, specify the disk type by using the type command.
format> type |
The Available Drives Type menu is displayed.
Select 0 to automatically configure the disk. Or, select a disk type from the list of possible disk types.
Specify disk type (enter its number)[12]: 12 |
If the disk was successfully configured, reply with no when the format utility asks if you want to label the disk.
Disk not labeled. Label it now? no |
Use the verify command to search for backup labels.
format> verify Warning: Could not read primary label. Warning: Check the current partitioning and 'label' the disk or use the 'backup' command. . . . |
If the format utility was able to find a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.
format> backup Disk has a primary label, still continue? y Searching for backup labels...found. Restoring primary label |
The disk label has been recovered.
Exit the format utility.
format> q |
Verify the file systems on the recovered disk by using the fsck command.
For information on using the fsck command, see Chapter 21, Checking UFS File System Consistency (Tasks).
The Solaris OS supports many third-party disks. However, for the disk to be recognized, you might need to supply either a device driver, a format.dat entry, or both. Other options for adding disks are as follows:
If you are adding a SCSI disk, you might to try the format utility's automatic configuration feature. For more information, see Automatically Configuring SCSI Disk Drives.
You might try hot-plugging a PCI, SCSI, or USB disk. For more information, see Chapter 5, Managing Devices (Overview/Tasks).
If the third-party disk is designed to work with standard SunOS compatible device drivers, then the creation of an appropriate format.dat entry should suffice to allow the disk to be recognized by the format utility. In other cases, you need to load a third-party device driver to support the disk.
Sun cannot guarantee that its format utility will work properly with all third-party disk drivers. If the disk driver is not compatible with the Solaris format utility, the disk drive vendor should supply you with a custom disk formatting program.
This section discusses what to do if some of this software support is missing. Typically, you discover that software support is missing when you invoke the format utility and find that the disk type is not recognized.
Supply the missing software as described in this section. Then, refer to the appropriate configuration procedure for adding system disks or secondary disks in Chapter 12, SPARC: Adding a Disk (Tasks) or Chapter 13, x86: Adding a Disk (Tasks).
Unrecognized disks cannot be formatted without precise information about the disk's geometry and operating parameters. This information is supplied in the /etc/format.dat file.
SCSI-2 disks do not require a format.dat entry. The format utility automatically configures the SCSI-2 drivers if the disks are powered on during a reconfiguration boot. For step-by-step instructions on configuring a SCSI disk drive automatically, see How to Automatically Configure a SCSI Drive.
If your disk is unrecognized, use a text editor to create an entry in format.dat for the disk. You need to gather all the pertinent technical specifications about the disk and its controller before you start. This information should have been provided with the disk. If not, contact the disk manufacturer or your supplier.
Make a copy of the /etc/format.dat file.
# cp /etc/format.dat /etc/format.dat.gen |
Modify the /etc/format.dat file to include an entry for the third-party disk.
Use the format.dat information that is described in Chapter 15, The format Utility (Reference).
Also, use the disk's hardware product documentation to gather the required information.
The format utility automatically configures SCSI disk drives even if that specific type of drive is not listed in the /etc/format.dat file. This feature enables you to format, create slices for, and label any disk driver that is compliant with the SCSI-2 specification for disk device mode sense pages.
Here are other options for adding disks:
If you are adding a SCSI disk, you might to try the format utility's automatic configuration feature.
You might try hot-plugging a PCI, SCSI, or USB disk. For more information, see Chapter 5, Managing Devices (Overview/Tasks).
The following steps are involved in configuring a SCSI drive by using automatic configuration:
Shutting down the system
Attaching the SCSI disk drive to the system
Turning on the disk drive
Performing a reconfiguration boot
Using the format utility to automatically configure the SCSI disk drive
After the reconfiguration boot, invoke the format utility. The format utility will attempt to configure the disk and, if successful, alert the user that the disk was configured. For step-by-step instructions on automatically configuring a SCSI disk drive, see How to Automatically Configure a SCSI Drive.
Here's an example of a partition table for a 1.3-GB SCSI disk drive that was displayed by the format utility.
Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 96 64.41MB (97/0/0) 1 swap wu 97 - 289 128.16MB (193/0/0) 2 backup wu 0 - 1964 1.27GB (1965/0/0) 6 usr wm 290 - 1964 1.09GB (1675/0/0) |
Become superuser or equivalent role.
Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure |
Shut down the system.
# shutdown -i0 -gn -y |
Brings the system down to init level 0, the power-down state.
Notifies logged-in users that they have n seconds before the system begins to shut down.
Specifies that the command should run without user intervention.
The ok prompt is displayed after the system is shut down.
Turn off the power to the system and all external peripheral devices.
Ensure that the disk you are adding has a different target number than the other devices on the system.
Typically, a small switch is located at the back of the disk for this purpose.
Connect the disk to the system, and check the physical connections.
Refer to the disk's hardware installation guide for details.
Turn on the power to all external peripherals.
Turn on the power to the system.
The system boots and displays the login prompt.
Log back in as superuser or assume an equivalent role.
Invoke the format utility, and select the disk that you want to configure automatically.
# format Searching for disks...done c1t0d0: configured with capacity of 1002.09MB AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): 1 |
Type yes in response to the prompt to label the disk.
Typing y causes the disk label to be generated and written to the disk by using SCSI automatic configuration.
Disk not labeled. Label it now? y |
Verify the disk label.
format> verify |
format> q |
If a disk on your system has a defective sector, you can repair the disk by following procedures in this section. You might become aware of defective sectors when you do the following:
Run surface analysis on a disk
For more information on the analysis feature of the format utility, see analyze Menu.
The defective area reported while your system is running might not be accurate. Because the system does disk operations many sectors at a time, it is often hard to pinpoint exactly which sector caused a given error. To find the exact sector or sectors, use How to Identify a Defective Sector by Using Surface Analysis.
Get multiple error messages from the disk driver concerning a particular portion of the disk while your system is running.
Console messages that are related to disk errors appear similar to the following:
WARNING: /io-unit@f,e0200000/sbi@0,0/QLGC,isp@1,10000/sd@3,0 (sd33): Error for command 'read' Error Level: Retryable Requested Block 126, Error Block: 179 Sense Key: Media Error Vendor 'name': ASC = 0x11 (unrecovered read error), ASCQ = 0x0, FRU = 0x0 |
This message indicates that block 179 might be defective. You would relocate the bad block by using the format utility's repair command. Or, you would use the analyze command with the repair option enabled.
Become superuser or assume an equivalent role.
Unmount the file system in the slice that contains the defective sector.
# umount /dev/dsk/device-name |
For more information, see mount(1M).
Invoke the format utility.
# format |
Select the affected disk.
Specify disk (enter its number):1 selecting c0t2d0: [disk formatted] Warning: Current Disk has mounted partitions. |
Select the analyze menu.
format> analyze |
Set up the analysis parameters by typing setup at the analyze> prompt.
Use the parameters shown here:
analyze> setup Analyze entire disk [yes]? n Enter starting block number [0, 0/0/0]: 12330 Enter ending block number [2052287, 2035/13/71]: 12360 Loop continuously [no]? y Repair defective blocks [yes]? n Stop after first error [no]? n Use random bit patterns [no]? n Enter number of blocks per transfer [126, 0/1/54]: 1 Verify media after formatting [yes]? y Enable extended messages [no]? n Restore defect list [yes]? y Create defect label [yes]? y |
Find the defect by using the read command.
analyze> read Ready to analyze (won't harm SunOS). This takes a long time, but is interruptible with Control-C. Continue? y pass 0 2035/12/1825/7/24 pass 1 Block 12354 (18/4/18), Corrected media error (hard data ecc) 25/7/24 ^C Total of 1 defective blocks repaired. |
Become superuser or assume an equivalent role.
Invoke the format utility.
# format |
Select the disk that contains the defective sector.
Specify disk (enter its number): 1 selecting c0t3d0 [disk formatted] format> |
Select the repair command.
format> repair |
Type the defective block number.
Enter absolute block number of defect: 12354 Ready to repair defect, continue? y Repairing block 12354 (18/4/18)...ok. format> |
If you are unsure of the format that is used to identify the defective sector, see How to Identify a Defective Sector by Using Surface Analysis for more information.
Use the following tips to help you manage disks more efficiently.
Invoke the format -M command to enable extended and diagnostic messages for ATA and SCSI devices.
In this example, the series of numbers under Inquiry represent the hexadecimal value of the inquiry data that is displayed to the right of the numbers.
# format -M Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): 0 selecting c0t3d0 [disk formatted] format> inquiry Inquiry: 00 00 02 02 8f 00 00 12 53 45 41 47 41 54 45 20 ........NAME.... 53 54 31 31 32 30 30 4e 20 53 55 4e 31 2e 30 35 ST11200N SUN1.05 38 33 35 38 30 30 30 33 30 32 30 39 00 00 00 00 835800030209.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 31 .Copyright (c) 1 39 39 32 20 53 65 61 67 61 74 65 20 41 6c 6c 20 992 NAME All 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 20 rights reserved 30 30 30 000 Vendor: name Product: ST11200N SUN1.05 Revision: 8358 format> |
Use the prtvtoc and fmthard commands to label multiple disks with the same disk geometry.
Use the following for loop in a script to copy a disk label from one disk and replicate it on multiple disks.
# for i in x y z > do > prtvtoc /dev/rdsk/cwtxdysz | fmthard -s - /dev/rdsk/cwt${i}d0s2 > done |
In this example, the disk label from c2t0d0s0 is copied to four other disks.
# for i in 1 2 3 5 > do > prtvtoc /dev/rdsk/c2t0d0s0 | fmthard -s - /dev/rdsk/c2t${i}d0s2 > done fmthard: New volume table of contents now in place. fmthard: New volume table of contents now in place. fmthard: New volume table of contents now in place. fmthard: New volume table of contents now in place. # |