LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Backup Remote HardDrive and Restore (https://www.linuxquestions.org/questions/linux-general-1/backup-remote-harddrive-and-restore-529281/)

baddah 02-15-2007 08:38 AM

Backup Remote HardDrive and Restore
 
Hi all,

What is the best way to make an image of a remote server(on a cron monthly basis for instance) and keep the image on an external drive for easy restoration?

i'd like to have a cron making the image every month,to a second harddrive,maybe copy the image over the network to a backup server.And if the drive server crashes,restore the image in the quickest possible manner.I would prefer it if i dont need to worry about filesystems,partition tables,even not formatting if possible etc.

In other words,stick a new harddrive in the server,or a new server.Boot from a live cd with network support and restore the image.

Also i know the command

Code:

dd if=/dev/hda | gzip --fast > hda.img.gz
makes a complete image of the drive.does this mean if the drive is 40GB but only 5GB used(35GB free) it needs 40GB space or 5GB space?

To Restore the image

Code:

gzcat -dc hda.img.gz | dd of=/dev/hdb
Does hdb need to be formatted in this case or not?

Any other suggestions?thanks for any help?

MS3FGX 02-15-2007 08:49 AM

The problem here is that you are going to be attempting to image a drive which is currently in use. Files are changing constantly while the system is running. Making an image of it in that state is either going to outright fail, or it is going to be unusable when you try and restore it.

baddah 02-15-2007 09:00 AM

ok,so the only thing i can really do is sent someone their each month,and let him do the make the image from a live cd?

Is their no way to do it remotely?

Also will the above procedure work in that case?

Thanks for the reply

MS3FGX 02-15-2007 10:02 AM

You could make an image from a live CD, or just use something like G4U/G4L (Ghost for Unix/Ghost for Linux), which will make full disk images and save them onto an FTP server.

You could make full backups of the actual file system remotely, but even then the drive should be mounted read-only during the backup to prevent any files from being changed.

With a little creative partitioning, you should be able to remount / read-only during operation. You would need to move everything that plays host to changing files (for example, /var) to a different partition, and just have the core system on it's own partition. You should then be able to remount it read-only, make the filesystem copy (a compressed tar, for example) and then send that off to a server before mounting it read-write again.

I imagine there are already scripts available to do just that, but I don't know of any off hand.

trickykid 02-15-2007 10:23 AM

Sounds to me like you'd be planning for a Bare Metal Recovery.. Try searching the topic on google which results in many articles and howto's in setting up the best scenario for yourself.


All times are GMT -5. The time now is 11:16 AM.