This tutorial shows how you can back up and restore hard drives and partitions with Ghost4Linux. Ghost4Linux is a Linux Live-CD that you insert into your computer; it contains hard disk and partition imaging and cloning tools similar to Norton Ghost. The created images are compressed and transferred to an FTP server instead of cloning locally.
I do not issue any guarantee that this will work for you!
1 Preliminary Note
I’ve tested Ghost4Linux by letting it back up and restore the /dev/sda1 partition of my Ubuntu Edgy Eft desktop. The backups are done via FTP, so we need an FTP server, preferably in our local network because large amounts of data might be transferred. If you don’t know how to set up an FTP server, you can find two examples here:
You need an FTP user plus his password, and make sure that this user’s quota is big enough because the images that are created can be some GB of size, depending on the size and usage of the partitions that you back up.
In this tutorial, my systems are in the 192.168.0.0 network, and I have a DHCP server on my router (192.168.0.1). My Ubuntu desktop is assigned the IP address 192.168.0.213 by the DHCP server. My FTP server has the static IP address 192.168.0.100, the FTP username is exampleuser, his password is Kreationnext.
The DHCP server is optional, all this works with static IP addresses, too.
2 Get Ghost4Linux
First we must download the Ghost4Linux iso image from http://sourceforge.net/projects/g4l and burn it to a CD. At the time of this writing the current version is 0.21, so we download it from one of these mirrors.
3 Configure The FTP Server
“Configure” might be the wrong word, but we must log in to our FTP server (in this tutorial 192.168.0.100) with our FTP user (in this tutorial exampleuser):
Once we are logged in, we use our FTP client to create a directory called img since this is the default directory where Ghost4Linux will store the backups (of course, you can specify a different directory in Ghost4Linux, but I use img in this article):
4 Boot Ghost4Linux
Next we insert the Ghost4Linux CD into the CD drive of the system we want to back up (for example, your Ubuntu desktop) and make the system boot from the Ghost4Linux CD (you might have to change the order of the boot devices in the BIOS so that the computer tries to boot from the CD before the hard drive). Ghost4Linux comes up with this screen. Hit ENTER to boot:
After Ghost4Linux has booted, it shows you a disclaimer, some basic instructions, and some kind of changelog. Hit ENTER each time to proceed:
5 Create A Backup Of A Partition
You should see a command prompt now. Type in
to start the Ghost4Linux menu:
Accept the Ghost4Linux conditions by hitting Yes:
Then select RAW MODE – ANY filesystem, every bit, local+ftp:
Select Network use – Backup/Restore to/from network because we want to store the backups on our FTP server:
You will see the following menu. The correct ethernet device (eth0) should already be selected under menu item A (Select ethernet device), if not, specify the correct one. If you have a DHCP server in your local network, the Ghost4Linux system should have a working IP address already (see menu item C (Set IP address DHCP) – 192.168.0.213 in this example) – if not, you can specify a static IP address under menu item B (Set IP address).
Next go to menu item D (Set IP for FTP server):
Specify the IP address of your FTP server (192.168.0.100 in this tutorial):
Then go to E – Set useridpass option:
Type in your FTP username and password in the form -u username -p password or username:password, e.g. -u exampleuser -p Kreationnext:
If you like you can specify the filename of the backup image under F – Set filename on FTP. If you don’t specify it, Ghost4Linux will use the default filename image.img.gz:
If you like to use a different directory than img (remember, the one we created in chapter 3), you can specify that under P – Change default directory:
Under G – Select compression types you can select the compression of the backup (Lzop, Gz, Bz2, none). I use the default Lzop here:
Finally, we can select H – Backup drive/partition to FTP server:
If you didn’t specify a filename before, you will see this screen. Hit OK:
Select the partition that you want to back up, e.g. /dev/sda1:
Ghost4Linux shows you a summary of your settings. Select Yes to start the backup:
The backup begins, and you should see a progress bar:
After the backup has finished, you will be directed to the main menu again. If you like, you can select T – result after transfer.. to get some statistics about the recent backup:
Afterwards, select X – Reboot machine after finished to reboot the system. Remove the Ghost4Linux CD and boot back into the original system (e.g. your Ubuntu desktop).
If you like, you can start your FTP client again and connect to your FTP server to see if there’s really a backup in the img directory.
6 Restore A Partition
Now let’s assume you have accidentally deleted some data on your /dev/sda1 partition. Happily enough you have a recent backup so that you can restore your partition from that backup. To do so boot from your Ghost4Linux CD again. At the command prompt, type
then select RAW Mode – Any filesystem, every bit, local+ftp:
Choose Network use – Backup/Restore to/from network:
In the main menu, we make a few settings, like in chapter 5. Specify the IP address of the FTP server:
Then specify the FTP username and password:
If the name of the backup image is different from image.img.gz (which is the default value), please specify it under F – Set filename on FTP:
If the name of the image directory is different from img (which is the default value), please specify it under P – Change default directory:
Under G – Select compression types, you must select the same compression type that you chose when you created the backup. So if you created your backup with Lzop, then you must choose Lzop now again:
Finally, go to I – Restore drive/partition from FTP server:
If you didn’t specify the name of the backup image file, you will see this screen. Hit OK:
Select the partition that you want to restore the backup to. We want to restore /dev/sda1, so we select sda1:
The restoration begins, and you will see a progress bar:
The restoration is finished:
You will be directed to the main menu. Select X – Reboot machine after finished to reboot the system. Remove the Ghost4Linux CD from the CD drive and boot the original system (e.g. your Ubuntu desktop). Thanks to the restoration you should now find your files again on the hard disk.
7 Further Backups
If you create further backups (of the same or different hard drive(s)/partition(s)) on the same FTP server in the same image directory (img), make sure that you use unique image file names because otherwise Ghost4Linux will simply overwrite your old backup images. Also make sure that you have enough disk space and sufficient quota for the FTP user on the FTP server.
- Ghost4Linux: http://sourceforge.net/projects/g4l