Sun Cluster 软件安装指南(适用于 Solaris OS)

Procedure如何镜像无法卸载的文件系统

使用该过程可以镜像无法卸载的用户定义文件系统。在此过程中,不需要重新引导节点。


注 –

此过程提供了 Sun Cluster 命令的完整形式。此外,大多数命令还有简短格式。除了命令名称的形式以外,简写形式和完整形式的命令是相同的。有关命令及其简称的列表,请参见《Sun Cluster 系统管理指南(适用于 Solaris OS)》中的附录 B “Sun Cluster 面向对象的命令”


  1. 成为超级用户。

  2. 卸载要镜像的文件系统。

    确保文件系统中没有正在运行的进程。


    phys-schost# umount /mount-point
    

    有关更多信息,请参见 umount(1M) 手册页以及《系统管理指南:设备和文件系统》中的第 19  章 “挂载和取消挂载文件系统(任务)”

  3. 使包含可以卸载的用户定义的文件系统的分片处于单片(单向)串联状态。

    指定磁盘分片的物理磁盘名称 (cNtX dYsZ)。


    phys-schost# metainit -f submirror1 1 1 diskslice
    
  4. 创建第二个串联。


    phys-schost# metainit submirror2 1 1 submirror-diskslice
    
  5. 创建具有一个子镜像的单向镜像。


    phys-schost# metainit mirror -m submirror1
    

    注 –

    此镜像的卷名称在整个群集中不必是唯一的。


  6. 对要镜像的每个可挂载的文件系统,重复执行步骤 1步骤 5

  7. 在每个节点上,为已镜像的每个文件系统编辑 /etc/vfstab 文件条目。

    请将 device to mountdevice to fsck 列中的名称替换为镜像名称。


    phys-schost# vi /etc/vfstab
    #device        device        mount    FS     fsck    mount    mount
    #to mount      to fsck       point    type   pass    at boot  options
    #
    /dev/md/dsk/mirror /dev/md/rdsk/mirror /filesystem ufs 2 no global
  8. 将第二个子镜像与镜像连接。

    这一连接操作会启动子镜像的同步。


    phys-schost# metattach mirror submirror2
    
  9. 等待在步骤 8 中启动的镜像同步完成。

    请使用 metastat(1M) 命令查看镜像状态。


    phys-schost# metastat mirror
    
  10. 如果用于镜像用户定义文件系统的磁盘物理连接到多个节点(多主机),请对该磁盘禁用隔离功能。

    如果引导设备与多个节点连接,则对某个设备禁用隔离功能可以防止意外地将节点与其引导设备隔离。


    phys-schost# cldevice set -p default_fencing=nofencing submirror-disk
    
    -p

    指定一个设备属性。

    default_fencing=nofencing

    对指定的设备禁用隔离功能。

    有关 default_fencing 属性的更多信息,请参见 cldevice(1CL) 手册页。

  11. 安装已镜像的文件系统。


    phys-schost# mount /mount-point
    

    有关更多信息,请参见 mount(1M) 手册页以及《系统管理指南:设备和文件系统》中的第 19  章 “挂载和取消挂载文件系统(任务)”


示例 4–5 镜像可以卸装的文件系统

以下示例显示了如何创建镜像 d4 以镜像驻留在 c0t0d0s4 上的 /export。镜像 d4 由分区 c0t0d0s4 上的子镜像 d14 和分区 c2t2d0s4 上的子镜像 d24 组成。/export/etc/vfstab 文件条目被更新为使用镜像名称 d4。设备 c2t2d0 是多主机磁盘,因此隔离功能处于禁用状态。


phys-schost# umount /export
phys-schost# metainit -f d14 1 1 c0t0d0s4
d14: Concat/Stripe is setup
phys-schost# metainit d24 1 1 c2t2d0s4
d24: Concat/Stripe is setup
phys-schost# metainit d4 -m d14
d4: Mirror is setup
phys-schost# vi /etc/vfstab
#device        device        mount    FS     fsck    mount    mount
#to mount      to fsck       point    type   pass    at boot  options
#
# /dev/md/dsk/d4 /dev/md/rdsk/d4 /export ufs 2 no    global
phys-schost# metattach d4 d24
d4: Submirror d24 is attached
phys-schost# metastat d4
d4: Mirror
       Submirror 0: d14
          State: Okay
       Submirror 1: d24
          State: Resyncing
       Resync in progress: 15 % done
…
phys-schost# cldevice show phys-schost-3:/dev/rdsk/c2t2d0
…
DID Device Name:                                /dev/did/rdsk/d2
phys-schost# cldevicegroup show dsk/d2
Device Group Name:                              dsk/d2
…
  Node List:                                      phys-schost-1, phys-schost-2
…
  localonly:                                      false
phys-schost# cldevicegroup remove-node -n phys-schost-3 dsk/d2
phys-schost# cldevice set -p default_fencing=nofencing c2t2d0 
phys-schost# mount /export

接下来的操作

如果需要创建磁盘集,请转到以下任务之一:

如果您有足够的磁盘集来满足需要,则转到以下任务之一:

故障排除

此镜像过程中的某些步骤可能会导致产生类似于 metainit: dg-schost-1: d1s0: not a metadevice 的错误消息。这样的错误消息是无碍的,可以忽略。