はじめに
Red Hat で提供されている Relax and Recover によるバックアップを確認したログです。
参考:
環境
- バックアップ対象:
ホスト名 "test0525" , RHEL 8.6 ppc64le (on IBM Power S1014)
- バックアップ先:
ホスト名 "NFS_server"
設定
バックアップ対象の test0525 サーバーで実行します。
・rear の導入
# dnf install rear
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 0:00:20 ago on Sat 25 May 2024 02:56:09 AM EDT.
Dependencies resolved.
====================================================================================================
Package Architecture Version Repository Size
====================================================================================================
Installing:
rear ppc64le 2.6-4.el8 dvd-AppStream 776 k
Installing dependencies:
libburn ppc64le 1.4.8-3.el8 dvd-AppStream 191 k
libisoburn ppc64le 1.4.8-4.el8 dvd-AppStream 468 k
libisofs ppc64le 1.4.8-3.el8 dvd-AppStream 249 k
xorriso ppc64le 1.4.8-4.el8 dvd-AppStream 282 k
Transaction Summary
====================================================================================================
Install 5 Packages
Total size: 1.9 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libisofs-1.4.8-3.el8.ppc64le 1/5
Running scriptlet: libisofs-1.4.8-3.el8.ppc64le 1/5
Installing : libburn-1.4.8-3.el8.ppc64le 2/5
Running scriptlet: libburn-1.4.8-3.el8.ppc64le 2/5
Installing : libisoburn-1.4.8-4.el8.ppc64le 3/5
Running scriptlet: libisoburn-1.4.8-4.el8.ppc64le 3/5
Installing : xorriso-1.4.8-4.el8.ppc64le 4/5
Running scriptlet: xorriso-1.4.8-4.el8.ppc64le 4/5
Running scriptlet: rear-2.6-4.el8.ppc64le 5/5
Installing : rear-2.6-4.el8.ppc64le 5/5
Running scriptlet: rear-2.6-4.el8.ppc64le 5/5
Verifying : libburn-1.4.8-3.el8.ppc64le 1/5
Verifying : libisoburn-1.4.8-4.el8.ppc64le 2/5
Verifying : libisofs-1.4.8-3.el8.ppc64le 3/5
Verifying : rear-2.6-4.el8.ppc64le 4/5
Verifying : xorriso-1.4.8-4.el8.ppc64le 5/5
Installed products updated.
Installed:
libburn-1.4.8-3.el8.ppc64le libisoburn-1.4.8-4.el8.ppc64le libisofs-1.4.8-3.el8.ppc64le
rear-2.6-4.el8.ppc64le xorriso-1.4.8-4.el8.ppc64le
Complete!
・/etc/rear/local.conf は以下のように設定しました。
NFS サーバーに保管します。また、バックアップを iso に同梱しています。
OUTPUT=ISO
OUTPUT_URL=nfs://<NFSサーバーのホスト>/work/backup
BACKUP=NETFS
BACKUP_PROG_COMPRESS_OPTIONS=( --gzip )
BACKUP_PROG_COMPRESS_SUFFIX=".gz"
BACKUP_PROG_EXCLUDE=( '/tmp/*' '/data/*' )
BACKUP_URL=iso:///backup/
USE_RESOLV_CONF="n"
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/media' '/var/tmp' '/var/crash')
BACKUP_PROG_OPTIONS+=( --anchored --xattrs-include='*.*' --xattrs )
AUTOEXCLUDE_MULTIPATH="n"
BOOT_OVER_SAN="y"
"/tmp/", "/data/", "/media", "/var/tmp", "/var/crash" はバックアップの対象外としています。
バックアップ先にNFS(Network File System) を指定しています。
[追加事項]
バックアップのファイルサイズが小さいのでおかしいなと思っていたところ、"AUTOEXCLUDE_MULTIPATH="n"" が必要であることがわかりました。
参考:
バックアップに含める必要のあるマルチパスデバイスがある場合は、ReaR 設定ファイルで AUTOEXCLUDE_MULTIPATH=n を指定する必要があることに注意してください。
マニュアルのexampleも参考になります。
RHEL7 ですが、ppc64le の PXE boot 用のサンプルもあります。
バックアップ先サーバーの nfs設定
バックアップ先の"NFS_server"で実行します。
(コマンドのみ)
# dnf install nfs-utils
# systemctl start nfs-server
# systemctl enable nfs-server
# vi /etc/exports #(エクスポート先を/work/backupに指定)
# exportfs -a
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --reload
バックアップの実行
バックアップ対象の test0525 サーバーで実行します。
# time rear -d -v mkbackup
Relax-and-Recover 2.6 / 2020-06-17
Running rear mkbackup (PID 2891)
Using log file: /var/log/rear/rear-test0525.log
Running workflow mkbackup on the normal/original system
Using backup archive '/tmp/rear.cDyZsdmRB2fFznD/tmp/isofs/backup//backup.tar.gz'
Using autodetected kernel '/boot/vmlinuz-4.18.0-372.9.1.el8.ppc64le' as kernel in the recovery system
Creating disk layout
Overwriting existing disk layout file /var/lib/rear/layout/disklayout.conf
Using guessed bootloader 'PPC' (found PPC PreP boot partition 'ID=0x41' on /dev/sda)
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct ...
Creating recovery system root filesystem skeleton layout
Handling network interface 'env32'
env32 is a physical device
Handled network interface 'env32'
Copying logfile /var/log/rear/rear-test0525.log into initramfs as '/tmp/rear-test0525-partial-2024-05-28T07:14:46-04:00.log'
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/4.18.0-372.9.1.el8.ppc64le (MODULES contains 'all_modules')
Omit copying files in /lib*/firmware/ (FIRMWARE_FILES='no')
Skip copying broken symlink '/etc/mtab' target '/proc/14946/mounts' on /proc/ /sys/ /dev/ or /run/
Broken symlink '/usr/lib/modules/4.18.0-372.9.1.el8.ppc64le/build' in recovery system because 'readlink' cannot determine its link target
Broken symlink '/usr/lib/modules/4.18.0-372.9.1.el8.ppc64le/source' in recovery system because 'readlink' cannot determine its link target
Testing that the recovery system in /tmp/rear.cDyZsdmRB2fFznD/rootfs contains a usable system
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (114982272 bytes) in 13 seconds
Making backup (using backup method NETFS)
Creating tar archive '/tmp/rear.cDyZsdmRB2fFznD/tmp/isofs/backup//backup.tar.gz'
Archived 10814 MiB [avg 17493 KiB/sec] OK
Archived 10814 MiB in 634 seconds [avg 17466 KiB/sec]
[ 782.382089] FS-Cache: Loaded
[ 782.409816] FS-Cache: Netfs 'nfs' registered for caching
[ 782.414183] Key type dns_resolver registered
[ 782.548794] NFS: Registering the id_resolver key type
[ 782.548816] Key type id_resolver registered
[ 782.548819] Key type id_legacy registered
Making ISO image
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-test0525.iso (11G)
Copying resulting files to nfs location
Saving /var/log/rear/rear-test0525.log as rear-test0525.log to nfs location
Copying result files '/var/lib/rear/output/rear-test0525.iso /tmp/rear.cDyZsdmRB2fFznD/tmp/VERSION /tmp/rear.cDyZsdmRB2fFznD/tmp/README /tmp/rear.cDyZsdmRB2fFznD/tmp/rear-test0525.log' to /tmp/rear.cDyZsdmRB2fFznD/outputfs/test0525 at nfs location
Exiting rear mkbackup (PID 2891) and its descendant processes ...
Running exit tasks
You should also rm -Rf --one-file-system /tmp/rear.cDyZsdmRB2fFznD
real 12m17.656s
user 11m3.411s
sys 0m32.409s
# echo $?
0
ブート・ローダーが PPC であることが認識されています。
サイズは 11GB の iso ファイルができました。
確認
作成されたバックアップを保管先の"NFS_server"で確認します。
# ls -l /work/backup
total 0
drwxr-x---. 2 nobody nobody 85 May 28 07:26 test0525
# ls -l /work/backup/test0525/
total 18127172
-rw-------. 1 nobody nobody 202 May 28 07:26 README
-rw-------. 1 nobody nobody 11500945408 May 28 07:26 rear-test0525.iso
-rw-------. 1 nobody nobody 123119 May 28 07:26 rear-test0525.log
-rw-------. 1 nobody nobody 272 May 28 07:26 VERSION
作成された iso ファイルの中身を確認します。
# mkdir /test
# mount -t iso9660 -o loop ./rear-test0525.iso /test
mount: /test: WARNING: device write-protected, mounted read-only.
# ls -lR /test
/test:
total 147093
drwxr-x---. 1 root root 2048 May 28 07:26 backup
drwx------. 1 root root 2048 May 28 07:26 boot
-rw-r--r--. 1 root root 114982272 May 28 07:15 initrd.cgz
-rwxr-xr-x. 1 root root 35634133 Apr 15 2022 kernel
drwx------. 1 root root 2048 May 28 07:26 ppc
/test/backup:
total 11083330
-rw-r--r--. 1 root root 8916802 May 28 07:26 backup.log
-rw-r--r--. 1 root root 11340411993 May 28 07:26 backup.tar.gz
-rw-r--r--. 1 root root 0 May 28 07:26 selinux.autorelabel
/test/boot:
total 2
drwx------. 1 root root 2048 May 28 07:26 grub
/test/boot/grub:
total 600
-rw-------. 1 root root 115 May 28 07:26 grub.cfg
-rw-------. 1 root root 613724 May 28 07:26 powerpc.elf
/test/ppc:
total 1
-rw-------. 1 root root 160 May 28 07:26 bootinfo.txt
無事、NFS_server へReaRのバックアップが作成されました。
おわりに
作成したバックアップで iso ブートまたは、ネットワークブートなどでリストアできるかどうかを確認したいと思います。