系统管理指南:设备和文件系统

管理磁盘的提示和技巧

使用以下提示可帮助您更有效地管理磁盘。

调试 format 会话

调用 format -M 命令为 ATA 和 SCSI 设备启用扩展消息和诊断消息。


示例 12–8 调试 format 会话

在此示例中,Inquiry 下的数字系列表示在数字右侧显示的 inquiry 数据的十六进制值。


# 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> 

使用 prtvtocfmthard 命令标记多个磁盘

使用 prtvtocfmthard 命令标记具有相同磁盘几何参数的多个磁盘。

在脚本中使用以下 for 循环,从一个磁盘复制磁盘标号,然后在多个磁盘上复制它。


# for i in x y z

> do

> prtvtoc /dev/rdsk/cwtxdysz | fmthard -s - /dev/rdsk/cwt${i}d0s2

> done

示例 12–9 标记多个磁盘

在此示例中,将来自 c2t0d0s0 的磁盘标号复制到其他四个磁盘。


# 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.

#