Sun Microsystems System Administration Guide, Volume 1 (2000) - page 11

 

  Index      Manuals     Sun Microsystems System Administration Guide, Volume 1 (2000)

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     9      10      11      12     ..

 

 

 

Sun Microsystems System Administration Guide, Volume 1 (2000) - page 11

 

 

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 might 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. The table below describes
partition table terminology.
TABLE 28-7
Partition Table Terminology
Partition Term
Value
Description
0-7
Number
Partition or (slice number). Valid numbers
are 0-7.
Tag
0=UNASSIGNED 1=BOOT
A numeric value that usually describes the
2=ROOT 3=SWAP 4=USR
file system mounted on this partition.
5=BACKUP 7=VAR
8=HOME
Flags
wm
The partition is writable and mountable.
332
TABLE 28-7
Partition Table Terminology
(continued)
Partition Term
Value
Description
wu rm
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 tags are assigned by convention and require no maintenance.
See “How to Display Disk Slice Information” on page 344 or “How to Examine a
Disk Label” on page 348 for more information on displaying the partition table.
Examples—Partition Tables
The following partition table example is displayed from a 1.05-Gbyte disk using the
format utility:
Total disk cylinders available: 2036 + 2 (reserved cylinders)
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
The partition table contains the following information:
Column Name
Description
Part
Partition (or slice number). See Table 28-7 for a description of this
column.
Tag
Partition tag. See Table 28-7 for a description of this column.
Flags
Partition flag. See Table 28-7 for a description of this column.
Disk Management (Overview)
333
Column Name
Description
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/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
* Dimensions:
512 bytes/sector
72 sectors/track
14 tracks/cylinder
1008 sectors/cylinder
2038 cylinders
2036 accessible cylinders
* Flags:
1: unmountable
10: read-only
First
Sector
Last
* Partition Tag Flags
Sector
Count
Sector Mount Directory
0
2
00
0
303408
303407
/
1
3
01
303408
225792
529199
2
5
00
0
2052288
2052287
6
4
00
529200
1523088
2052287
/usr
The disk label includes the following information:
Dimensions - This section describes the physical dimensions of the disk drive.
Flags - This section describes the flags listed in the partition table section. See Table
28-7 for a description of partition flags.
Partition (or Slice) Table - This section contains the following information:
Column Name
Description
Partion
Partition (or slice number). See Table 28-7 for a description of
this column.
Tag
Partition tag. See Table 28-7 for a description of this column.
334
Column Name
Description
Flags
Partition flag. See Table 28-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.
Disk Management (Overview)
335
See “SPARC: How to Create Disk Slices and Label a Disk” on page 367 or “IA: How
to Create Disk Slices and Label a Disk” on page 386 for information on using the free
hog slice.
336
CHAPTER
29
Administering Disks (Tasks)
This chapter contains disk administration procedures. Many of the procedures
described in this chapter are optional if you are already familiar with how disks are
managed on systems running the Solaris release.
This is a list of step-by-step instructions in this chapter.
“How to Identify the Disks on a System” on page 339
“How to Determine if a Disk is Formatted” on page 341
“How to Format a Disk” on page 342
“How to Display Disk Slice Information” on page 344
“How to Label a Disk” on page 346
“How to Examine a Disk Label” on page 348
“How to Recover a Corrupted Disk Label” on page 349
“How to Create a format.dat Entry” on page 353
“How to Automatically Configure a SCSI Drive” on page 355
“How to Identify a Defective Sector by Using Surface Analysis” on page 357
“How to Repair a Defective Sector” on page 359
For overview information about disk management, see Chapter 28.
Administering Disks Task Map
337
TABLE 29-1
Administering Disks Task Map
Task
Description
For Instructions, Go To
1. Identify the Disks on a
If you are not sure of the types of disks on a
“How to Identify the Disks on
System
system, use the format utility to identify the
a System” on page 339
disk types.
2. Format the Disk
Determine whether a disk is already
“How to Determine if a Disk is
formatted by using the format utility.
Formatted” on page 341
In most cases, disks are already formatted.
“How to Format a Disk” on
Use the format utility if you need to format
page 342
a disk.
3. Display Slice Information
Display slice information by using the
“How to Display Disk Slice
format utility.
Information” on page 344
4. Label the Disk
Create the disk label by using the format
“How to Label a Disk” on page
utility.
346
5. Examine the Disk Label
Examine the disk label by using the
“How to Examine a Disk
prtvtoc command.
Label” on page 348
6. Create a format.dat
Create a format.dat entry to support a
“How to Create a format.dat
Entry
third-party disk.
Entry” on page 353
7. Repair a Defective Disk
Identify a defective disk sector by using the
“How to Identify a Defective
Sector
format utility.
Sector by Using Surface
Analysis” on page 357
8. If Necessary, Fix a
Fix a defective disk sector by using the
“How to Repair a Defective
Defective Disk Sector
format utility.
Sector” on page 359
338
Identifying Disks on a System
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. See
Chapter 32 for information on using the format utility.
How to Identify the Disks on a System
1. Become superuser.
2. Identify the disks that are recognized on the system with the format utility.
# format
The format utility displays a list of disks that it recognizes under AVAILABLE
DISK SELECTIONS.
Examples—Identifying the Disks on a System
The following format output is from a system with two disks.
# format
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):
The format output associates a disk’s physical and local device name to the disk’s
marketing name which appears in angle brackets <>. This is an easy way to identify
which local device names represent the disks connected to your system. See Chapter
26 for a description of local and physical device names.
The following example uses a wildcard to display the disks connected to a second
controller.
# format /dev/rdsk/c2*
AVAILABLE DISK SELECTIONS:
0. /dev/rdsk/c2t0d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@0,0
1. /dev/rdsk/c2t1d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@1,0
2. /dev/rdsk/c2t2d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
Administering Disks (Tasks)
339
(Continuation)
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@2,0
3. /dev/rdsk/c2t3d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@3,0
4. /dev/rdsk/c2t5d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@5,0
Specify disk (enter its number):
The following example identifies the disks on a SPARC based system.
# format
AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/
sd@3,0
Specify disk (enter its number):
The format output identifies that disk 0 (target 3) is connected to the first SCSI host
adapter (espdma@...), which is connected to the first SBus device (sbus@0...).
The output also associates both the physical and logical device name to the disk’s
marketing name, SUN02.1G.
The following example identifies the disks on an IA 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 format output identifies that disk 0 is connected to the first PCI host adapter
(pci-ide@7...), which is connected to the ATA device (ata...). The format
output on an IA based system does not identify disks by their marketing names.
Where to Go From Here
Check the following table if the format utility did not recognize the disk.
340
If the Disk ...
Then ...
Is newly added and you didn’t perform a
Go to Chapter 30 or Chapter 31.
reconfiguration boot
Is a third-party disk
Go to “Creating a format.dat Entry”
on page 353.
Label was corrupted by a system problem, such as Go to “How to Label a Disk” on page
a power failure
346.
Is not properly connected to the system
Connect the disk to the system using
your disk hardware documentation.
Formatting a Disk
Disks are formatted by the manufacturer or reseller and usually do not need to be
reformatted when you install the drive.
A disk must be formatted before:
You can write data to it. However, most disks are already formatted.
You can use the Solaris installation program to install the system.
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.
How to Determine if a Disk is Formatted
1. Become superuser.
2. Enter the format utility.
# format
3. Enter the number of the disk that you want to check from the list displayed on
your screen.
Specify disk (enter its number): 0
Administering Disks (Tasks)
341
4. Verify that the disk you chose is formatted by identifying the following
message.
[disk formatted]
Example—Determining if a Disk Is Formatted
The following example shows that disk c0t3d0 is formatted.
# format
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 c0t1d0
[disk formatted]
How to Format a Disk
1. Become superuser.
2. Enter the format utility.
# format
3. Enter the number of the disk that you want to format from the list displayed
on your screen.
Specify disk (enter its number): 0
Warning - Do not select the system disk. Formatting your system disk deletes your
operating system and any data that you might have on this disk.
4. To begin formatting the disk, enter format at the format> prompt. Confirm
the command by typing y.
342
format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes
5. Verify that the disk format is successful by identifying 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.
Example—Formatting a Disk
The following example formats the disk c0t3d0.
# format
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):1
Selecting c0t3d0
[disk formatted]
format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes
Beginning format. The current time is Wed Jul 14 10:03:34 1999
Formatting ...
done
Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18
(continued)
Administering Disks (Tasks)
343
(Continuation)
pass 1 - pattern = 0x6db6db6d
2035/12/18
Total of 0 defective blocks repaired.
format>
Displaying Disk Slices
You can use the format utility to check whether or not 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. See “SPARC: How to
Create Disk Slices and Label a Disk” on page 367 or “IA: How to Create Disk Slices
and Label a Disk” on page 386 for information on creating disk slices.
Note - The format utility uses the term partition in place of slice.
How to Display Disk Slice Information
1. Become superuser.
2. Enter the format utility.
# format
3. Identify the disk for which you want to display slice information by selecting a
disk listed under AVAILABLE DISK SELECTIONS.
Specify disk (enter its number):1
4. Enter the partition menu by typing partition at the format> prompt.
format> partition
5. Display the slice information for the current disk drive by typing print at the
partition> prompt.
344
partition> print
6. Exit the format utility by typing q at the partition> prompt and typing q at
the format> prompt.
partition> q
format> q
#
7. Verify 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.
Examples—Displaying Disk Slice Information
The following example displays slice information for disk /dev/dsk/c0t3d0.
# format
Searching for disks...done
Specify disk (enter its number):1
Selecting c0t3d0
format> partition
partition> print
Current partition table (original):
Total disk cylinders available: 2036 + 2 (reserved cylinders)
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
partition> q
format> q
#
See Chapter 28 for a detailed description of the slice information displayed in these
examples.
The following example displays the slice information on disk /dev/dsk/c0t0d0.
Administering Disks (Tasks)
345
# format
Searching for disks...done
Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]
format> partition
partition> print
Current partition table (original):
Total disk cylinders available: 817 + 2 (reserved cylinders)
Part
Tag
Flag
Cylinders
Size
Blocks
0 unassigned
wm
3 - 816
6.26GB
(814/0/0) 13128192
1 unassigned
wm
0
0
(0/0/0)
0
2
backup
wm
0 - 816
6.28GB
(817/0/0) 13176576
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 unassigned
wm
0
0
(0/0/0)
0
8
boot
wu
0 -
0
7.88MB
(1/0/0)
16128
9 alternates
wu
1 -
2
15.75MB
(2/0/0)
32256
partition> q
format> q
Creating and Examining a Disk Label
Labeling 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 is corrupted (for
example, from a power failure).
The format utility will attempt to automatically configure any unlabeled SCSI disk. If
format is able to automatically configure an unlabeled disk, it will display a message
like the following:
c1t0d0:configured with capacity of 404.65MB
How to Label a Disk
1. Become superuser.
2. Enter the format utility.
# format
346
3. Enter the number of the disk that you want to label from the list displayed on
your screen.
Specify disk (enter its number):1
4. Use the table below to determine how to label the disk.
If the Disk Was Labeled and You Want to
If the Disk Is Unlabeled and Was
Change the Type, or Format Was Not Able
Successfully Configured ...
to Automatically Configure the Disk ...
Format will ask if you want to label the
You must specify the disk type. Go to steps
disk. Go to step 5 to label the disk.
6-7 to set the disk type and label the disk.
5. 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.
6. Enter type at the format> prompt.
format> type
Format displays the Available Drive Types menu.
7. Select a disk type from the list of possible disk types.
Specify disk type (enter its number)[12]: 12
8. 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
9. Use the verify command from the format main menu to verify the disk label.
format> verify
Administering Disks (Tasks)
347
10. Exit the format utility by typing q at the format> prompt.
partition> q
format> q
#
Example—Labeling a Disk
The following example automatically configures and labels a 1.05-Gbyte 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
#
How to Examine a Disk Label
Examine disk label information by using the prtvtoc(1M) command. See Chapter
28 for a detailed description of the disk label and the information displayed by the
prtvtoc command.
1. Become superuser.
2. Display the disk label information by using the prtvtoc command.
# prtvtoc /dev/rdsk/device-name
Raw disk device you want to examine.
device-name
348
Example—Examining a Disk Label
The following example shows the disk label information for disk /dev/rdsk/
c0t1d0s0.
# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
* Dimensions:
512 bytes/sector
72 sectors/track
14 tracks/cylinder
1008 sectors/cylinder
2038 cylinders
2036 accessible cylinders
* Flags:
1: unmountable
10: read-only
First
Sector
Last
* Partition Tag Flags
Sector
Count
Sector Mount Directory
0
2
00
0
303408
303407
/
1
3
01
303408
225792
529199
2
5
00
0
2052288
2052287
6
4
00
529200
1523088
2052287
/usr
#
Recovering a Corrupted Disk Label
Sometimes a power or system failure will cause a disk’s label to become
unrecognizable. This doesn’t always mean that the slice information or the disk’s
data will have to be recreated or restored.
The first step to recovering a corrupted disk label is to label the disk with the correct
geometry and disk type information. This can be done through the normal disk
labeling method, either automatic configuration or manual disk type specification.
If format 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 will label the disk with the
correct partitioning information, the disk type, and disk geometry.
How to Recover a Corrupted Disk Label
1. Boot the system to single-user mode. If necessary, boot the system from a local
CD-ROM or the network in single-user mode to access the disk.
See Chapter 10 or Chapter 11 for information on booting the system.
Administering Disks (Tasks)
349
2. Use the format utility to relabel the disk.
# format
At this point, format attempts to automatically configure any unlabeled SCSI
disk. If format is able to configure the unlabeled and corrupted disk, it will
display:
cwtxdy: configured with capacity of abcMB
The format utility then displays the list of disks on the system.
3. Enter the number of the disk that you need to recover from the list displayed
on your screen.
Specify disk (enter its number): 1
4. Use the table below to determine how to label the disk.
If the Disk was Successfully Configured
If the Disk was not Successfully
Configured ...
Follow steps 5 and 6. Then go to step 12.
Follow steps 7-11. Then go to step 12.
5. Search for the backup label by using the verify command.
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
(continued)
350
(Continuation)
6
usr
wm
525 - 2035
743.70MB
(1511/0/0) 1523088
7 unassigned
wm
0
0
(0/0/0)
0
6. If format 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.
7. If format was not able to automatically configure the disk, specify the disk
type using the type command.
format> type
The format utility displays the Available Drives Type menu.
8. 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
9. If the disk was successfully configured, reply with no when format asks if
you want to label the disk.
Disk not labeled. Label it now? no
10. Use the verify command to search for backup labels.
Administering Disks (Tasks)
351
format> verify
Warning: Could not read primary label.
Warning: Check the current partitioning and ’label’ the disk
or use the ’backup’ command.
11. If format 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.
12. Exit the format utility by typing q.
format> q
13. Verify the file systems on the recovered disk by using the fsck command.
See Chapter 39 for information about using the fsck command.
Adding a Third-Party Disk
The Solaris environment supports many third-party disks. However, you might need
to supply either a device driver, a format.dat entry, or both of these.
If the third-party disk was designed to work with standard SunOS operating
system-compatible device drivers, creating an appropriate format.dat entry should
be enough to allow the disk to be recognized by the format utility. In other cases,
you’ll need to load a third-party device driver to support the disk.
352
Note - 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 format program.
This section discusses what to do if some of this software support is missing.
Typically, this occurs when you invoke the format utility and find that the disk type
is not recognized.
Supply the missing software as described in this section, and then refer to the
appropriate configuration procedure for adding system disks or secondary disks in
Chapter 30 or Chapter 31.
Creating a format.dat Entry
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.
Note - SCSI-2 drives do not require a format.dat entry. Starting with the Solaris
2.3 release, the format utility automatically configures the SCSI-2 drivers if the
drives are powered on during a reconfiguration boot. See “How to Automatically
Configure a SCSI Drive” on page 355 for step-by-step instructions on configuring a
SCSI disk drive automatically.
If your disk was not recognized, use a text editor to create an entry in format.dat
for the disk. You’ll 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. See Chapter 32
for more information on adding an entry to the /etc/format.dat file.
How to Create a format.dat Entry
1. Become superuser.
2. Make a copy of the /etc/format.dat file.
# cp /etc/format.dat /etc/format.dat.gen
3. Modify the /etc/format.dat file to include an entry for the third-party disk
using the format.dat information described in Chapter 32.
Use the disk’s hardware product documentation to gather the required
information.
Administering Disks (Tasks)
353
Automatically Configuring SCSI Disk
Drives
In Solaris 2.3 release and compatible versions, 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, slice, and label any disk
driver compliant with SCSI-2 specification for disk device mode sense pages.
The following steps are involved in configuring a SCSI drive using autoconfiguration:
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. See “How to Automatically Configure a SCSI Drive” on page 355 for
step-by-step instructions on configuring a SCSI disk drive automatically.
Here are the default slice rules that format uses to create the partition table.
TABLE 29-2
SCSI Disk Slice Rules
Disk Size
Root File System
Swap Slice
0 - 180 Mbytes
16 Mbytes
16 Mbytes
180 Mbytes - 280 Mbytes
16 Mbytes
32 Mbytes
280 Mbytes - 380 Mbytes
24 Mbytes
32 Mbytes
380 Mbytes - 600 Mbytes
32 Mbytes
32 Mbytes
600 Mbytes - 1.0 Gbytes
32 Mbytes
64 Mbytes
1.0 Gbytes - 2.0 Gbytes
64 Mbytes
128 Mbytes
More than 2.0 Gbytes
128 Mbytes
128 Mbytes
In all cases, slice 6 (for the /usr file system) gets the remainder of the space on the
disk.
354
Here’s an example of a format-generated partition table for a 1.3-Gbyte SCSI disk
drive.
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)
See Chapter 32 for more information about using SCSI automatic configuration.
How to Automatically Configure a SCSI Drive
1.
Become superuser.
2.
Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
3.
Shut down the system.
# shutdown -i0 -g30 -y
Brings the system down to init state 0 (zero), the power-down state.
i0
Notifies logged-in users that they have n seconds before the system
g30
begins to shut down.
Specifies the command should run without user intervention.
y
The ok or > prompt is displayed after the operating environment is shut down.
4.
Turn off power to the system and all external peripheral devices.
5.
Make sure the disk you are adding has a different target number than the other
devices on the system.
You will often find a small switch located at the back of the disk for this purpose.
6.
Connect the disk to the system and check the physical connections.
Refer to the disk’s hardware installation guide for installation details.
Administering Disks (Tasks)
355
7. Turn on the power to all external peripherals.
8. Turn on the power to the system.
The system will boot and display the login prompt.
9. Login as superuser, invoke the format utility, and select the disk to be
configured 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
10. Reply yes to the prompt to label the disk.
Replying y will cause the disk label to be generated and written to the disk by
the autoconfiguration feature.
Disk not labeled. Label it now? y
11. Verify the disk label with the verify command.
format> verify
12. Exit the format utility.
format> q
356
Repairing a Defective Sector
If a disk on your system has a defective sector, you can repair it by using the
instructions in the following procedures. You might become aware of defective
sectors when you:
Run surface analysis on a disk.
See “The analyze Menu” on page 396 for more information on the analysis
functionality of the format utility.
The defective area reported while your system is running might not be accurate.
Since the system does disk operations many sectors at a time, it is often hard to
pinpoint exactly which sector caused a given error. Use “How to Identify a
Defective Sector by Using Surface Analysis” on page 357 to find the exact sector(s).
Get multiple error messages from the disk driver concerning a particular portion
of the disk while your system is running.
Messages related to disk errors look like 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
The above console message indicates that block 179 might be bad. Relocate the
bad block by using the format utility’s repair command or use the analyze
command with the repair option enabled.
How to Identify a Defective Sector by Using
Surface Analysis
1. Become superuser.
2. Unmount the file system in the slice that contains the defective sector.
See mount(1M) for more information.
# umount /dev/dsk/device-name
3. Enter the format utility by typing format.
# format
Administering Disks (Tasks)
357
4. Select the affected disk.
Specify disk (enter its number):1
selecting c0t2d0:
[disk formatted]
Warning: Current Disk has mounted partitions.
5. Enter the analyze menu by typing analyze at the format> prompt.
format> analyze
6. 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
7. Use the read command to find the defect.
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
(continued)
358
(Continuation)
Total of 1 defective blocks repaired.
How to Repair a Defective Sector
1. Become superuser.
2. Enter the format utility and select the disk that contains the defective sector.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t2d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@2,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
selecting c0t3d0
[disk formatted]
format>
3. Enter the repair command at the format> prompt.
format> repair
4. Enter 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 used to identify the defective sector, see “How to
Identify a Defective Sector by Using Surface Analysis” on page 357 for more
information.
Administering Disks (Tasks)
359
Tips and Tricks for Managing Disks
Use the following tips to help you manage disks more efficiently.
Debugging format Sessions
Invoke format -M to enable extended and diagnostic messages for using the
format utility with SCSI devices only.
In this example, the series of numbers below Inquiry: represent the hexadecimal
value of the inquiry data 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>
Label Multiple Disks by Using the prtvtoc and
fmthard Commands
Use the prtvtoc and fmthard commands to label multiple disks with the same
disk geometry.
360
Use this 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
Example—Labeling Multiple Disks
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.
#
Administering Disks (Tasks)
361
362
CHAPTER
30
SPARC: Adding a Disk (Tasks)
This chapter provides the procedures for adding a disk to a SPARC based system.
This is a list of the step-by-step instructions in this chapter.
“SPARC: How to Connect a System Disk and Boot” on page 365
“SPARC: How to Connect a Secondary Disk and Boot” on page 365
“SPARC: How to Create Disk Slices and Label a Disk” on page 367
“SPARC: How to Create File Systems” on page 371
“SPARC: How to Install a Boot Block on a System Disk” on page 372
For overview information about disk management, see Chapter 28. For step-by-step
instructions on adding a disk to an IA based system, see Chapter 31.
SPARC: About System and Secondary
Disks
A system disk contains the root (/) or /usr file systems, or both. If the disk
containing either of these file systems becomes damaged, you have two ways to
recover:
You can reinstall the entire Solaris environment.
Or, you can replace the system disk and restore your file systems from a backup
medium.
A secondary disk doesn’t contain the root (/) and /usr file systems. It usually
contains space for user files. You can add a secondary disk to a system for more disk
363
space or you can replace a damaged secondary disk. If you replace a secondary disk
on a system, you can restore the old disk’s data on the new disk.
SPARC: Adding a System or Secondary
Disk Task Map
TABLE 30-1
SPARC: Adding a System or Secondary Disk Task Map
Task
Description
For Instructions, Go To
1. Connect the Disk and Boot
System Disk
“SPARC: How to Connect a
System Disk and Boot” on page
Connect the new disk and boot from a local
365
or remote Solaris CD.
Secondary Disk
“SPARC: How to Connect a
Secondary Disk and Boot” on
Connect the new disk and perform a
page 365
reconfiguration boot, so the system will
recognize the disk.
2. Create Slices and Label
Create disk slices and label the disk if it has
“SPARC: How to Create Disk
the Disk
not already been done by the disk
Slices and Label a Disk” on
manufacturer.
page 367
3. Create File Systems
Create UFS file systems on the disk slices
“SPARC: How to Create File
with the newfs command. You must create
Systems” on page 371
the root (/) or /usr file system (or both) for
a system disk.
4. Restore File Systems
Restore the root (/) or /usr file system (or
Chapter 44
both) on the system disk. If necessary, restore
file systems on the secondary disk.
5. Install Boot Block
System Disk Only. Install the boot block on the
“SPARC: How to Install a Boot
root (/) file system, so the system can boot.
Block on a System Disk” on
page 372
364

 

 

 

 

 

 

 

Content      ..     9      10      11      12     ..