Infrastructure at your Service

Marc Wagner

odabr tool : how to resolve efi device backup failure?

By July 21, 2021 Oracle No Comments

During all my ODA projects where I need to perform patching operation, I’m using odabr tool. This tool is really easy to use and well designed. It offers the possibility to create snapshot on the /, /u01 and /opt LVM file systems as well as a physical copy (rsync) of the files to an external destination storage as NFS. This is powerful in case you would like to get just one file back. The tool, as well as the user guide, can be found on Oracle Doc ID 2466177.1. I recently faced some errors when the tool is performing EFI device backup, and thus resulting in failing without been able to create any snapshot. I wanted to share my finding here, and maybe for you to win some troubleshooting time.

How to install the tool?

Easy to install. You just need to download from the Doc ID the odabr-2.0.1-66.noarch.rpm package.

Check that the package is not already installed:

[[email protected] patch]# rpm -qa | grep -i odabr
[[email protected] patch]#

Install the tool:
[[email protected] patch]# ls -ltrh
total 5.2G
-rwxrwxrwx 1 root root 5.2G Jul 19 15:00 p30403673_1911000_Linux-x86-64.zip
-rw-r--r-- 1 root root 27K Jul 21 09:00 odabr-2.0.1-66.noarch.rpm
 
[[email protected] patch]# rpm -ivh odabr-2.0.1-66.noarch.rpm
warning: odabr-2.0.1-66.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 939112d6: NOKEY
Preparing... ################################# [100%] Updating / installing...
1:odabr-2.0.1-66 ################################# [100%]  
odabr-2.0.1.66 has been installed on /opt/odabr succesfully!
 
[[email protected] patch]# rpm -qa | grep -i odabr
odabr-2.0.1-66.noarch

Making a snapshot backup

First we will need to check if we have enough place in the physical volume.

[[email protected] patch]# pvdisplay
--- Physical volume ---
PV Name /dev/md126p3
VG Name VolGroupSys
PV Size <446.15 GiB / not usable 23.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 14276
Free PE 5444
Allocated PE 8832
PV UUID VyihMy-xEoI-SgKi-Apku-PBIS-BTnf-v2tsfU

In our case we have 5444 Free PE, one PE has a size of 32 MiB, thus making here about 170 GB available for snapshots.

By default the tool is assigning 190 GB snapshot to the 3 file systems (/, /u01 and /opt). If we have enough free space, we could simply run the following command to create snapshots backup:
[[email protected] patch]# /opt/odabr/odabr backup -snap

In our case knowing we only have 170 GB free, we might need to adjust the snapshots size.

With a df command we will first check how many place is needed :
[[email protected] patch]# df -h / /u01 /opt
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroupSys-LogVolRoot 30G 7.1G 21G 26% /
/dev/mapper/VolGroupSys-LogVolU01 118G 77G 36G 69% /u01
/dev/mapper/VolGroupSys-LogVolOpt 99G 53G 41G 57% /opt

From there we will size each snapshot size (rsize for /, usize for /u01 and osize for /opt) :
[[email protected] patch]# /opt/odabr/odabr backup -snap -rsize 15 -usize 90 -osize 60

EFI device backup issue

Running it could fail with EFI device backup issue:
[[email protected] patch]# /opt/odabr/odabr backup -snap -rsize 15 -usize 90 -osize 60
INFO: 2021-07-21 09:08:08: Please check the logfile '/opt/odabr/out/log/odabr_84675.log' for more details
 
 
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
odabr - ODA node Backup Restore - Version: 2.0.1-66
Copyright Oracle, Inc. 2013, 2021
--------------------------------------------------------
Author: Ruggero Citton
RAC Pack, Cloud Innovation and Solution Engineering Team
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
 
INFO: 2021-07-21 09:08:08: Checking superuser
INFO: 2021-07-21 09:08:08: Checking Bare Metal
 
