[rear-users] recovery scenario
Tim.Einmahl at kba.de
Tim.Einmahl at kba.de
Fri May 31 15:02:05 CEST 2013
yes, I needed to run a single command.
I now have PRE_RECOVERY_SCRIPT=( "sed -i -e 's/^from.*ssh-rsa/ssh-rsa/g' /root/.ssh/authorized_keys" ) and it works.
I had to put the whole command in "", before that I got sed-failures running "rear recover" although the sed command ran without problems
on the server.
Recovery of a vm to a vm worked well.
Thanks so far!
I also tried to recover a physical server to a vm (I read that the P2V-code from heinlein was added to rear), but when booting the restored server, it get's a kernel panic
I had a look at the dirs and files under /mnt/local after recovery and before rebooting and it seemed to be ok.
Trying to resume from LABEL=SWAP-sda2
Unable to access resume device (LABEL=SWAP-sda2)
Creating root device
Mounting root filesystem
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
Von: rear-users-bounces at lists.relax-and-recover.org [mailto:rear-users-bounces at lists.relax-and-recover.org] Im Auftrag von Schlomo Schapiro
Gesendet: Donnerstag, 30. Mai 2013 16:45
An: Relax-and-Recover users list
Betreff: Re: [rear-users] recovery scenario
On 30 May 2013 16:10, <Tim.Einmahl at kba.de<mailto:Tim.Einmahl at kba.de>> wrote:
There is just one problem left at the moment: I need to run the sed command with a few parameters
before recovering. There is the PRE_RECOVERY_SCRIPT option, but is it also possible to define a command + parameters
in rear that will be run instead of defining a script that then would have to exist on every server?
I am not sure I understand this question. Is your problem that you need to add a script? PRE_RECOVERY_SCRIPT can be anything that you could call on a shell command. If you just need a single command then that will also work. Check https://github.com/rear/rear/blob/master/usr/share/rear/setup/default/01_pre_recovery_script.sh for how this is called. You could add something like this for your sed command:
PRE_RECOVERY_SCRIPT=( sed -i -e "s/foo/bar/" /some/file.txt )
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rear-users