#2380 Issue closed: Recover from mounted software raid disk

Labels: support / question, no-issue-activity

(unknown) opened issue at 2020-04-24 12:28:

Hi,

I have a installed centos 7 on a usb-stick (32gb)
On this production environment I have mounted 2 disk as software raid1
-> /dev/md0 mounted to /raid1

Now I make a rear backup of the centos system (excluding /raid1 and /mnt
etc) The location of the backup is /raid1

But when I recover, the system cannot find the backup location to recover (cannot find backup.tar.gz)

What steps I have to take?

my conf file looks like


OUTPUT=ISO
OUTPUT_URL=file:///raid1/rear-backup/
BACKUP=NETFS
BACKUP_URL=file:///raid1/rear-backup/
EXCLUDE_BACKUP=('/media' '/raid1' '/mnt' '/var/tmp' '/var/crash')
NETFS_KEEP_OLD_BACKUP_COPY=yes


With kind regards,
Ismet

jsmeix commented at 2020-04-24 12:43:

@ismetsener
see what @gdha replied to you on
http://lists.relax-and-recover.org/pipermail/rear-users/2020-April/003753.html

On the recovery side you probably need to mount
the /raid1 manually as  well (I understood from your mail
that you mounted it manually on your centos7 system).
Why not using a NFS location instead?

jsmeix commented at 2020-04-24 12:51:

@ismetsener
if inside the ReaR recovery system before you run "rear recover"
a command like mount /dev/md0 /raid1 makes things work
for your particular use case, you could automate that using
a PRE_RECOVERY_SCRIPT, see default.conf
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf#L2973

(unknown) commented at 2020-04-24 12:57:

on the system I mounted via fstab
but when I recover it eve did not recognize md0
so if in the recover enviornment there was md0, I would mount it
but there is no md0 (only /dev/sdb and /dev/sdc , bit are part of software raid 1 -> /dev/,=md0)

jsmeix commented at 2020-04-24 13:07:

@ismetsener
during ReaR recovery system startup nothing happens
like RAID1 setup because there is no 'mdadm' in any of the
recovery system startup scripts:

# find usr/share/rear/skel -type f | xargs grep 'mdadm'
[no output]

and in build/default/502_include_mdadm_conf.sh
https://github.com/rear/rear/blob/master/usr/share/rear/build/default/502_include_mdadm_conf.sh
there is

# Include /etc/mdadm.conf without building arrays automatically
# for the reason behind see
# https://github.com/rear/rear/issues/1722#issuecomment-394746478

where
https://github.com/rear/rear/issues/1722#issuecomment-394746478
explains it why the RAID arrays are not rebuilt automatically
because that would let creating a multipath mapping fail.

The ReaR recovery system runs completely in a ramdisk
and the disks of that system are not touched at all during
recovery system startup.
So all you have is the plain kernel block device nodes of the disks
like /dev/sda /dev/sdb and their partitions like /dev/sdb2 if exists.

(unknown) commented at 2020-04-24 13:12:

so i have to create and mount the 2 disks?
then it is better to make to backup to an external disk (by using nfs)

jsmeix commented at 2020-04-24 13:24:

I am really not a RAID expert but I think
you need to manually assemble your RAID1, cf.
https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm
and
https://www.thegeekdiary.com/centos-rhel-how-to-assemble-a-software-raid-in-rescue-mode/

jsmeix commented at 2020-04-24 13:28:

By the way:
I wonder how you intend to recreate your system
on pristine new replacement hardware
where you don't have an existing RAID1?
Or do I misunderstand your environment?

(unknown) commented at 2020-04-24 13:31:

So after I use rear recover, I have to confgure the raid1 and mounted manual
then it is better to make the backup to external system with nfs?

jsmeix commented at 2020-04-24 13:48:

See my above edited
https://github.com/rear/rear/issues/2380#issuecomment-618997658
what I added about
usr/share/rear/build/default/502_include_mdadm_conf.sh

So when you don't use multipath it might help in your particular case
to skip what the build/default/502_include_mdadm_conf.sh script does
by adding a return 0 line at its beginning.
This is only an offhanded blind idea - I did not test anything.

FYI:
You can check what there is in your ReaR recovery system
on your original system where you made it with "rear mkbackup/mkrescue"
by using KEEP_BUILD_DIR, see default.conf
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf#L142

jsmeix commented at 2020-04-24 13:51:

In general having the backup on an external system
(usually via network on a NFS server as a first step)
is mandatory to ensure the backup is save when
the original system gets completely destroyed, cf.
"Relax-and-Recover versus backup and restore" in
https://en.opensuse.org/SDB:Disaster_Recovery

(unknown) commented at 2020-04-24 18:29:

thanks I created a NFS and I will test it again
when I start the recover process I do not see a "MENU" with all the options like "recover localhost" and "automatic recover" why is this??

(unknown) commented at 2020-04-24 19:01:

I use the REAR backup/restore for my nas machine, installed on USB 32GB
so when something happens to the operatinal enviromnet (USB 32GB) I like to have a backup (another USB 32GB)

So if I restore with rear -d -v recover ,
I took the former USB out the machine (where I made backup from) and inserted the NEW USB how to tell the rear-sytem where to install??

I have also 2 disks mounted (so I do not hope that it wriets the backup to this disks)

I know that I can also use dd command to clone one USB to another
but with "dd" command you have to shutdown the system to make backup, and with REAR you can make hot backup without shutting down

github-actions commented at 2020-06-26 01:38:

Stale issue message


[Export of Github issue for rear/rear.]