搜索

15.2. 使用 Boom Boot Manager 升级至另一个版本

download PDF

使用 Boom Boot Manager 执行 Red Hat Enterprise Linux 操作系统升级。

先决条件

  • 您正在运行 Red Hat Enterprise Linux 7.9。
  • 已安装 lvm2-python-boom 软件包的当前版本(版本 lvm2-python-boom-1.2-2.el7_9.5 或更高版本)。
  • 您有足够的空间用于快照。根据原始安装的大小进行大小估计。列出所有挂载的逻辑卷。
  • 您已安装了 leapp 软件包。
  • 您已启用了软件存储库。
注意

其他文件系统可能包含 /usr/var

流程

  1. 创建您的 root 逻辑卷快照:

    • 如果您的 root 文件系统使用精简配置,请创建一个精简快照:

      # lvcreate -s rhel/root -kn -n root_snapshot_before_changes
       Logical volume "root_snapshot_before_changes" created.

      在这里:

      • -s 创建快照。
      • rhel/root 将文件系统复制到逻辑卷。
      • -kn 在引导时自动激活 LV。
      • -n root_snapshot_before_changes 显示快照的名称。

        在创建精简快照时,不要定义快照大小。快照从精简池中分配。

    • 如果您的 root 文件系统使用 thick 置备,请创建一个 thick 快照:

      # lvcreate -s rhel/root -n root_snapshot_before_changes -L 25g
       Logical volume "root_snapshot_before_changes" created.

      在这个命令中:

      • -s 创建快照。
      • rhel/root 将文件系统复制到逻辑卷。
      • -n root_snapshot_before_changes 显示快照的名称。
      • -L 25g 是快照大小。根据原始安装的大小进行大小估计。

        在创建厚快照时,定义可保存升级过程中所有更改的快照大小。

        重要

        创建的快照不包括任何其他系统更改。

  2. 使用 GRUB 2 引导装载程序启用 boom

    # grub2-mkconfig > /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-1160.118.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-1160.118.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-f9f6209866c743739757658d1a4850b2
    Found initrd image: /boot/initramfs-0-rescue-f9f6209866c743739757658d1a4850b2.img
    done
  3. 创建配置集:

    # boom profile create --from-host --uname-pattern el7
    Created profile with os_id f150f3d:
      OS ID: "f150f3d6693495254255d46e20ecf5c690ec3262",
      Name: "Red Hat Enterprise Linux Server", Short name: "rhel",
      Version: "7.9 (Maipo)", Version ID: "7.9",
      Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
      Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
      Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
      Options: "root=%{root_device} ro %{root_opts}",
      Title: "%{os_name} %{os_version_id} (%{version})",
      Optional keys: "grub_users grub_arg grub_class id", UTS release pattern: "el7"
  4. 使用原始引导镜像的备份副本创建原始系统的快照引导条目:

    # boom create --backup --title "Root LV snapshot before changes" --rootlv rhel/root_snapshot_before_changes
    Created entry with boot_id bfef767:
      title Root LV snapshot before changes
      machine-id 7d70d7fcc6884be19987956d0897da31
      version 3.10.0-1160.114.2.el7.x86_64
      linux /vmlinuz-3.10.0-1160.114.2.el7.x86_64.boom0
      initrd /initramfs-3.10.0-1160.114.2.el7.x86_64.img.boom0
      options root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes
      grub_users $grub_users
      grub_arg --unrestricted
      grub_class kernel

    在这里:

    • --title "Root LV snapshot before changes" 是引导条目的名称,它在系统启动期间显示在引导条目列表中。
    • --rootlv 是与新引导条目对应的根逻辑卷。

      完成上一步后,您有一个引导条目,允许在升级前访问原始系统。

  5. 使用 Leapp 工具升级到 Red Hat Enterprise Linux 8:

    # leapp upgrade
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    ...
    ============================================================
                          REPORT OVERVIEW
    ============================================================
    
    Upgrade has been inhibited due to the following problems:
        1. Btrfs has been removed from RHEL8
        2. Missing required answers in the answer file
    
    HIGH and MEDIUM severity reports:
        1. Packages available in excluded repositories will not be installed
        2. GRUB2 core will be automatically updated during the upgrade
        3. Difference in Python versions and support in RHEL 8
        4. chrony using default configuration
    
    Reports summary:
        Errors:                      0
        Inhibitors:                  2
        HIGH severity reports:       3
        MEDIUM severity reports:     1
        LOW severity reports:        3
        INFO severity reports:       4
    
    Before continuing consult the full report:
        A report has been generated at /var/log/leapp/leapp-report.json
        A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                       END OF REPORT OVERVIEW
    ============================================================

    检查并解决 leapp upgrade 命令报告指示的任何块器。有关报告的详细信息,请参阅 从命令行评估可升级性

  6. 重启升级引导条目:

    # leapp upgrade --reboot
    ==> Processing phase `configuration_phase`
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase `FactsCollection`
    ...

    从 GRUB 引导屏幕中选择 Red Hat Enterprise Linux Upgrade Initramfs 条目。

    注意

    Red Hat Enterprise Linux 8 不提供 GRUB 引导屏幕中的 Snapshots 子菜单。

验证

  • 完成升级后,系统会自动重启。GRUB 屏幕显示升级(Red Hat Enterprise Linux 8)和之前可用的操作系统版本。升级的系统版本是默认选择。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.