#271 Issue closed: rear restoration issue

Labels: support / question

vivekpendse opened issue at 2013-07-08 11:37:

Hi Team,

I have taken a rear backup (by excluding vg01) of my VM which has boot disk as well as one more disk which belongs to vg01.
Backup is completing well without vg01 data.

Whenever I am restoring this backup on new VM, then it only succeeds if I am allocating vg01 disk as well.

/etc/rear/local.conf contents are:
[root@rhel64 ~]# cat /etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL="nfs://192.168.189.134/rear_bkp"
EXCLUDE_VG=(vg01)
[root@rhel64 ~]#

[root@rhel64 ~]# rpm -qa | grep -i rear
rear-1.14-3.el6.noarch
[root@rhel64 ~]#

I just want to restore the backup without vg01.
Is it possible?

Thanks,
Vivek

gdha commented at 2013-07-08 13:47:

In the default.conf file we find the following guidelines:

$ grep EXCLUDE_MOUN /usr/share/rear/conf/default.conf 
EXCLUDE_MOUNTPOINTS=()
# NOTE: YOU MUST ALSO EXCLUDE THE CORRESPONDING MOUNTPOINTS IN EXCLUDE_MOUNTPOINTS (see above)
# EXCLUDE_VG and EXCLUDE_MOUNTPOINTS will get populated automatically, if needed

vivekpendse commented at 2013-07-08 15:18:

Thanks for the suggestion.
I have already did this, but it didnot help me. I have only one mount point in vg01.
I have excluded that.
Thanks for the reply.

[root@rhel64 ~]# cat /etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL="nfs://192.168.189.134/rear_bkp"
EXCLUDE_MOUNTPOINTS=(/lvol1)
EXCLUDE_VG=(vg01)
[root@rhel64 ~]#

gdha commented at 2013-07-09 11:18:

@vivekpendse Can you list the /var/lib/rear/layout/disklayout.conf file?

vivekpendse commented at 2013-07-09 11:24:

Hi,

Please find below:

