Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Back Up/Restore Hard Drives And Partitions With Ghost4Linux


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:

  • http://www.Kreationnext.com/proftpd_mysql_virtual_hosting
  • http://www.Kreationnext.com/pureftpd_mysql_virtual_hosting

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):

1

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):

2

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:

5

After Ghost4Linux has booted, it shows you a disclaimer, some basic instructions, and some kind of changelog. Hit ENTER each time to proceed:

7

8

9

5 Create A Backup Of A Partition

You should see a command prompt now. Type in

g4l

to start the Ghost4Linux menu:

10

Accept the Ghost4Linux conditions by hitting Yes:

11

Then select RAW MODE – ANY filesystem, every bit, local+ftp:

12

Select Network use – Backup/Restore to/from network because we want to store the backups on our FTP server:

13

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).

14

Next go to menu item D (Set IP for FTP server):

15

Specify the IP address of your FTP server (192.168.0.100 in this tutorial):

16

Then go to E – Set useridpass option:

17

Type in your FTP username and password in the form -u username -p password or username:password, e.g. -u exampleuser -p Kreationnext:

18

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:

19

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:

20

Under G – Select compression types you can select the compression of the backup (Lzop, Gz, Bz2, none). I use the default Lzop here:

21

Finally, we can select H – Backup drive/partition to FTP server:

22

If you didn’t specify a filename before, you will see this screen. Hit OK:

22a

Select the partition that you want to back up, e.g. /dev/sda1:

23

Ghost4Linux shows you a summary of your settings. Select Yes to start the backup:

24

The backup begins, and you should see a progress bar:

25

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:

26

27

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).

28

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

g4l

then select RAW Mode – Any filesystem, every bit, local+ftp:

29

Choose Network use – Backup/Restore to/from network:

30

In the main menu, we make a few settings, like in chapter 5. Specify the IP address of the FTP server:

31

32

Then specify the FTP username and password:

33

34

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:

35

If the name of the image directory is different from img (which is the default value), please specify it under P – Change default directory:

36

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:

36a

Finally, go to I – Restore drive/partition from FTP server:

37

If you didn’t specify the name of the backup image file, you will see this screen. Hit OK:

37a

Select the partition that you want to restore the backup to. We want to restore /dev/sda1, so we select sda1:

38

The restoration begins, and you will see a progress bar:

39

The restoration is finished:

40

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.

41

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

Comments

comments