G4l
From MEPIS Documentation Wiki
Contents |
Introduction
G4L (Ghost for Linux) is an ncurses-based hard drive imaging solution in the form of a bootable Linux CD. Although it 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.
Basic Use
G4L has a lot of options, but there are three basic ways it can be used:
- To clone one hard drive or partition to another
- To create an image file of one hard drive or partition and save to another
- 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
- Boot to the G4L CD.
- Select the latest kernel. If you have trouble with compatibility, you might need to try an older kernel.
- You should see several disclaimers after the system loads. Hit "enter" until you get to a command prompt.
- Type "g4l"; select "yes" to accept the disclaimer.
- Select "RAW Mode"
- Select "Click'n'Clone
- Select "Select source", and choose the source drive (the drive you want to copy from)
- Select "Select target", and choose the drive you want to copy to.
- Select "Click'n'Clone" to begin cloning the drive.
Creating or Restoring a drive image locally
- Boot to the G4L CD. Select the newest kernel.
- Once everything loads, you will see some disclaimers. Hit "enter" until you get to a command prompt.
- Type "g4l" and hit enter to run G4L. Select "YES" to accept the disclaimer.
- Select "RAW Mode", then "Local Use"
- Select "Pick drive", then choose the drive where the image file will be saved (or where it is located, if you are restoring)
- Select "config filename".
- If you are backing up, enter the name of the image file you will create.
- If you are restoring, enter the name of the image file you want to restore.
- Begin the operation
- If you are backing up a drive/partition, select "backup". Choose the drive or partition to backup.
- 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
- Boot to the G4L CD. Select the newest kernel.
- Once everything loads, you will see some disclaimers. Hit "enter" until you get to a command prompt.
- Type "g4l" and hit enter to run G4L. Select "YES" to accept the disclaimer.
- Select "RAW Mode", then "Network Use"
- Make sure that "A: Pick device" is set to your network card (usually eth0)
- Make sure that "C: Config with DHCP" has received an IP address. Optionally, you can set one manually.
- 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)
- 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).
- Select "F: config filename".
- If you are backing up, enter the name of the image file you will create.
- If you are restoring, scroll down and locate the name of the image file you want to restore.
- 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.
- Begin the operation
- If you are backing up a drive/partition, select "backup". Choose the drive or partition to backup.
- 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.
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:\
- 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:
Pros and Cons
- G4L by default uses bit-for-bit cloning (though certain modes can read the filesystem and only copy files). 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, SSH, 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.

