返回列表 发帖

SUN solaris 系统管理指南SPARC:添加磁盘

SPARC: 添加系统磁盘或辅助磁盘
系统磁盘包含根 (/) 文件系统和/或 /usr 文件系统。如果包含其中任一文件系统的磁盘损坏,则可以使用以下两种方法恢复文件系统:

  • 断开损坏的系统磁盘与系统之间的连接。

  • 确保所添加的磁盘与系统中的其他设备具有不同的目标号码。
    通常,磁盘背面有一个用于此目的的小开关。

  • 将用来替换的系统磁盘连接到系统,并检查物理连接。
    有关详细信息,请参阅磁盘的硬件安装指南。

  • 根据从本地 Solaris CD 或 DVD 还是从网络中的远程 Solaris CD 或 DVD 引导,按照下表中的说明进行操作。  
    引导类型
    操作

    从本地驱动器中的 Solaris CD 或 DVD
    1. 确保 Solaris 软件 1 CD 或 Solaris DVD 位于驱动器中。
    2. 从介质引导到单用户模式:
    ok boot cdrom -s

    从网络
    从网络引导到单用户模式:
    ok boot net -s


    几分钟后,将显示超级用户提示符 (#)。

连接系统磁盘并进行引导后...
引导系统后,可以在磁盘上创建片和磁盘标号。请转至SPARC: 如何创建磁盘片和标记磁盘

SPARC: 如何连接辅助磁盘并进行引导
如果要添加磁盘标号为 EFI 的磁盘,请参见带有 EFI 磁盘标号的多 TB 磁盘支持以了解更多信息。
通常,大多数新式总线类型支持热插拔。如果系统的总线类型支持热插拔,则可能无需执行下面的步骤 2 或 3。
有关热插拔设备的更多信息,请参见第 6 章,动态配置设备(任务)如何创建 format.dat 项(如有必要)。
(可选的)创建将在引导系统时读取的 /reconfigure 文件。

# touch /reconfigure

稍后打开系统电源或引导系统时,/reconfigure 文件会使 SunOSTM 软件检查是否存在任何新安装的外围设备。
关闭系统。

# shutdown -i0 -gn -y



SPARC: 如何创建磁盘片和标记磁盘
  • 成为超级用户或承担等效角色。
  • 调用 format 实用程序。

    # format

    将显示可用磁盘的编号列表。有关更多信息,请参见 format(1M)
  • 键入要重新分区的磁盘的编号。

    Specify disk (enter its number): disk-number

    disk-number 是要重新分区的磁盘的编号。
  • 选择 partition 菜单。

    format> partition
  • 显示当前分区(片)表。

    partition> print
  • 开始修改过程。

    partition> modify
  • 将磁盘全部设置为浮动片 (free hog slice)。

    Choose base (enter number) [0]?1

    有关浮动片 (free hog slice) 的更多信息,请参见使用浮动片 (free hog slice)
  • 通过在提示您继续时应答 y 创建新分区表。

    Do you wish to continue creating a new partition table based on above table[yes]? y
  • 出现提示时,标识浮动 (free hog) 分区(片)和片大小。
    添加系统磁盘时,必须为以下项设置片:示例 13–1

  • 通过在提示时应答 y,使显示的分区表成为当前分区表。

    Okay to make this the current partition table[yes]? y

    如果不需要当前分区表但希望对其进行更改,请应答 no 并转至步骤 6

  • 命名分区表。

    Enter table name (remember quotes): "partition-name"

    其中 partition-name 是新分区表的名称。

  • 在新磁盘上完成片的分配后,用新分区表标记磁盘。

    Ready to label disk, continue? yes

  • 退出 partition 菜单。

    partition> q

  • 验证磁盘标号。

    format> verify

  • 退出 format 实用程序。

    format> q

示例 13–1 SPARC: 创建磁盘片和标记系统磁盘

以下示例说明如何使用 format 实用程序将 18 GB 的磁盘分成三个片:其中一个片用于根 (/) 文件系统,一个片用于交换区域,还有一个片用于 /usr 文件系统。

# format
AVAILABLE DISK SELECTIONS:
       0. /dev/rdsk/c1t0d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@0,0[/url]
       1. /dev/rdsk/c1t1d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@1,0[/url]
       2. /dev/rdsk/c1t8d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@8,0[/url]
       3. /dev/rdsk/c1t9d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@9,0[/url]
Specify disk (enter its number): 0
selecting c1t0d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
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 - 7505       16.86GB    (7506/0/0) 35368272
  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

Choose base (enter number) [0]? 1
table based on above table[yes]? yes
Free Hog partition[6]? 6
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 4gb
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 4gb
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 '7' [0b, 0c, 0.00mb, 0.00gb]:
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 - 1780        4.00GB    (1781/0/0)  8392072
  1       swap    wu    1781 - 3561        4.00GB    (1781/0/0)  8392072
  2     backup    wu       0 - 7505       16.86GB    (7506/0/0) 35368272
  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    3562 - 7505        8.86GB    (3944/0/0) 18584128
  7 unassigned    wm       0               0         (0/0/0)           0

Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "disk0"
Ready to label disk, continue? yes
partition> quit
format> verify
format> quit


示例 13–2 SPARC: 创建磁盘片和标记辅助磁盘

以下示例说明如何使用 format 实用程序将一个 18 GB 的磁盘分成用于 /export/home 文件系统的一个片。

# format /dev/rdsk/c1*
AVAILABLE DISK SELECTIONS:
       0. /dev/rdsk/c1t0d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@0,0[/url]
       1. /dev/rdsk/c1t1d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@1,0[/url]
       2. /dev/rdsk/c1t8d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@8,0[/url]
       3. /dev/rdsk/c1t9d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          [url=]/sbus@2,0/QLGC,isp@2,10000/sd@9,0[/url]
Specify disk (enter its number): 1
selecting c1t1d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
0. Current partition table (original)
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 - 7505       16.86GB    (7506/0/0) 35368272
  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

Do you wish to continue creating a new partition
table based on above table[yes]? y
Free Hog partition[6]? 7
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]:
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]:
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 - 7505       16.86GB    (7506/0/0) 35368272
  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 - 7505       16.86GB    (7506/0/0) 35368272
Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "home"
Ready to label disk, continue? y
partition> q
format> verify
format> q
#

