Sun Cluster 系统管理指南(适用于 Solaris OS)

Procedure如何备份根 (/) 文件系统

使用此过程可以备份群集节点的根 (/) 文件系统。执行此备份过程之前,请确保群集正在无故障运行。

phys-schost# 提示符表示全局群集提示符。此操作过程适用于全局群集。

此过程提供了 Sun Cluster 命令的长格式。此外,大多数命令还有简短格式。这些命令除了名称长短的不同以外,其功能都是相同的。有关命令及其简短格式的列表,请参见附录 B

  1. 在要备份的群集节点上,成为超级用户或使用一个可提供 solaris.cluster.modify RBAC 授权的角色。

  2. 将每一个正在运行的数据服务从将要备份的节点切换到群集的另一个节点。


    # clnode evacuate node
    
    node

    指定从中切换资源组和设备组的节点。

  3. 关闭该节点。


    # shutdown -g0 -y -i0
    
  4. 将节点重新引导到非群集模式。

    • 在基于 SPARC 的系统上,运行以下命令。


      ok boot -xs
      
    • 在基于 x86 的系统上,运行以下命令。


      phys-schost# shutdown -g -y -i0
      
      Press any key to continue
    1. 在 GRUB 菜单中,使用方向键选择适当的 Solaris 条目,然后键入 e 编辑其命令。

      GRUB 菜单显示类似于如下所示的内容:


      GNU GRUB version 0.95 (631K lower / 2095488K upper memory)
      +-------------------------------------------------------------------------+
      | Solaris 10 /sol_10_x86                                                  |
      | Solaris failsafe                                                        |
      |                                                                         |
      +-------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the
      commands before booting, or 'c' for a command-line.

      有关基于 GRUB 的引导的更多信息,请参见《系统管理指南:基本管理》中的“使用 GRUB 引导基于 x86 的系统(任务图)”

    2. 在引导参数屏幕中,使用方向键选择内核条目,然后键入 e 编辑该条目。

      GRUB 引导参数屏幕的显示与以下内容类似:


      GNU GRUB version 0.95 (615K lower / 2095552K upper memory)
      +----------------------------------------------------------------------+
      | root (hd0,0,a)                                                       |
      | kernel /platform/i86pc/multiboot                                     |
      | module /platform/i86pc/boot_archive                                  |
      +----------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press 'b' to boot, 'e' to edit the selected command in the
      boot sequence, 'c' for a command-line, 'o' to open a new line
      after ('O' for before) the selected line, 'd' to remove the
      selected line, or escape to go back to the main menu.
    3. 在命令中添加 -x 以指定将系统引导至非群集模式。


      [ Minimal BASH-like line editing is supported. For the first word, TAB
      lists possible command completions. Anywhere else TAB lists the possible
      completions of a device/filename. ESC at any time exits. ]
      
      grub edit> kernel /platform/i86pc/multiboot -x
    4. 按 Enter 键接受所做更改,并返回到引导参数屏幕。

      屏幕将显示编辑后的命令。


      GNU GRUB version 0.95 (615K lower / 2095552K upper memory)
      +----------------------------------------------------------------------+
      | root (hd0,0,a)                                                       |
      | kernel /platform/i86pc/multiboot -x                                  |
      | module /platform/i86pc/boot_archive                                  |
      +----------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press 'b' to boot, 'e' to edit the selected command in the
      boot sequence, 'c' for a command-line, 'o' to open a new line
      after ('O' for before) the selected line, 'd' to remove the
      selected line, or escape to go back to the main menu.-
    5. 键入 b 将节点引导至非群集模式。


      注 –

      对内核引导参数命令所做的这一更改在系统引导后将失效。下次重新引导节点时,系统将引导至群集模式。如果希望引导至非群集模式,请重新执行上述步骤,并将 -x 选项添加到内核引导参数命令中。


  5. 通过创建 UFS 快照来备份根 (/) 文件系统。

    1. 确保文件系统有足够的磁盘空间可用于后备存储文件。


      # df -k
      
    2. 确保名称和位置相同的后备存储文件尚不存在。


      # ls /backing-store-file
      
    3. 创建 UFS 快照。


      # fssnap -F ufs -o bs=/backing-store-file /file-system
      
    4. 检验是否已创建快照。


      # /usr/lib/fs/ufs/fssnap -i /file-system
      
  6. 将节点重新引导到群集模式。


    # init 6
    

示例 11–3 备份根 (/) 文件系统

在以下示例中,根 (/) 文件系统的快照保存至 /usr 目录下的 /scratch/usr.back.file 中。`


# fssnap -F ufs -o bs=/scratch/usr.back.file /usr
  /dev/fssnap/1