LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Live restore remotely? (https://www.linuxquestions.org/questions/linux-newbie-8/live-restore-remotely-4175521726/)

Almaz 10-10-2014 05:34 PM

Live restore remotely?
 
Is there a software to do a complete live restore on a running debian system?

jlinkels 10-10-2014 09:47 PM

It is not completely clear on which system you will do the restore. On the second machine that you mention? What runs on the restore target? Do you restore over the running Debian?

If you restore on a machine running the same kernel version:
- make sure you partioning scheme is the same as in the backup
- get the disk UUID's on the target and modify etc/fstab in the backup
- delete any network settings in etc/udev/rules.d/70-persistent-net
- do restore /dev on the target
- skip /sys and /proc if they happen to be included in the backup

Then overwrite the running target with your backup.

I hope the boot record on the target is the same as on the original. If it is not, you should mount the partition holding the backup, chroot into the backup and do a grub-install on the boot disk of the target. This is what I normally do when I restore a backup on a new hard disk, but then I boot from a live version. I prefer not to do it on a remote machine tough.

jlinkels

Almaz 10-10-2014 09:52 PM

Quote:

Originally Posted by jlinkels (Post 5252148)
It is not completely clear on which system you will do the restore. On the second machine that you mention? What runs on the restore target? Do you restore over the running Debian?

If you restore on a machine running the same kernel version:
- make sure you partioning scheme is the same as in the backup
- get the disk UUID's on the target and modify etc/fstab in the backup
- delete any network settings in etc/udev/rules.d/70-persistent-net
- do restore /dev on the target
- skip /sys and /proc if they happen to be included in the backup

Then overwrite the running target with your backup.

I hope the boot record on the target is the same as on the original. If it is not, you should mount the partition holding the backup, chroot into the backup and do a grub-install on the boot disk of the target. This is what I normally do when I restore a backup on a new hard disk, but then I boot from a live version. I prefer not to do it on a remote machine tough.

jlinkels


I guess I wasn't clear. I'd like to do a complete restore of the computer remotely over ssh. Is it possible in linux? For example in windows Acronis True Image allows to do a complete restore on it's own machine even remotely. Can rsync to do a live restore of the whole system?

JeremyBoden 10-11-2014 06:33 AM

rsync can't do a backup of a running system because some of the files are locked.
However, you can boot a live CD and then successfully run a rsync of your disk system.
I actually do this as part of my backup strategy.

I would imagine (not tried it yet(!)) that you could do a restore in the same way.

jlinkels 10-11-2014 07:04 AM

Quote:

Originally Posted by JeremyBoden (Post 5252266)
rsync can't do a backup of a running system because some of the files are locked.

Exactly which files are locked? This is not Windows. Not a single file is locked but database files like Postgresql or MySQL can be inconsistent when backed up on file level.

Quote:

Originally Posted by Almaz
I guess I wasn't clear. I'd like to do a complete restore of the computer remotely over ssh. Is it possible in linux? For example in windows Acronis True Image allows to do a complete restore on it's own machine even remotely. Can rsync to do a live restore of the whole system?

Yes it can. Contrary to Windows there a no magic files being locked or inaccessible. In Windows you need special agents to perform read or write and even then it can fail.
The only risk is what I said inconsistent database files. You'd need to make a database dump before backup and copy that dump file. During restore both database files and dump are restored. In case the database was corrupted you can restore it from the dump.
Now keep in mind that rsync works on the file level. If you damage your installation on the file level this can be restored. If you damage something more significant like your MBR or partition tables, you can't expect rsync to repair that.

jlinkels

jefro 10-11-2014 05:15 PM

I think I've only seen one "live state" backup for linux. It's a commercial product.


All times are GMT -5. The time now is 03:43 PM.