以下示例说明如何使用 format 实用程序,将标号为 EFI 的 1.15 TB 磁盘分成三个片。

# format
.
.
.
partition> modify
Select partitioning base:
        0. Current partition table (original)
        1. All Free Hog
Choose base (enter number) [0]? 1
Part      Tag    Flag     First Sector          Size          Last Sector
  0       root    wm                 0            0                0   
  1        usr    wm                 0            0                0   
  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                 0            0                0   
  8   reserved    wm        2576924638         8.00MB           2576941021
Do you wish to continue creating a new partition
table based on above table[yes]? y
Free Hog partition[6]? 4
Enter size of partition 0 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 1 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 2 [0b, 34e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 3 [0b, 838860834e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 5 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Enter size of partition 6 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Part      Tag    Flag     First Sector          Size          Last Sector
  0 unassigned    wm                 0            0                0   
  1 unassigned    wm                 0            0                0   
  2        usr    wm                34       400.00GB           838860833
  3        usr    wm         838860834       400.00GB           1677721633
  4        usr    wm        1677721634       428.77GB           2576924637
  5 unassigned    wm                 0            0                0   
  6 unassigned    wm                 0            0                0   
  8   reserved    wm        2576924638         8.00MB           2576941021
Ready to label disk, continue? yes

partition> q




创建磁盘片和标记磁盘之后
创建磁盘片并标记磁盘后,可以在磁盘上创建文件系统。请转至SPARC: 如何创建 UFS 文件系统

SPARC: 如何创建 UFS 文件系统

  • 成为超级用户或承担等效角色。

  • 为每个片创建文件系统。

    # newfs /dev/rdsk/cwtxdysz

    其中 /dev/rdsk/cwtxdysx 是要创建的文件系统的原始设备。
    有关 newfs 命令的更多信息,请参见第 18 章,创建 UFS、TMPFS 和 LOFS 文件系统(任务)newfs(1M)

  • 通过挂载新文件系统对其进行验证。

    # mount /dev/dsk/cwtxdysz /mnt# ls lost+found
创建 UFS 文件系统之后

辅助磁盘-可能需要在新磁盘上恢复文件系统。请转至第 27 章,恢复文件和文件系统(任务)。如果不在新磁盘上恢复文件系统,则完成了辅助磁盘的添加。
有关使文件系统可被用户使用的信息,请参见第 19 章,挂载和取消挂载文件系统(任务)

SPARC: 如何在系统磁盘上安装引导块

  • 成为超级用户或承担等效角色。

  • 在系统磁盘上安装引导块。

    # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk/dev/rdsk/cwtxdys0
    installboot(1M)

  • 通过将系统重新引导到运行级 3,验证是否已安装引导块。

    # init 6

示例 13–3 SPARC: 在系统磁盘上安装引导块

以下示例说明如何在 UltraTM 10 系统中安装引导块。

# installboot /usr/platform/sun4u/lib/fs/ufs/bootblk/dev/rdsk/c0t0d0s0

返回列表