Sun Cluster 3.0 安装指南

如何镜像根 (/) 文件系统

使用此过程镜像根 (/) 文件系统。

  1. 成为群集节点上的超级用户。

  2. 使用 metainit(1M) 命令将根片处于单片(单向)并置状态。


    # metainit -f submirror1 1 1 root-disk-slice
    
  3. 创建第二个并置。


    # metainit -f submirror2 1 1 submirror-disk-slice
    
  4. 创建包含一个子镜像的单向镜像。


    注意:

    镜像的元设备名称在整个群集中必须是唯一的。



    # metainit mirror -m submirror1
    
  5. 运行 metaroot(1M) 命令。

    该命令编辑 /etc/vfstab 文件 和 /etc/system 文件,以便系统可以通过元设备上的 根 (/) 文件系统来引导。


    # metaroot mirror
    
  6. 运行 lockfs(1M) 命令。

    该命令将所有事务从日志中刷新出来,并将这些事务写入到所有已安装的 UFS 文件系统的 主文件系统中。


    # lockfs -fa
    
  7. 从节点中抽出所有资源组或设备组。


    # scswitch -S -h node
    
    -S

    抽出所有资源组和设备组

    -h node

    指定从中抽出资源组或设备组的节点的名称

  8. 重新引导节点。


    # shutdown -g 0 -y -i 6
    
  9. 使用 metattach(1M) 命令将第二个子镜像与镜像连接。


    # metattach mirror submirror2
    
  10. 如果用于镜像根磁盘的磁盘物理连接到多个节点(多端口连接),请启用 用于镜像根磁盘的磁盘的原始磁盘设备组的 localonly 特性。

    如果引导设备与多个节点连接,则必须启用 localonly 特性以 防止无意中使节点与其引导设备隔离。

    1. 如有必要,可使用 scdidadm -L 命令显示原始 磁盘设备组的完整设备标识 (DID) 伪驱动程序名称。

      在下面的示例中,原始磁盘设备组名称 dsk/d2 是输出的第三列的一部 分,这一列就是完整的 DID 伪驱动程序名称。


      # scdidadm -L
      ...
      1         phys-schost-3:/dev/rdsk/c1t1d0     /dev/did/rdsk/d2
      # scconf -c -D name=dsk/d2,localonly=true
      

      有关 localonly 特性的详细信息,请参 阅 scconf_dg_rawdisk(1M) 手册页。

    2. 使用 scconf(1M) 命令启用 localonly 特性。


      # scconf -c -D name=rawdisk_groupname,localonly=true
      
      -D name=rawdisk_groupname

      指定原始磁盘设备组的名称

  11. 记录备用引导路径,以备将来可能用到。


    # ls -l /dev/rdsk/root-disk-slice
    
  12. 在群集中每个仍运行的节点上 重复步骤 1步骤 11的操作。

    确保镜像的每个元设备名称在群集中是唯一的。

示例-镜像根 (/) 文件系统

下面的示例显示 phys-schost-1 节点的 镜像 d0 的创建,该镜像由分区 c0t0d0s0 的子 镜像 d10 和分区 c2t2d0s0 的子镜 像 d20 组成。磁盘 c2t2d0 是一个多端口磁盘,所以 启用 localonly 特性。


(Create the mirror:)
# metainit -f d10 1 1 c0t0d0s0
d11: Concat/Stripe is setup
# metainit -f d20 1 1 c2t2d0s0
d12: Concat/Stripe is setup
# metainit d0 -m d10
d10: Mirror is setup
# metaroot d0
# lockfs -fa
 
(Reboot the node:)
# scswitch -S -h phys-schost-1
# shutdown -g 0 -y -i 6
 
(Attach the second submirror:)
# metattach d0 d20
d0: Submirror d20 is attached
 
(Enable the localonly property of the mirrored disk's raw disk device group:)
# scconf -c -D name=dsk/d2,localonly=true
 
(Record the alternate boot path:)
# ls -l /dev/rdsk/c2t2d0s0
lrwxrwxrwx  1 root     root          57 Apr 25 20:11 /dev/rdsk/c2t2d0s0 ->
../../devices/node@1/pci@1f,0/pci@1/scsi@3,1/disk@2,0:a,raw

从此处可转到何处

要镜像全局名称 空间 /global/.devices/node@nodeid,请 转到"如何镜像全局名称空间"