#896 Issue closed: Grub and LVM leads to physical device metadata to be overwritten

Labels: enhancement, fixed / solved / done

stermeau opened issue at 2016-06-28 12:31:

  • rear version (/usr/sbin/rear -V):
    Relax-and-Recover 1.16.1 / Git
    rpm : rear-1.16.1-1.el6.noarch

  • OS version (cat /etc/rear/os.conf or lsb_release -a):
    Red Hat Enterprise Linux Server release 6.3 (Santiago)

  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    PROGS=( "${PROGS[@]}" screen )
    GRUB_RESCUE=n
    USE_STATIC_NETWORKING=y
    BACKUP=TSM
    OUTPUT=ISO
    TIMESYNC=NTP
    AUTOEXCLUDE_MULTIPATH=
    MODULES=(dm-multipath qla2xxx scsi_transport_fc)
    MODULES_LOAD=(dm-multipath qla2xxx scsi_transport_fc)
    BOOT_OVER_SAN=y
    PRE_RECOVERY_SCRIPT=/sbin/multipathd
    COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/multipath/bindings /etc/multipath.conf )
    COPY_AS_IS_TSM=( "${COPY_AS_IS_TSM[@]}" /.tsm /.tsm_ora)
    SSH_ROOT_PASSWORD="rear2rear"
    ISO_PREFIX="rear-097484"

  • Brief description of the issue
    At the end of the restore, REAR installs grub on all the "disks".
    If a whole disk is used a physical devices, then the LVM metadata are overwritten.
    After the reboot, the server hangs with:

    Setting up Logical Volume Management: Couldn't find device with uuid BYblWm-WqbM-XR73-xL5M-h6ah-XXXXX-XXXXX.

    REAR shouldn't install grub on disks that are physical volumes

  • Work-around, if any

gdha commented at 2016-06-28 14:54:

@stermeau The BOOT_OVER_SAN related code was never 100% finished due to no HW to test to improve the existing code. The consultancy done so far ended without extension, so it is very hard for me to improve code (or add missing pieces), if I cannot spent time on it (via consultancy or sponsoring). It is like it is - it is not polished yet.
Of course, you are free to create pull requests to improve the code where needed. If possible, I can assist, but I will not be in the driving seat if I'm not paid for it (to define the proper expectations).

didacog commented at 2016-06-28 15:27:

@gdha @stermeau

I will provide a pull request solving an error in efibootmgr on BOOT_over_SAN soon. Maybe is a similar problem with /dev/mapper devices. I can check this tomorrow and maybe provide pull request also with this problem solved.

@stermeau can you provide (rear -vd recover) logs?
Regards,
Didac

stermeau commented at 2016-06-28 18:31:

Hi,

@didacog , I have attached the log. Thanks for your help.
rear.txt

@gdha, the server is not booting from SAN. From my point of view, after line 65 of 21_install_grub.sh ( same thing in 22_install_grub2.sh), if the disk is a physical volume, it should be skipped.
I will give it a try to submit a pull request if it works

didacog commented at 2016-07-01 09:14:

@stermeau I will deepen a little bit more this weekend, I had issues with efibootmgr but 21_install_grub.sh gets disk info in other manner.

Sorry but this week I'm quite busy... I will test few things this weekend and update the issue.

stermeau commented at 2016-07-04 14:02:

I submitted a pull request : https://github.com/rear/rear/pull/901

gdha commented at 2016-07-05 15:47:

@stermeau I noticed that you serious modified the local.conf file, but please check script prep/GNU/Linux/24_include_multipath_tools.sh. If you could improve its content then you would make me a happy man.

stermeau commented at 2016-07-06 12:08:

@gdha I have updated the pull request.

Yes my local.conf is quite customized.
Still /etc/multipath and /bindings /etc/multipath.conf are already referenced in 24_include_multipath_tools.sh. So this is actually useless.
The MODULES* are specific to my environment with QLA cards.
I think it would make sense to have the following added

 # To properly discover multipath devices

PRE_RECOVERY_SCRIPT=( "${PRE_RECOVERY_SCRIPT[@]}" /sbin/multipathd )

 # When using TSM

POST_RECOVERY_SCRIPT='cp /etc/adsm/TSM.PWD /mnt/local/etc/adsm'

gdha commented at 2016-07-06 12:14:

@stermeau Pull request was accepted - thank you for this.
Concerning the multipath stuff: I guess you want the daemon to be executed when you boot from the rear image - that is a good point indeed and can be implemented.
However, you lost me with the TSM stuff: is this something what is missing in the current TSM hooks within rear? Wasn't this not restored by TSM itself?

gdha commented at 2016-09-13 14:25:

@stermeau can this be closed?


[Export of Github issue for rear/rear.]