G4l

From MEPIS Documentation Wiki

Jump to: navigation, search

Contents

Introduction

G4L (Ghost for Linux) is an ncurses-based hard drive imaging solution in the form of a bootable Linux CD that is used as a hard disk and partition imaging and cloning tool. The created images are optionally compressed and transferred to an FTP server or cloned locally.

Although G4L stands for "Ghost for Linux", this is a misnomer; it is not in any way (apart from basic function) like Symantec Ghost, nor is it exclusively for Linux. It can be used to image any type of operating system or filesystem.

Installation

G4L is not installed, actually, but is burned on to a CD so it can work with all drives unmounted. Download the current ISO from the project download page, and then burn the ISO as you would for a MEPIS release. When you are ready to use it, put the CD into a drive and reboot.

Basic Use

G4L has a lot of options, but there are three basic ways it can be used:

  1. To clone one hard drive or partition to another
  2. To create an image file of one hard drive or partition and save to another
  3. To create an image file of one hard drive or partition and save it over a network to an FTP server

Cloning a hard drive

  1. Boot to the G4L CD.
  2. Select the latest kernel. If you have trouble with compatibility, you might need to try an older kernel.
  3. You should see several disclaimers after the system loads. Hit "enter" until you get to a command prompt.
  4. Type "g4l"; select "yes" to accept the disclaimer.
  5. Select "RAW Mode"
  6. Select "Click'n'Clone
  7. Select "Select source", and choose the source drive (the drive you want to copy from)
  8. Select "Select target", and choose the drive you want to copy to.
  9. Select "Click'n'Clone" to begin cloning the drive.

Creating or Restoring a drive image locally

  1. Boot to the G4L CD. Select the newest kernel.
  2. Once everything loads, you will see some disclaimers. Hit "enter" until you get to a command prompt.
  3. Type "g4l" and hit enter to run G4L. Select "YES" to accept the disclaimer.
  4. Select "RAW Mode", then "Local Use"
  5. Select "Pick drive", then choose the drive where the image file will be saved (or where it is located, if you are restoring)
  6. Select "config filename".
    1. If you are backing up, enter the name of the image file you will create.
    2. If you are restoring, enter the name of the image file you want to restore.
  7. Begin the operation
    1. If you are backing up a drive/partition, select "backup". Choose the drive or partition to backup.
    2. If you are restoring, select "restore". Choose the drive or partition you want to restore to.

There are a few other options here for special circumstances. For instance, if you are backing up to a FAT32 or similar partition, you may want to turn on File splitting to avoid going over file size limitations. If you are backing up or restoring an NTFS partition (and only the partition, not the whole drive), you can use NTFSClone backup/restore to save time and space. You can also choose a method of compression to use on the image file; the default, lzop, is recommended.

NOTE: you must restore with the same compression setting you saved with. I recommend putting the compression method in the image file name, e.g. "myharddrive.img.lzop". Also, normal backup/restore is incompatible with NTFSClone backup/restore. If you use NTFSClone, you might want to note that in the filename as well, e.g. "myWindowsDrive.ntfs.img.lzop".

Creating or Restoring an image over the network

  1. Boot to the G4L CD. Select the newest kernel.
  2. Once everything loads, you will see some disclaimers. Hit "enter" until you get to a command prompt.
  3. Type "g4l" and hit enter to run G4L. Select "YES" to accept the disclaimer.
  4. Select "RAW Mode", then "Network Use"
  5. Make sure that "A: Pick device" is set to your network card (usually eth0)
  6. Make sure that "C: Config with DHCP" has received an IP address. Optionally, you can set one manually.
  7. Select "D: Config FTP" and enter the address of your FTP server (if you have DNS running on your LAN, you can just type the name)
  8. Select "E: config useridpass" and enter the username and password for the FTP server as instructed (if your server allow anonymous login, you can skip this step).
  9. Select "F: config filename".
    1. If you are backing up, enter the name of the image file you will create.
    2. If you are restoring, scroll down and locate the name of the image file you want to restore.
  10. By default, G4L puts image files in a folder called "img". If you don't have this folder under the root of the FTP login directory, either create it, or change this setting. In the long run, it's less tedious if you just create the "img" directory.
  11. Begin the operation
    1. If you are backing up a drive/partition, select "backup". Choose the drive or partition to backup.
    2. If you are restoring, select "restore". Choose the drive or partition you want to restore to.

A few notes on this method:

  • If you don't have an FTP server, you can set one up on MEPIS. see FTP.
  • See the notes in the previous section regarding compression types and NTFSClone backups.

Raw Mode versus File Mode

G4L offers the choice of two modes: Raw Mode and File Mode. In Raw Mode, the program copies the data off the hard drive sector by sector. Raw Mode doesn't care what file system is installed on the disk, and so it can be used with any file system. File Mode on the other hand only copies sectors that are in use by the file system. This can be more efficient, but only works with certain file systems, and is more complicated to use.

The File Mode menu actually invokes externally written programs that are included on the G4L disk, including partimage, which backs up partitions, and parted, which is used to edit partitions: creation, deletion, resizing, and so on. Because the programs pointed to by the File Mode menu are external programs, they are not maintained by the author of G4L.

  • Warning: users thinking about using partimage should be very familiar with disk partitioning and how partitions are used by the operating system.

Tips and tricks

  • Before making a raw backup image, zero out the free space on the drive. This will help save space, bandwidth, and time during the imaging process. How you do this depends on the OS you are imaging:
    • On Linux, you create a large file full of zeros that fills up the empty space on the drive. Then delete it. The commands are:
       dd if=/dev/zero of=zerofile.0 || rm zerofile.0
    • On windows, use the "blank6.exe" program supplied on the G4L disc. You run it at a command prompt like this:
      D:\blank6.exe c:\

Pros and Cons

  • G4L by default (Raw Mode) uses bit-for-bit cloning (though the external programs invoked by File Mode can copy only sectors in use by the filesystem). This has the advantage that any filesystem can be copied, and very complex partitioning setups are no problem at all. The disadvantage is that a lot of time and space is wasted cloning "junk" data on logically empty parts of the drive. This can be mitigated by zeroing the empty space on a disk, but it is still less efficient.
  • G4L only needs an FTP server to operate in network mode. FTP servers are simple to setup, but not very secure. Unfortunately, G4L does not work with SFTP, NFS, or SaMBa.
  • G4L does not have an X11 GUI. This makes it more universally compatible, and much faster on older systems. Some users are intimidated by the ncurses interface, however.
  • The externally-written tool provided on the disk to do partition editing, parted, is very powerful but can be difficult to use. Many people choose to use GParted, which is supplied as a bootable CD image like G4L. GParted the program provides a graphical user interface that is much easier to use than parted for most users. GParted is not provided on the G4L disk, and must be downloaded and burned to CD separately.

Help

The best place to go for help with G4L is the G4L SourceForge "help" forum.

Links

Personal tools