Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Update system backup source during rescue image's bootup? #751

Closed
yin747 opened this issue Jan 5, 2016 · 4 comments
Closed

Question: Update system backup source during rescue image's bootup? #751

yin747 opened this issue Jan 5, 2016 · 4 comments
Assignees

Comments

@yin747
Copy link

yin747 commented Jan 5, 2016

Is it possible to change the system recovery source to new one (ie: file///share --> nfs://xxx/yy, when we boot the rescue image.

@gdha gdha self-assigned this Jan 5, 2016
@gdha
Copy link
Member

gdha commented Jan 5, 2016

The answer was already mentioned in issue #750 - before running rear recover edit the local.conf file and change the BACKUP_URL variable.

@schlomo
Copy link
Member

schlomo commented Jan 5, 2016

Or, as mentioned in #750, use Bash code in local.conf to decide the content of BACKUP_URL while ReaR runs. E.g. something like this:

if [[ "$WORKFLOW" == "recover" ]] ; then
    BACKUP_URL=nfs://server/path
else
   BACKUP_URL=file:///local/dir
fi

@0xkakuki
Copy link

0xkakuki commented Jan 6, 2016

To make the ISO image generated for local restore also usable in NFS recover condition, you need to add the 'mount.nfs' 'umount.nfs' to PROGS variable. Then boot the restore system with "Recover " menuentry and proceed the restore manually. For example:

BACKUP_URL=file:///mnt/
PROGS=("${PROGS[@]}" 'mount.nfs' 'umount.nfs')

As these two files will not be included in the boot image under the 'file' schema.

I'm also trying Schlomo's method hoping that it can automate the whole procedure.

Regards,
Kakuki

@0xkakuki
Copy link

0xkakuki commented Jan 6, 2016

Hi,

With Schlomo's suggestion, it works like a charm. Here are my rear settings:

# cat /etc/rear/local.conf | grep -v ^#

OUTPUT=ISO
BACKUP=NETFS

PROGS=("${PROGS[@]}" 'mount.nfs' 'umount.nfs')
if [[ "$WORKFLOW" == "recover" ]] ; then
    BACKUP_URL=nfs://192.168.56.1/storage
else
    BACKUP_URL=file:///mnt/
fi

SSH_ROOT_PASSWORD="hello123"
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/media' '/var/tmp' '/var/crash')
NETFS_KEEP_OLD_BACKUP_COPY=no

Thanks,
Kakuki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants