#3013 Issue closed: rear backup recover error

Labels: waiting for info, support / question, no-issue-activity

ChickenTim99 opened issue at 2023-06-12 04:03:

ReaR version ("/usr/sbin/rear -V"):
Relax-and-Recover 2.6

OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
"SUSE Linux Enterprise Server 12 SP4"

It got error when I try to restore the LPAR by command "rear -D -d recover " .

Error message:

RESCUE tsm:~ # rear -D -d recover
Relax-and-Recover 2.6 / 2020-06-17
Running rear recover (PID 6435)
Using log file: /var/log/rear/rear-tsm.log
Running workflow recover within the ReaR rescue/recovery system
Will do driver migration (recreating initramfs/initrd)
Comparing disks
Device sda has expected (same) size 182536110080 bytes (will be used for 'recover')
Disk configuration looks identical
UserInput -I DISK_LAYOUT_PROCEED_RECOVERY needed in /usr/share/rear/layout/prepare/default/250_compare_disks.sh line 148
Proceed with 'recover' (yes) otherwise manual disk layout configuration is enforced
(default 'yes' timeout 30 seconds)
UserInput: No choices - result is 'yes'
User confirmed to proceed with 'recover'
Doing SLES-like btrfs subvolumes setup for /dev/sda3 on / (BTRFS_SUBVOLUME_SLES_SETUP contains /dev/sda3)
SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda3 (default subvolume path contains '@/.snapshots/')
Start system layout restoration.
Disk '/dev/sda': creating 'msdos' partition table
UserInput -I LAYOUT_CODE_RUN needed in /usr/share/rear/layout/recreate/default/200_run_layout_code.sh line 127
The disk layout recreation script failed
1) Rerun disk recreation script (/var/lib/rear/layout/diskrestore.sh)
2) View 'rear recover' log file (/var/log/rear/rear-tsm.log)
3) Edit disk recreation script (/var/lib/rear/layout/diskrestore.sh)
4) View original disk space usage (/var/lib/rear/layout/config/df.txt)
5) Use Relax-and-Recover shell and return back to here
6) Abort 'rear recover'
(default '1' timeout 300 seconds)

jsmeix commented at 2023-06-12 09:55:

in general see
the section
"Disaster recovery with Relax-and-Recover (ReaR)"
and therein in particular the sub-section
"Debugging issues with Relax-and-Recover"
and therein in particular the part
"To analyze and debug a 'rear recover' failure
the following information is mandatory"

gdha commented at 2023-06-29 15:43:

@ChickenTim99 Could you paste (or mail) the rear logs created during the failing recover (/var/log/rear/rear-tsm.log)? Also, paste the /etc/rear/local.conf and /var/lib/rear/layout/disklayout.conf.
Could you also paste the output of:


When you use SLES12 with its default btrfs structure you need first and foremost a matching /etc/rear/local.conf.
It is crucial to use a matching Rear configuration file. See the example files

gdha commented at 2023-06-30 05:41:

Content of file /etc/rear/local.conf:

cd /etc/rear
RESCUE tsm:/etc/rear # cat local.conf
# This file etc/rear/local.conf is intended for the user's
# manual configuration of Relax-and-Recover (ReaR).
# For configuration through packages and other automated means
# we recommend a separated file named site.conf next to this file
# and leave local.conf as is (ReaR upstream will never ship a site.conf).
# The default OUTPUT=ISO creates the ReaR rescue medium as ISO image.
# You need to specify your particular backup and restore method for your data
# as the default BACKUP=REQUESTRESTORE does not really do that (see "man rear").
# Configuration variables are documented in /usr/share/rear/conf/default.conf
# and the examples in /usr/share/rear/conf/examples/ can be used as templates.
# ReaR reads the configuration files via the bash builtin command 'source'
# so bash syntax like VARIABLE="value" (no spaces at '=') is mandatory.
# Because 'source' executes the content as bash scripts you can run commands
# within your configuration files, in particular commands to set different
# configuration values depending on certain conditions as you need like
# CONDITION_COMMAND && VARIABLE="special_value" || VARIABLE="usual_value"
# but that means CONDITION_COMMAND gets always executed when 'rear' is run
# so ensure nothing can go wrong if you run commands in configuration files.
RESCUE tsm:/etc/rear #