[root@rhel64 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              16G  4.9G   11G  32% /
tmpfs                 935M   72K  935M   1% /dev/shm
/dev/sda1             291M   81M  195M  30% /boot
/dev/mapper/vg01-lvol1
                      9.9G  3.6G  5.9G  38% /lvol1
[root@rhel64 ~]#


[root@rhel64 ~]# cat /var/lib/rear/layout/disklayout.conf
disk /dev/sda 21474836480 msdos
part /dev/sda 314572800 1048576 primary boot /dev/sda1
part /dev/sda 4194304000 315621376 primary none /dev/sda2
part /dev/sda 16964911104 4509925376 primary none /dev/sda3
#disk /dev/sdb 10737418240
#lvmdev /dev/vg01 /dev/sdb h1uTyI-8vkg-oaNT-Dtli-sEWA-H404-TXJAbg 20971520
#lvmgrp /dev/vg01 4096 2559 10481664
#lvmvol /dev/vg01 lvol1 2559 20963328
fs /dev/sda3 / ext4 uuid=d863830d-a6a0-456a-b87e-367a87d097bb label= blocksize=4096 reserved_blocks=1% max_mounts=-1 check_interval=0d bytes_per_inode=16274 options=rw
fs /dev/sda1 /boot ext4 uuid=02e23821-2028-43f3-a8f7-a4b939496c0d label= blocksize=1024 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=4090 options=rw
#fs /dev/mapper/vg01-lvol1 /lvol1 ext4 uuid=f7a2edb9-23a9-455d-bf8b-76baa1b5db02 label= blocksize=4096 reserved_blocks=4% max_mounts=34 check_interval=180d bytes_per_inode=16377 options=rw
#fs /dev/sr0 /media/RELAXRECOVER iso9660  options=ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,iocharset=utf8,mode=0400,dmode=0500
swap /dev/sda2 uuid=5d3ee8a8-d8f8-4145-aac5-15e7cff34854 label=
[root@rhel64 ~]#

vivekpendse commented at 2013-07-10 16:06:

Kindly update.

gdha commented at 2013-07-11 06:03:

@vivekpendse the disklayout.conf script looks perfect. So, I don't understand why the vg01 needs to be created. Would like to see the diskrestore.sh script which is made during the recovery, is this possible?

vivekpendse commented at 2013-07-11 06:15:

Hi,
Please find below.
I also didnot understand the issue.
Few points which i noticed:

  1. Backup is getting restored on new disk, (when vg01 lun is not assigned to vm), but at the time of booting, it gives errors related to file systems.
    But at the same time, if i assigned vg01 lun, then system boots perfectly fine.

Please find the contents of diskrestore.sh below:

  1 #!/bin/bash
  2
  3 LogPrint "Start system layout restoration."
  4
  5 mkdir -p /mnt/local
  6 if create_component "vgchange" "rear" ; then
  7     lvm vgchange -a n >&8
  8     component_created "vgchange" "rear"
  9 fi
 10
 11 set -e
 12 set -x
 13
 14 if create_component "/dev/sda" "disk" ; then
 15 # Create /dev/sda (disk)
 16 Log "Erasing MBR of disk /dev/sda"
 17 dd if=/dev/zero of=/dev/sda bs=512 count=1
 18 sync
 19 LogPrint "Creating partitions for disk /dev/sda (msdos)"
 20 parted -s /dev/sda mklabel msdos >&2
 21 parted -s /dev/sda mkpart primary 1048576B 315621375B >&2
 22 parted -s /dev/sda set 1 boot on >&2
 23 parted -s /dev/sda mkpart primary 315621376B 4509925375B >&2
 24 parted -s /dev/sda mkpart primary 4509925376B 21474836479B >&2
 25 partprobe -s /dev/sda >&2
 26 # Wait some time before advancing
 27 sleep 10
 28
 29 # Make sure device nodes are visible (eg. in RHEL4)
 30 my_udevtrigger
 31 my_udevsettle
 32 component_created "/dev/sda" "disk"
 33 else
 34     LogPrint "Skipping /dev/sda (disk) as it has already been created."
 35 fi
 36
 37 if create_component "/dev/sda1" "part" ; then
 38 # Create /dev/sda1 (part)
 39 component_created "/dev/sda1" "part"
 40 else
 41     LogPrint "Skipping /dev/sda1 (part) as it has already been created."
 42 fi
 43
 44 if create_component "/dev/sda2" "part" ; then
 45 # Create /dev/sda2 (part)
 46 component_created "/dev/sda2" "part"
 47 else
 48     LogPrint "Skipping /dev/sda2 (part) as it has already been created."
 49 fi
 50
 51 if create_component "/dev/sda3" "part" ; then
 52 # Create /dev/sda3 (part)
 53 component_created "/dev/sda3" "part"
 54 else
 55     LogPrint "Skipping /dev/sda3 (part) as it has already been created."
 56 fi
 57
 58 if create_component "fs:/" "fs" ; then
 59 # Create fs:/ (fs)
 60 LogPrint "Creating ext4-filesystem / on /dev/sda3"
 61 mkfs -t ext4 -b 4096 -i 16274 /dev/sda3 >&2
 62 tune2fs -U d863830d-a6a0-456a-b87e-367a87d097bb /dev/sda3 >&2
 63 tune2fs  -m 1 -c -1 -i 0d /dev/sda3 >&2
 64 LogPrint "Mounting filesystem /"
 65 mkdir -p /mnt/local/
 66 mount -o rw /dev/sda3 /mnt/local/
 67 component_created "fs:/" "fs"
 68 else
 69     LogPrint "Skipping fs:/ (fs) as it has already been created."
 70 fi
 71
 72 if create_component "fs:/boot" "fs" ; then
 73 # Create fs:/boot (fs)
 74 LogPrint "Creating ext4-filesystem /boot on /dev/sda1"
 75 mkfs -t ext4 -b 1024 -i 4090 /dev/sda1 >&2
 76 tune2fs -U 02e23821-2028-43f3-a8f7-a4b939496c0d /dev/sda1 >&2
 77 tune2fs  -m 5 -c -1 -i 0d /dev/sda1 >&2
 78 LogPrint "Mounting filesystem /boot"
 79 mkdir -p /mnt/local/boot
 80 mount -o rw /dev/sda1 /mnt/local/boot
 81 component_created "fs:/boot" "fs"
 82 else
 83     LogPrint "Skipping fs:/boot (fs) as it has already been created."
 84 fi
 85
 86 if create_component "swap:/dev/sda2" "swap" ; then
 87 # Create swap:/dev/sda2 (swap)
 88 LogPrint "Creating swap on /dev/sda2"
 89 mkswap -U 5d3ee8a8-d8f8-4145-aac5-15e7cff34854 /dev/sda2 >&2
 90 component_created "swap:/dev/sda2" "swap"
 91 else
 92     LogPrint "Skipping swap:/dev/sda2 (swap) as it has already been created."
 93 fi
 94
 95
 96 set +x
 97 set +e
 98
 99 LogPrint "Disk layout created."
100

vivekpendse commented at 2013-07-11 06:32:

1) View Relax-and-Recover log
2) View original disk space usage
3) Go to Relax-and-Recover shell
4) Edit restore script (diskrestore.sh)
5) Continue restore script
6) Abort Relax-and-Recover
#? 2
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              16G  4.9G   11G  33% /
tmpfs                 935M  384K  935M   1% /dev/shm
/dev/sda1             291M   81M  195M  30% /boot
/dev/mapper/vg01-lvol1
                      9.9G  3.6G  5.9G  38% /lvol1
