<< HOWTO-Index
NEW!
Visit my Linux forums!
 This Howto is also available on HowtoForge! If you have also written tutorials, you can publish them there.
Backing
Up And Restoring Your Dedicated Server With SystemImager
Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 06/17/2005
This tutorial is
based on the tutorial "Creating Images Of Your Linux System With SystemImager"
(http://www.falkotimme.com/howtos/systemimager/index.php
and http://www.howtoforge.com/howto_linux_systemimager)
where you can find the basics about how to use SystemImager.
Now let's assume
you have a dedicated Linux server (rented or co-location) that is located in
some provider's data center which is normally a few hundred kilometers away
from your office or home. Now you want to make an image of that system so that
you have a back up in case your server crashes, you accidentally deleted all
you customers' web sites, etc. (I'm sure you have enough fantasy to make up
some horror scenarios for yourself here...). Creating such an image is no problem,
even on a remote system that is in a data center, it is all described in the
"Creating Images Of Your Linux System With SystemImager" tutorial.
But how do you
restore such an image? That's the crucial point. The methods described in the
"Creating Images Of Your Linux System With SystemImager" tutorial
all require that you have physical access to your server and that your server
has a floppy drive or a CD-ROM drive. But your server is a few hundred kilometers
away, and nowadays only few servers have a floppy or CD-ROM drive.
There is a solution,
the only requirement is that your dedicated server has some kind of Linux rescue
system which is a feature that normallly comes with dedicated servers offered
by one of the big web hosting companies. It basically works like this: your hosting
company gives you the login to some kind of control panel where you can see
a lot of information about your server, e.g. traffic consumption in the last
few months, documentation, passwords, billing information, etc. There will also
be a page that lets you select the boot mode of your server, i.e. normal system
boot or rescue system. If you select rescue system, the server will boot into
the rescue system which you can use to repair your normal system. It is similar
to your Linux machines in your office or at home where you use some kind of
Linux live-CD (e.g. Knoppix) to repair your system.
Now in this tutorial
I will demonstrate how to restore an image on your dedicated server on the basis
of a dedicated server that the German hosting company Strato
gave to me 3 months for free in order to write this howto. Many thanks to Strato
for their co-operation!
If you have successfully
tried the methods described here on other hosters' dedicated servers please
let me know! I will mention it here.
This howto is meant
as a practical guide; it does not cover the theoretical backgrounds. They are
treated in a lot of other documents in the web.
This document comes
without warranty of any kind!
1 Booting Your
System Into the Rescue System
First login to
your hosting companies control panel:

Then go to the
page where you can select the boot mode of your server. Choose "Rescue
System" here:

Tick the "Reset"
checkbox. The system will be reset and boot into the rescue system. You will
see the root password for the rescue system in the control panel.

2 Login To Your
Rescue System And Restore Your Image
After a few minutes
you can login to your rescue system via SSH. Login as root
with the password that you got from the control panel.

As you can see
from the image Strato is using a BusyBox
rescue system which is very common on dedicated servers (btw, the SystemImager
autoinstall diskette is also using BusyBox Linux). I have not tested yet, but
the methods described here should work on any other Linux rescue system.
I have created
a little shell
script that automates the task of restoring the image back on your dedicated
server. It connects to the image server and does all the things that the SystemImager
autoinstall diskette would normally do (it has a little drawback though, the
image name must not contain the string "beep"...). Now let's fetch
the script and run it:
cd /tmp/
wget http://www.falkotimme.com/howtos/dedicated_server_backup_restore_systemimager/restore
chmod 755 restore
./restore
The script wants
to know 3 details:
- Please enter your image
server (e.g. 1.2.3.4 or imageserver.example.com): Enter
the IP address or the fully qualified domain name of your image server.
- Please enter the name
of the image to be restored:
- Please enter the ethernet
device you want to use on this system to restore the image (normally eth0):
You should now
see some activity that indicates that the image is being restored (e.g. the
partitioning of your hard disk):

After the script
has finished, go back to the control panel and choose "Normal Boot"
as boot mode and reset the machine:

After a few minutes
you will be able to login to your newly restored server!
3 Further Usage
Of The Restore Script
Do you know this
situation: you have found a hosting company where you want to rent a dedicated
server, but now they tell you that they only offer Linux distribution xyz
on their servers but you would like to have distribution abc,
or you would like to use another version of xyz,
or you do not like the default partitioning on the dedicated server. Normally
you would have to look for another hosting company that offers exactly what
you need, and most often there is no such hosting company, or at a higher price.
There is a solution:
just install your perfect Linux system on a machine in your office or at home,
make an image with SystemImager of it, and install that image on your dedicated
server.
There are 2 things you have to keep in mind if you do this:
- The kernel should
support a lot of hardware because your dedicated server's hardware will normally
differ from the one you used to create the image. So do not use a minimal
kernel that does not know many drivers.
- After you have
installed the image on your dedicated server (and while you are still in
the rescue system!), you have to adjust the network settings of the image
to your dedicated server's needs. I will show how to do this for an image
of a Debian system that has the partitions /dev/hda1
(/) and /dev/hda6
(/var) and uses ext3
on both partitions:
mkdir
/mnt
mount -t ext3 /dev/hda1 /mnt
mount -t ext3 /dev/hda6 /mnt/var
cd /mnt/etc/network/
Now edit the
file interfaces and
adjust your network settings. Then go to your control panel and reboot into
the normal system.
Links
SystemImager: http://www.systemimager.org/
Creating Images
Of Your Linux System With SystemImager: http://www.falkotimme.com/howtos/systemimager/index.php
and http://www.howtoforge.com/howto_linux_systemimager
My Restore Script:
http://www.falkotimme.com/howtos/dedicated_server_backup_restore_systemimager/restore
BusyBox: http://www.busybox.net/
Strato: http://www.strato.de/
NEW!
Visit my Linux forums!
 This Howto is also available on HowtoForge! If you have also written tutorials, you can publish them there.
<< HOWTO-Index
|