1.9. レスキュー環境からの sos レポートの生成
Red Hat Enterprise Linux (RHEL) ホストが適切に起動しない場合は、sos レポートを収集するために、ホストを起動して レスキュー環境 を作成してください。
レスキュー環境を使用すると、ターゲットシステムを /mnt/sysroot にマウントし、その内容にアクセスして、sos report コマンドを実行できます。
前提条件
- ホストがベアメタルサーバーの場合は、マシンに物理的にアクセスできる。
- ホストが仮想マシンの場合は、ハイパーバイザーにある仮想マシンの設定にアクセス権できる。
- RHEL インストールを行うための ISO イメージファイル、インストール DVD、netboot CD、PXE (Preboot Execution Environment) 設定などの RHEL インストールソース。
手順
- インストールソースからホストを起動します。
-
インストールメディアのブートメニューで、
Troubleshootingを選択します。 -
Troubleshooting メニューで
Rescue a Red Hat Enterprise Linux systemオプションを選択します。 Rescue メニューで
1を選択し、Enter キーを押して続行して、/mnt/sysrootディレクトリーにシステムをマウントします。… 1) Continue 2) Read-only mount 3) Skip to shell 4) Quit (Reboot) Please make a selection from the above: 1プロンプトが表示されたら、Enter キーを押してシェルを取得します。
Rescue Shell Your system has been mounted under /mnt/sysroot. If you would like to make the root of your system the root of the activate system, run the command: chroot /mnt/sysroot Warning: The rescue shell will trigger SELinux autorelabel on the subsequent boot. Add "enforcing=0" on the kernel command line for autorelabel to work properly. When finished, please exit from the shell and your system will reboot. Please press ENTER to get a shell: bash-5.2#chrootコマンドを使用して、レスキューセッションの見かけ上のルートディレクトリーを/mnt/sysrootディレクトリーに変更します。Rescue Shell … Please press ENTER to get a shell: bash-5.2# chroot /mnt/sysimage/オプション: 初期の Rescue 環境ではネットワークが起動していない可能性があるため、必ず最初に設定してください。たとえば、ネットワークに静的 IP アドレスが必要で、ネットワーク経由で
sosレポートを転送したい場合は、以下のようにネットワークを設定します。使用するイーサネットデバイスを特定します。
# ip link show … 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:79:56 brd ff:ff:ff:ff:ff:ffネットワークインターフェイスに IP アドレスを割り当て、デフォルトゲートウェイを設定します。たとえば、サブネット 255.255.255.0 (CIDR 24) を持つ IP アドレス 192.168.0.1 をデバイス enp1s0 に追加する場合は、次のように入力します。
# ip address add <192.168.0.1/24> dev <enp1s0> # ip route add default via <192.168.0.254>/etc/resolv.confファイルにnameserverエントリーを追加します。次に例を示します。nameserver <192.168.0.5>
sos reportコマンドを実行し、画面の指示に従います。--uploadオプションを追加すると、sosレポートの生成直後にレポートを Red Hat に転送できます。bash-5.2# sos report sos report (version 4.8.2) This command will collect system configuration and diagnostic information from this Fedora Linux system. For more information on the Fedora Project visit: Community Website : https://fedoraproject.org/ Community Forums : https://discussion.fedoraproject.org/ The generated archive may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party. No changes will be made to system configuration. Press ENTER to continue, or CTRL-C to quit.オプション: Red Hat でテクニカルサポートケースをすでに作成している場合には、ケース番号を入力して
sosレポートファイルの名前に追加します。--uploadを指定しており、ホストがインターネットに接続されている場合は対象のケースにアップロードされます。ケース番号がない場合は、このフィールドを空白にしておきます。ケース番号の入力は任意であるため、sosユーティリティーの動作には影響はありません。sos report (version 4.8.2) … Press ENTER to continue, or CTRL-C to quit. Optionally, please enter the case id that you are generating this report for []:コンソール出力の末尾に表示されている
sosレポートファイルの名前を書き留めておきます。Finished running plugins Creating compressed archive… Your sosreport has been generated and saved in: /var/tmp/secured-sosreport-unused-2025-05-14-lofqhen.tar.xz Size 9.30MiB Owner root sha256 bf303917b689b13f0c059116d9ca55e341d5fadcd3f1473bef7299c4ad2a7f4f Please send this file to your support representative. bash-5.2#-
ホストがインターネットに接続されていない場合は、
scpなどのファイル転送ユーティリティーを使用して、ネットワーク上の別のホストにsosレポートを転送して Red Hat テクニカルサポートケースにアップロードします。
検証
sosユーティリティーによって、/var/tmp/ディレクトリーにアーカイブが作成されたことを確認します。$ ls -l /var/tmp/sosreport* -rw-r—r--. 1 root root 65 Mar 14 2025 /var/tmp/sosreport-example.hostname-2025-05-14-lofqhen.tar.xz.sha256 -rw-------. 1 root root 17036176 Mar 14 2025 /var/tmp/sosreport-example.hostname-2025-05-14-lofqhen.tar.xz5-14-lofqhen.tar.xz