/dev/sr0               51M   51M     0 100% /media/RELAXRECOVER

1) View Relax-and-Recover log
2) View original disk space usage
3) Go to Relax-and-Recover shell
4) Edit restore script (diskrestore.sh)
5) Continue restore script
6) Abort Relax-and-Recover
#?

gdha commented at 2013-07-11 06:54:

Did you uncomment /lvol1 in the /etc/fstab file on the recovered system? If not, then it is normal that your system requires vg01.

vivekpendse commented at 2013-07-11 09:30:

Thanks for the reply.

When I had taken backup, that time I had mentioned vg & lv to be excluded in /etc/rear/local.conf.
Per your suggestion, I guess we need to comment out /lvol1 in /etc/fstab before backing up if we don't want vg01 on targeted system.

Kindly confirm.

Thanks,
Vivek

gdha commented at 2013-07-11 11:07:

Commenting out on the restored system I meant, /mnt/local/etc/fstab (before
you reboot of course)

On Thu, Jul 11, 2013 at 11:30 AM, vivekpendse notifications@github.comwrote:

Thanks for the reply.

When I had taken backup, that time I had mentioned vg & lv to be excluded
in /etc/rear/local.conf.
Per your suggestion, I guess we need to comment out /lvol1 in /etc/fstab
before backing up if we don't want vg01 on targeted system.

Kindly confirm.

Thanks,
Vivek


Reply to this email directly or view it on GitHubhttps://github.com/rear/rear/issues/271#issuecomment-20799932
.

dagwieers commented at 2013-07-11 23:43:

@gdha This may be something we should fix in Relax-and-Recover, e.g. comment out devices/filesystems in /etc/fstab that we know have been excluded. It seems somewhat related to #22 (modifying /etc/fstab based on known changes), there are probably other modifications required in other situations. Brainstorm !

vivekpendse commented at 2013-07-12 03:28:

Thanks gdha.
You can close this issue.


[Export of Github issue for rear/rear.]