INFO: 2021-07-21 09:08:08: Removing existing LVM snapshots
WARNING: 2021-07-21 09:08:08: LVM snapshot for 'opt' does not exist
WARNING: 2021-07-21 09:08:08: LVM snapshot for 'u01' does not exist
WARNING: 2021-07-21 09:08:08: LVM snapshot for 'root' does not exist
 
INFO: 2021-07-21 09:08:08: Checking current OS version
INFO: 2021-07-21 09:08:08: Checking LVM restore backgroud process
INFO: 2021-07-21 09:08:08: Checking LVM size
 
INFO: 2021-07-21 09:08:08: Boot device backup
INFO: 2021-07-21 09:08:08: Getting EFI device
INFO: 2021-07-21 09:08:08: ...step1 - unmounting EFI
INFO: 2021-07-21 09:08:08: ...step2 - making efi device backup
SUCCESS: 2021-07-21 09:08:10: ...EFI device backup saved as '/opt/odabr/out/hbi/efi.img'
INFO: 2021-07-21 09:08:10: ...step3 - checking EFI device backup
ERROR: 2021-07-21 09:08:10: Error running fsck over /opt/odabr/out/hbi/efi.img
ERROR: 2021-07-21 09:08:10: Command: 'fsck -a /opt/odabr/out/hbi/efi.img' failed as fsck from util-linux 2.23.2 fsck.fat 3.0.20 (12 Jun 2013) 0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt. Automatically removing dirty bit. Performing changes. /opt/odabr/out/hbi/efi.img: 20 files, 1100/63965 clusters
INFO: 2021-07-21 09:08:10: Mounting EFI back
ERROR: 2021-07-21 09:08:10: Backup not completed, exiting...

See the error :
ERROR: 2021-07-21 09:08:10: Error running fsck over /opt/odabr/out/hbi/efi.img
ERROR: 2021-07-21 09:08:10: Command: 'fsck -a /opt/odabr/out/hbi/efi.img' failed as fsck from util-linux 2.23.2 fsck.fat 3.0.20 (12 Jun 2013) 0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt. Automatically removing dirty bit. Performing changes. /opt/odabr/out/hbi/efi.img: 20 files, 1100/63965 clusters

This mainly means that the the image being checked was not properly unmounted and contains dirty bits. This is explained as well in Doc ID 2679511.1.

Solution

In order to resolve this issue, simply umount /boot/efi before running the tool.

[[email protected] hbi]# df -h | grep /boot/efi
/dev/md126p1 500M 8.6M 492M 2% /boot/efi
 
[[email protected] hbi]# umount /boot/efi
 
[[email protected] hbi]# df -h | grep /boot/efi
[[email protected] hbi]#

Running odabr tool again will make the snapshots creation now successful:

[[email protected] hbi]# /opt/odabr/odabr backup -snap -rsize 15 -usize 90 -osize 60
INFO: 2021-07-21 09:17:27: Please check the logfile '/opt/odabr/out/log/odabr_18986.log' for more details
 
 
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
odabr - ODA node Backup Restore - Version: 2.0.1-66
Copyright Oracle, Inc. 2013, 2021
--------------------------------------------------------
Author: Ruggero Citton
RAC Pack, Cloud Innovation and Solution Engineering Team
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
 
INFO: 2021-07-21 09:17:27: Checking superuser
INFO: 2021-07-21 09:17:27: Checking Bare Metal
 
INFO: 2021-07-21 09:17:27: Removing existing LVM snapshots
WARNING: 2021-07-21 09:17:27: LVM snapshot for 'opt' does not exist
WARNING: 2021-07-21 09:17:27: LVM snapshot for 'u01' does not exist
WARNING: 2021-07-21 09:17:27: LVM snapshot for 'root' does not exist
 
INFO: 2021-07-21 09:17:27: Checking current OS version
INFO: 2021-07-21 09:17:27: Checking LVM restore backgroud process
INFO: 2021-07-21 09:17:27: Checking LVM size
 