lsblk: unknown column: MOUNTPOINTS
/dev/sda    /dev/sda       disk                       170G
|-/dev/sda1 /dev/sda1      part                         7M
|-/dev/sda2 /dev/sda2      part                         2G
|-/dev/sda3 /dev/sda3      part btrfs                  40G
`-/dev/sda4 /dev/sda4      part                       128G
/dev/sr0    /dev/sr0       rom  udf    RELAXRECOVER 107.6M

Content of /var/lib/rear/layout/disklayout.conf file:

RESCUE tsm:/var/lib/rear/layout # cat disklayout.conf
# Disk layout dated 20230519162033 (YYYYmmddHHMMSS)
# /dev/sda    /dev/sda                disk         170G 
# |-/dev/sda1 /dev/sda1 /dev/sda      part           7M 
# |-/dev/sda2 /dev/sda2 /dev/sda      part swap      2G [SWAP]
# |-/dev/sda3 /dev/sda3 /dev/sda      part btrfs    40G /
# `-/dev/sda4 /dev/sda4 /dev/sda      part xfs     128G /home
# /dev/sr0    /dev/sr0                rom         1024M 
# Disk /dev/sda
# Format: disk <devname> <size(bytes)> <partition label type>
disk /dev/sda 182536110080 msdos
# Partitions on /dev/sda
# Format: part <device> <partition size(bytes)> <partition start(bytes)> <partition type|name> <flags> /dev/<partition>
part /dev/sda 7340032 1048576 primary boot,prep /dev/sda1
part /dev/sda 2154823680 8388608 primary none /dev/sda2
part /dev/sda 42952818688 2163212288 primary none /dev/sda3
part /dev/sda 137420079104 45116030976 primary none /dev/sda4
# Filesystems (only ext2,ext3,ext4,vfat,xfs,reiserfs,btrfs are supported).
# Format: fs <device> <mountpoint> <fstype> [uuid=<uuid>] [label=<label>] [<attributes>]
fs /dev/sda3 / btrfs uuid=c70e4540-4861-4802-aa49-17d04cbe9af3 label= options=rw,relatime,space_cache,subvolid=260,subvol=/@/.snapshots/1/snapshot
fs /dev/sda4 /home xfs uuid=6ceae28d-299b-46e4-bfec-08c63bb28393 label=  options=rw,relatime,attr2,inode64,noquota
# Btrfs default subvolume for /dev/sda3 at /
# Format: btrfsdefaultsubvol <device> <mountpoint> <btrfs_subvolume_ID> <btrfs_subvolume_path>
btrfsdefaultsubvol /dev/sda3 / 260 @/.snapshots/1/snapshot
# Btrfs snapshot subvolumes for /dev/sda3 at /
# Btrfs snapshot subvolumes are listed here only as documentation.
# There is no recovery of btrfs snapshot subvolumes.
# Format: btrfssnapshotsubvol <device> <mountpoint> <btrfs_subvolume_ID> <btrfs_subvolume_path>
#btrfssnapshotsubvol /dev/sda3 / 260 @/.snapshots/1/snapshot
#btrfssnapshotsubvol /dev/sda3 / 285 @/.snapshots/2/snapshot
#btrfssnapshotsubvol /dev/sda3 / 373 @/.snapshots/83/snapshot
#btrfssnapshotsubvol /dev/sda3 / 374 @/.snapshots/84/snapshot
#btrfssnapshotsubvol /dev/sda3 / 375 @/.snapshots/85/snapshot
# Btrfs normal subvolumes for /dev/sda3 at /
# Format: btrfsnormalsubvol <device> <mountpoint> <btrfs_subvolume_ID> <btrfs_subvolume_path>
# SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda3 (default subvolume path contains '@/.snapshots/')
# Btrfs subvolumes that belong to snapper are listed here only as documentation.
# Snapper's base subvolume '/@/.snapshots' is deactivated here because during 'rear recover'
# it is created by 'snapper/installation-helper --step 1' (which fails if it already exists).
# Furthermore any normal btrfs subvolume under snapper's base subvolume would be wrong.
# See https://github.com/rear/rear/issues/944#issuecomment-238239926
# and https://github.com/rear/rear/issues/963#issuecomment-240061392
# how to create a btrfs subvolume in compliance with the SLES12 default brtfs structure.
# In short: Normal btrfs subvolumes on SLES12 must be created directly below '/@/'
# e.g. '/@/var/lib/mystuff' (which requires that the btrfs root subvolume is mounted)
# and then the subvolume is mounted at '/var/lib/mystuff' to be accessible from '/'
# plus usually an entry in /etc/fstab to get it mounted automatically when booting.
# Because any '@/.snapshots' subvolume would let 'snapper/installation-helper --step 1' fail
# such subvolumes are deactivated here to not let 'rear recover' fail:
#btrfsnormalsubvol /dev/sda3 / 258 @/.snapshots
btrfsnormalsubvol /dev/sda3 / 257 @
btrfsnormalsubvol /dev/sda3 / 261 @/boot/grub2/powerpc-ieee1275
btrfsnormalsubvol /dev/sda3 / 262 @/opt
btrfsnormalsubvol /dev/sda3 / 263 @/srv
btrfsnormalsubvol /dev/sda3 / 264 @/tmp
btrfsnormalsubvol /dev/sda3 / 265 @/usr/local
btrfsnormalsubvol /dev/sda3 / 266 @/var/cache
btrfsnormalsubvol /dev/sda3 / 267 @/var/crash
btrfsnormalsubvol /dev/sda3 / 268 @/var/lib/libvirt/images
btrfsnormalsubvol /dev/sda3 / 269 @/var/lib/machines
btrfsnormalsubvol /dev/sda3 / 270 @/var/lib/mailman
btrfsnormalsubvol /dev/sda3 / 271 @/var/lib/mariadb
btrfsnormalsubvol /dev/sda3 / 272 @/var/lib/mysql
btrfsnormalsubvol /dev/sda3 / 273 @/var/lib/named
btrfsnormalsubvol /dev/sda3 / 274 @/var/lib/pgsql
btrfsnormalsubvol /dev/sda3 / 275 @/var/log
btrfsnormalsubvol /dev/sda3 / 276 @/var/opt
btrfsnormalsubvol /dev/sda3 / 277 @/var/spool
btrfsnormalsubvol /dev/sda3 / 278 @/var/tmp
# All mounted btrfs subvolumes (including mounted btrfs default subvolumes and mounted btrfs snapshot subvolumes).
# Determined by the findmnt command that shows the mounted btrfs_subvolume_path.
# Format: btrfsmountedsubvol <device> <subvolume_mountpoint> <mount_options> <btrfs_subvolume_path>
btrfsmountedsubvol /dev/sda3 / rw,relatime,space_cache,subvolid=260,subvol=/@/.snapshots/1/snapshot @/.snapshots/1/snapshot
btrfsmountedsubvol /dev/sda3 /var/crash rw,relatime,space_cache,subvolid=267,subvol=/@/var/crash @/var/crash
btrfsmountedsubvol /dev/sda3 /var/lib/libvirt/images rw,relatime,space_cache,subvolid=268,subvol=/@/var/lib/libvirt/images @/var/lib/libvirt/images
btrfsmountedsubvol /dev/sda3 /var/lib/mariadb rw,relatime,space_cache,subvolid=271,subvol=/@/var/lib/mariadb @/var/lib/mariadb
btrfsmountedsubvol /dev/sda3 /var/log rw,relatime,space_cache,subvolid=275,subvol=/@/var/log @/var/log
btrfsmountedsubvol /dev/sda3 /var/spool rw,relatime,space_cache,subvolid=277,subvol=/@/var/spool @/var/spool
btrfsmountedsubvol /dev/sda3 /var/lib/mysql rw,relatime,space_cache,subvolid=272,subvol=/@/var/lib/mysql @/var/lib/mysql
btrfsmountedsubvol /dev/sda3 /var/tmp rw,relatime,space_cache,subvolid=278,subvol=/@/var/tmp @/var/tmp
btrfsmountedsubvol /dev/sda3 /opt rw,relatime,space_cache,subvolid=262,subvol=/@/opt @/opt
btrfsmountedsubvol /dev/sda3 /var/lib/mailman rw,relatime,space_cache,subvolid=270,subvol=/@/var/lib/mailman @/var/lib/mailman
btrfsmountedsubvol /dev/sda3 /var/lib/pgsql rw,relatime,space_cache,subvolid=274,subvol=/@/var/lib/pgsql @/var/lib/pgsql
btrfsmountedsubvol /dev/sda3 /srv rw,relatime,space_cache,subvolid=263,subvol=/@/srv @/srv
btrfsmountedsubvol /dev/sda3 /tmp rw,relatime,space_cache,subvolid=264,subvol=/@/tmp @/tmp
btrfsmountedsubvol /dev/sda3 /var/cache rw,relatime,space_cache,subvolid=266,subvol=/@/var/cache @/var/cache
btrfsmountedsubvol /dev/sda3 /var/opt rw,relatime,space_cache,subvolid=276,subvol=/@/var/opt @/var/opt
btrfsmountedsubvol /dev/sda3 /var/lib/machines rw,relatime,space_cache,subvolid=269,subvol=/@/var/lib/machines @/var/lib/machines
btrfsmountedsubvol /dev/sda3 /usr/local rw,relatime,space_cache,subvolid=265,subvol=/@/usr/local @/usr/local
btrfsmountedsubvol /dev/sda3 /.snapshots rw,relatime,space_cache,subvolid=258,subvol=/@/.snapshots @/.snapshots
btrfsmountedsubvol /dev/sda3 /var/lib/named rw,relatime,space_cache,subvolid=273,subvol=/@/var/lib/named @/var/lib/named
btrfsmountedsubvol /dev/sda3 /boot/grub2/powerpc-ieee1275 rw,relatime,space_cache,subvolid=261,subvol=/@/boot/grub2/powerpc-ieee1275 @/boot/grub2/powerpc-ieee1275
# Mounted btrfs subvolumes that have the 'no copy on write' attribute set.
# Format: btrfsnocopyonwrite <btrfs_subvolume_path>
btrfsnocopyonwrite @/var/lib/libvirt/images
btrfsnocopyonwrite @/var/lib/mariadb
btrfsnocopyonwrite @/var/lib/mysql
btrfsnocopyonwrite @/var/lib/pgsql
# Swap partitions or swap files
# Format: swap <filename> uuid=<uuid> label=<label>
swap /dev/sda2 uuid=d5e90a8d-4f9c-4485-8a6d-bc6b052b63e4 label=
RESCUE tsm:/var/lib/rear/layout #

gdha commented at 2023-06-30 07:11:

@ChickenTim99 We see in the rear-tsm.log log file the error:

Create subvolume '/mnt/local//@/var/lib/libvirt/images'
+++ chattr +C /mnt/local//@/var/lib/libvirt/images
/var/lib/rear/layout/diskrestore.sh: line 184: chattr: command not found

which is the result of a missing chattr executable. As you are using SLES 12 with btrfs subvolumes you must copy https://github.com/rear/rear/blob/master/usr/share/rear/conf/examples/SLE12-SP2-btrfs-example.conf to your /etc/rear/local.conffile before running rear -v mkrescue. We assume that OUTPUT=ISO and BACKUP=TSM was used to create the ReaR recovery image? Furthermore, check the copied local.conf file if it contains everything you need (treat it as a shell script!). To test if it contains no logic bash errors you could use the command bash -n /etc/rear/local.conf which should end with no errors.

github-actions commented at 2023-08-30 02:01:

Stale issue message

[Export of Github issue for rear/rear.]