#398 Issue closed: Only backup and restore selected VG.

Labels: support / question

cocampbe opened issue at 2014-04-29 18:19:

OK. I have been using rear for over a year and have thankfully have never had to use it. I had done some rudimentery testing when I first set it up, and everything worked great. But I recently did a restore of a test server and had an issue. I use LVM for the OS file systems, and I call the VG vg00. In my local.conf file I have the following.

OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL="nfs://192.168.1.30/var/opt/ignite/rear/"
NETFS_KEEP_OLD_BACKUP_COPY=1
ONLY_INCLUDE_VG=( vg00 )

I am under the impression that this only backs up anything in vg00. But I notice in the backup.log that it also looks like it is trying to backup data that is not in vg00. I have fs's on SAN that I do not need backed up. The mountpoints are /test and /oracle/middleware. But this is seem in the log.

block 21177092: /test/
block 21177093: /test/lost+found/
block 21177094: /test/test2
block 21177095: /oracle/middleware/
block 21177096: /oracle/middleware/lost+found/

test2 above is a file I created. So it looks like it is getting backed up. Also those mountpoints point to multipath devices, which I thought were ignored. It looks like they are, but the fs is still referenced in the disk layout.

fs /dev/dm-2 /test ocfs2 options=rw,_netdev,heartbeat=local
fs /dev/dm-4 /oracle/middleware ocfs2 options=rw,_netdev,heartbeat=local
swap /dev/mapper/vg00-lv_swap uuid=369d10ed-6e53-40cd-848d-fbe8d0233185 label=
logicaldrive /dev/sda 0|A|1 raid=1 drives=1I:1:1,1I:1:2, spares= sectors=32 stripesize=256
smartarray 0

multipath /dev/mapper/fmw /dev/sdd,/dev/sdg,/dev/sdj,/dev/sdm

multipath /dev/mapper/mpathb /dev/sdb,/dev/sde,/dev/sdh,/dev/sdk

multipath /dev/mapper/test /dev/sdc,/dev/sdf,/dev/sdi,/dev/sdl

/dev/dm-4 is /dev/mapper/fmw and /dev/dm-2 is /dev/mapper/test. So the bad part is that the recover wiped the two ocfs file systems and did not restore them. I was looking at EXCLUDE_RECREATE, but for some of my systems; that is going to be a huge pain. I have systems with tens of mountpoints. Is there a way to set this so the disklayout only ever has info vg00. I do not want any type of external SAN devices to be wiped, or recreated.

Also, I am using an older rear version.

Relax-and-Recover 1.13.0-git201209050817 / 2012-09-05

gdha commented at 2014-04-30 14:27:

See /usr/share/rear/conf/default.conf for more details about:

EXCLUDE_MOUNTPOINTS=()
EXCLUDE_MD=()
# NOTE: YOU MUST ALSO EXCLUDE THE CORRESPONDING MOUNTPOINTS IN EXCLUDE_MOUNTPOINTS (see above)
EXCLUDE_VG=()

cocampbe commented at 2014-04-30 15:11:

Thanks for the reply @gdha. I see that option, but it will be cumbersome to maintain. I have some servers with 50 mount points. We add and remove them quite often on development servers. I am looking for a way to not have to maintain the list of mount points in the local.conf file. I want my disklayout file to only have entries related to vg00, or whatever vg I specify.

gdha commented at 2014-04-30 15:15:

you can script this in the local.conf file if you wish (remember local.conf
is nothing more then a bash script too)

On Wed, Apr 30, 2014 at 5:11 PM, Court notifications@github.com wrote:

Thanks for the reply @gdha https://github.com/gdha. I see that option,
but it will be cumbersome to maintain. I have some servers with 50 mount
points. We add and remove them quite often on development servers. I am
looking for a way to not have to maintain the list of mount points in the
local.conf file. I want my disklayout file to only have entries related to
vg00, or whatever vg I specify.


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

cocampbe commented at 2014-04-30 15:16:

Interesting. I actually did not know that. I'll try that out. Thanks!

cocampbe commented at 2014-04-30 19:23:

Thanks for the help @gdha. I added the following lines and it seems to be working. I will have to do some further testing.

EXCLUDE_MOUNTPOINTS=($(df -Pl | grep -v 'vg00|boot|tmpfs|Filesystem' | awk '{print $6}'))
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" )
EXCLUDE_RECREATE+=($(df -Pl | grep -v 'vg00|boot|tmpfs|Filesystem' | awk '{print "fs:"$6}'))

I do not do a lot of bash scripting, so it took some time to figure that out how to use arrays in bash.


[Export of Github issue for rear/rear.]