在 Oracle® Solaris 11.2 中管理设备

退出打印视图

更新时间: 2014 年 7 月
 
 

如何恢复损坏的磁盘标签

  1. 将系统引导到单用户模式。

    从本地 Oracle Solaris DVD 或网络引导,并访问磁盘。

    有关引导系统的信息,请参见引导和关闭 Oracle Solaris 11.2 系统

  2. 启动 Format 实用程序。
    # format
  3. 键入需要恢复的磁盘的编号。
    Specify disk (enter its number):

    如果此实用程序能够配置所选磁盘,则会显示以下消息:

    disk: configured with capacity of size
  4. 选择以下内容之一以确定如何为磁盘设置标签。
    • 如果磁盘已成功配置,请执行以下操作:
      1. format > 提示符下,键入 verify

        验证过程包括搜索磁盘的备份标签。

      2. 确保检索到的备份标签的内容符合要求。
      3. format > 提示符下,键入 backup 以应用标签。
      4. 出现提示时,确认运行该命令。
    • 如果磁盘成功配置,请执行以下操作:
      1. 在 Format 菜单的 format > 提示符下,键入 type

        将显示 "Available Drive Types" 菜单。

      2. 键入与磁盘类型对应的编号。
      3. 出现继续执行磁盘标签设置过程的提示时,键入 no
      4. format > 提示符下,键入 verify

        验证过程包括搜索磁盘的备份标签。

      5. 确保检索到的备份标签的内容符合要求。
      6. format > 提示符下,键入 backup 以应用标签。
      7. 出现提示时,确认运行该命令。
  5. 恢复标签后,退出 Format 实用程序。
  6. 验证已恢复磁盘上的文件系统。

    有关对 ZFS 文件系统使用 zpool scrub 命令的信息,请参见 zpool(1M) 手册页。

示例 6-18  恢复自动配置的磁盘的标签

本示例假定您已选择要恢复其标签的磁盘。

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  = <FUJITSU-MAP3147N SUN146G-0501>
pcyl        = 14089
ncyl        = 14087
acyl        =    2
nhead       =   24
nsect       =  848
Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       0 - 14086      136.71GB    (14087/0/0) 286698624
1       swap    wu       0                0         (0/0/0)             0
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       0                0         (0/0/0)             0
7 unassigned    wm       0                0         (0/0/0)             0

检索到备份标签后,确保其内容满足要求,然后继续应用标签。

format> backup
Disk has a primary label, still continue? y

Searching for backup labels...found.
Restoring primary label

format> q
示例 6-19  恢复不可自动配置的磁盘的标签

本示例假定您已选择要恢复其标签的磁盘。

format> type
Specify disk type (enter its number)[12]: 12
Disk not labeled.  Label it now?  no

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  = <FUJITSU-MAP3147N SUN146G-0501>
pcyl        = 14089
ncyl        = 14087
acyl        =    2
nhead       =   24
nsect       =  848
Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       0 - 14086      136.71GB    (14087/0/0) 286698624
1       swap    wu       0                0         (0/0/0)             0
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       0                0         (0/0/0)             0
7 unassigned    wm       0                0         (0/0/0)             0

检索到备份标签后,确保其内容满足要求,然后继续应用标签。

format> backup
Disk has a primary label, still continue? y
Searching for backup labels...found.
Restoring primary label

format> q