INFO: 2021-07-21 09:17:27: Boot device backup
INFO: 2021-07-21 09:17:27: Getting EFI device
WARNING: 2021-07-21 09:17:27: Failing checking efi device
INFO: 2021-07-21 09:17:27: ...no EFI device found
INFO: 2021-07-21 09:17:27: Getting boot device
INFO: 2021-07-21 09:17:27: ...step1 - making boot device backup using tar
SUCCESS: 2021-07-21 09:17:31: ...boot content saved as '/opt/odabr/out/hbi/boot.tar.gz'
INFO: 2021-07-21 09:17:31: ...step2 - unmounting boot
INFO: 2021-07-21 09:17:31: ...step3 - making boot device backup using dd
SUCCESS: 2021-07-21 09:17:33: ...boot device backup saved as '/opt/odabr/out/hbi/boot.img'
INFO: 2021-07-21 09:17:33: ...step4 - mounting boot
INFO: 2021-07-21 09:17:33: ...step5 - checking boot device backup
 
INFO: 2021-07-21 09:17:33: Making OCR physical backup
INFO: 2021-07-21 09:17:38: ...ocr backup saved as '/opt/odabr/out/hbi/ocrbackup_18986.bck'
SUCCESS: 2021-07-21 09:17:38: OCR physical backup created successfully
INFO: 2021-07-21 09:17:38: OCR export backup
INFO: 2021-07-21 09:17:40: ...ocr export saved as '/opt/odabr/out/hbi/ocrexport_18986.bck'
SUCCESS: 2021-07-21 09:17:40: OCR export backup created successfully
 
INFO: 2021-07-21 09:17:40: Making LVM snapshot backup
SUCCESS: 2021-07-21 09:17:40: ...snapshot backup for 'opt' created successfully
SUCCESS: 2021-07-21 09:17:41: ...snapshot backup for 'u01' created successfully
SUCCESS: 2021-07-21 09:17:42: ...snapshot backup for 'root' created successfully
SUCCESS: 2021-07-21 09:17:42: LVM snapshots backup done successfully

Once the snapshot have been created, we can mount the /boot/efi file system again:
[[email protected] hbi]# df -h | grep /boot/efi
[[email protected] hbi]# mount /boot/efi
[[email protected] hbi]# df -h | grep /boot/efi
/dev/md126p1 500M 8.6M 492M 2% /boot/efi

Checking snapshot backups

To display the current running snapshot, use the following command:
[[email protected] hbi]# /opt/odabr/odabr infosnap
 
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
odabr - ODA node Backup Restore - Version: 2.0.1-66
Copyright Oracle, Inc. 2013, 2021
--------------------------------------------------------
Author: Ruggero Citton
RAC Pack, Cloud Innovation and Solution Engineering Team
β”‚β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β”‚
 
 
LVM snap name Status COW Size Data%
------------- ---------- ---------- ------
root_snap active 15.00 GiB 0.01%
opt_snap active 60.00 GiB 0.01%
u01_snap active 90.00 GiB 0.01%

Deleting snapshot backups

To delete the snapshot backups, run:
[[email protected] ~]# /opt/odabr/odabr delsnap
INFO: 2021-07-21 11:12:18: Please check the logfile '/opt/odabr/out/log/odabr_35232.log' for more details
 
INFO: 2021-07-21 11:12:18: Removing LVM snapshots
INFO: 2021-07-21 11:12:18: ...removing LVM snapshot for 'opt'
SUCCESS: 2021-07-21 11:12:18: ...snapshot for 'opt' removed successfully
INFO: 2021-07-21 11:12:18: ...removing LVM snapshot for 'u01'
SUCCESS: 2021-07-21 11:12:19: ...snapshot for 'u01' removed successfully
INFO: 2021-07-21 11:12:19: ...removing LVM snapshot for 'root'
SUCCESS: 2021-07-21 11:12:19: ...snapshot for 'root' removed successfully
SUCCESS: 2021-07-21 11:12:19: Remove LVM snapshots done successfully

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Marc Wagner
Marc Wagner

Consultant