跳过导航链接 | |
退出打印视图 | |
Oracle Solaris 管理:设备和文件系统 Oracle Solaris 11 Information Library (简体中文) |
为磁盘设置标签通常是在系统安装过程中或者使用新磁盘时进行的。如果磁盘标签已损坏,则可能需要重新为磁盘设置标签。例如,磁盘标签因电源故障而损坏。
format 实用程序会尝试自动配置任何不带标签的 SCSI 磁盘。如果 format 实用程序能够自动配置不带标签的磁盘,则它将显示与以下内容类似的消息:
c2t3d0: configured with capacity of 136.73GB
可以使用接下来的过程执行以下操作:
用标签 VTOC 或 EFI 为 2 TB 大小的磁盘设置标签。
用标签 EFI 为大于 2 TB 的磁盘设置标签。
如果要用标签 EFI 为小于 2 TB 的磁盘设置标签,请参见示例 11-5。
有关更多信息,请参见《Oracle Solaris 管理:安全服务》中的"如何获取管理权限"。
# format
显示磁盘的编号列表。
Specify disk (enter its number):1
如果 format 实用程序识别该磁盘类型,则下一步是搜索备份标签以为磁盘设置标签。使用备份标签为磁盘设置标签时,会以正确的分区信息、磁盘类型和磁盘几何参数为磁盘设置标签。
如果磁盘是不带标签的但已成功配置,请转至步骤 5 为磁盘设置标签。
format 实用程序将询问您是否要为磁盘设置标签。
如果已为磁盘设置标签但您要更改磁盘类型,或者如果 format 实用程序无法自动配置磁盘,请继续执行步骤 6 设置磁盘类型并为磁盘设置标签。
Disk not labeled. Label it now? y
现在已为磁盘设置标签。转至步骤 10 以退出 format 实用程序。
format> type
将显示 "Available Drive Types"(可用的驱动器类型)菜单。
Specify disk type (enter its number)[12]: 12
或者,选择 0 自动配置 SCSI-2 磁盘。
Disk not labeled. Label it now? y
否则,将显示以下消息提示您:
Ready to label disk, continue? y
format> verify
format> q #
示例 11-4 为磁盘设置标签
# format AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107> /pci@1c,600000/scsi@2/sd@0,0 1. c0t1d0 <SEAGATE-ST336607LSUN36G-0307-33.92GB> /pci@1c,600000/scsi@2/sd@1,0 2. c0t2d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB> /pci@1c,600000/scsi@2/sd@2,0 3. c0t3d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB> /pci@1c,600000/scsi@2/sd@3,0 Specify disk (enter its number): 3 c0t3d0: configured with capacity of 33.92GB Disk not labeled. Label it now? yes format> verify format> q
示例 11-5 用标签 EFI 为磁盘设置标签
以下示例说明如何使用 format - e 命令以标签 EFI 为磁盘设置标签。请记住验证分层软件产品是否继续在包含标签 EFI 的磁盘的系统上起作用。有关 EFI 标签限制的常规信息,请参见EFI 磁盘标签限制。
# format -e Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@1c,600000/scsi@2/sd@0,0 1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@1c,600000/scsi@2/sd@1,0 2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB> /pci@1c,600000/scsi@2/sd@2,0 3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB> /pci@1c,600000/scsi@2/sd@3,0 Specify disk (enter its number): 3 selecting c2t3d0 [disk formatted] format> label [0] SMI Label [1] EFI Label Specify Label type[0]: 1 Ready to label disk, continue? yes format> quit
示例 11-6 将以 EFI 设置标签的磁盘更改为以 SMI 设置标签的磁盘
以下示例说明如何使用 format - e 命令将以 EFI 设置标签的磁盘更改为可以用于 ZFS 根池的以 SMI 设置标签的磁盘。
在 x86 系统中,首先必须将 EFI fdisk 分区更改为 Solaris 分区。例如:
# format -e select disk ... format> fdisk FORMAT MENU: disk - select a disk type - select (define) a disk type Total disk size is 17833 cylinders Cylinder size is 16065 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 EFI 0 17833 17834 100 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Edit/View extended partitions 6. Exit (update disk configuration and exit) 7. Cancel (exit without updating disk configuration) Enter Selection: 3 Specify the partition number to delete (or enter 0 to exit): 1 This will make all files and programs in this partition inaccessible (type "y" or "n"). y Enter Selection: 1 Select the partition type to create: 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI (Protective) G=EFI_SYS 0=Exit? 1 Specify the percentage of disk to use for this partition (or type "c" to specify the size in cylinders). 100 Should this become the active partition? If yes, it will be activated each time the computer is reset or turned on. Please type "y" or "n". y Enter Selection: 6 Partition 1 is now the active partition.
在 SPARC 系统中,请按照以下步骤。
# format -e Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@1c,600000/scsi@2/sd@0,0 1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@1c,600000/scsi@2/sd@1,0 2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB> /pci@1c,600000/scsi@2/sd@2,0 3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB> /pci@1c,600000/scsi@2/sd@3,0 Specify disk (enter its number): 3 selecting c2t0d0 [disk formatted] format> label [0] SMI Label [1] EFI Label Specify Label type[1]: 0 Ready to label disk, continue? yes
还应该检查缺省分区表,以确保其对于根池分片是最佳的,这表示大多数磁盘空间位于分片 0 中。请参见下面的步骤增加分片 0 的大小。
format> partition partition> print Current partition table (default): Total disk cylinders available: 14085 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 1 - 13 129.19MB (13/0/0) 264576 1 swap wu 14 - 26 129.19MB (13/0/0) 264576 2 backup wu 0 - 14086 136.71GB (14087/0/0) 286698624 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 27 - 14084 136.43GB (14058/0/0) 286108416 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 9.94MB (1/0/0) 20352 9 alternates wm 0 0 (0/0/0) 0 partition> modify Select partitioning base: 0. Current partition table (default) 1. All Free Hog Choose base (enter number) [0]? 1 Part Tag Flag Cylinders Size Blocks 0 root wm 0 0 (0/0/0) 0 1 swap wu 0 0 (0/0/0) 0 2 backup wu 0 - 14084 136.69GB (14085/0/0) 286657920 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 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 9.94MB (1/0/0) 20352 9 alternates wm 0 0 (0/0/0) 0 Do you wish to continue creating a new partition table based on above table[yes]? yes Free Hog partition[6]? 0 Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]: Part Tag Flag Cylinders Size Blocks 0 root wm 1 - 14084 136.68GB (14084/0/0) 286637568 1 swap wu 0 0 (0/0/0) 0 2 backup wu 0 - 14084 136.69GB (14085/0/0) 286657920 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 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 9.94MB (1/0/0) 20352 9 alternates wm 0 0 (0/0/0) 0 Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "c2t0d0" Ready to label disk, continue? yes partition> quit format> quit
使用 prtvtoc 命令检查磁盘标签信息。有关磁盘标签的详细说明和 prtvtoc 命令所显示的信息,请参见第 10 章。
有关更多信息,请参见《Oracle Solaris 管理:安全服务》中的"如何获取管理权限"。
# prtvtoc /dev/rdsk/device-name
其中 device-name 是要检查的原始磁盘设备。
示例 11-7 检查磁盘标签
# prtvtoc /dev/rdsk/c2t3d0s0 * /dev/rdsk/c2t3d0s0 partition map * * Dimensions: * 512 bytes/sector * 848 sectors/track * 24 tracks/cylinder * 20352 sectors/cylinder * 14089 cylinders * 14087 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 0 286698624 286698623 2 5 01 0 286698624 286698623
以下示例说明标签为 EFI 的磁盘的磁盘标签信息。
# prtvtoc /dev/rdsk/c2t3d0s0 * /dev/rdsk/c2t3d0s0 partition map * * Dimensions: * 512 bytes/sector * 848 sectors/track * 24 tracks/cylinder * 20352 sectors/cylinder * 14089 cylinders * 14087 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 0 286698624 286698623 2 5 01 0 286698624 286698623