Can I Use My Linux Box As A 'System Imaging' Server? (i.e., Norton Ghost Server?)

Solution 1:

Yes, Linux can be configured as a boot server for PXE systems, and it's not hard to imagine a USB-thumb-drive, LiveCD, or PXE environment specially configured to image a hard drive to a network target using stock (or near-stock) tools.

You can use PXElinux to configure a basic PXE server. If you have a Linux server handy, you can use that as a base. You'll need BOOTP or DHCP, TFTP, and PXE daemons on the PXE server. On Debian-based systems, you can use the pxe package to supply the PXE daemon.

Regarding client systems, if you're trying to image an OS partition, you need to boot from a different partition than you're trying to image anyway. If you don't want to bother with a full PXE server, you can boot from a Linux LiveCD or USB thumb drive to make your backup images.


Basic concepts and DIY

The basic tools of dd and netcat provide the workhorses for a basic DIY or manual system. The ideal system would add parted or sfdisk for partition detection (and creation on restore), a menu system of some kind, and maybe a server program to automate the backend.

Workflow for image creation:

  1. Boot (USB/CD/PXE)
  2. Examine partitions, select one for imaging, record size
  3. Check that backend target has room
  4. Setup send on client: dd if=/dev/sdXN | gzip -9 | nc -l 9999 (for partition /dev/sdXN)
  5. Start receive on backend: nc x.x.x.x 9999 > IMAGE_NAME.iso.gz

Workflow for image restoration:

  1. Boot (USB/CD/PXE)
  2. Examine partitions, check that one has room, create if necessary
  3. Setup send on backend: dd if=IMAGE_NAME.iso.gz | nc -l 9999
  4. Setup receive on client: nc y.y.y.y 9999 | gunzip | dd of=/dev/sdYM (to partition /dev/sdYM)

(Source for netcat examples; see "Transfering Files" and "Other Examples" sections.)


Partimage does it for you

Partimage can save images files locally or across the network. Partimage's network support includes its own partimaged server, or saving images to a Samba share or NFS drive. Be sure to read through the Partimage manual's Network Support section.

To configure a partimaged server, follow this basic procedure. The tutorial I found recommends downloading the static binary from the partimage homepage. Place it into the /var/partimaged_storage directory created in step 2.

The server is also available in the partimage-server package in Debian/Ubuntu repositories; use them if available. (They'll automate adding the daemon user and setting permissions.) On Debian-based systems, the server configuration can be modified in the /etc/default/partimaged file.

Manual partimaged configuration

  1. Create a new user for the daemon.
    useradd -c "Partimaged User" -s /sbin/nologin -r -M partimag

  2. Create a run directory where the server will run; this will also serve as the default image file storage location. You can change this on the server commandline.
    mkdir /var/partimaged_storage
    chown -R partimag:partimag /var/partimaged_storage
    chmod -R 0700 /var/partimaged_storage

  3. Change to the directory and start the server.
    cd /var/partimaged_storage ; ./partimaged --debug=1
    (uses a default port of 4025; specify --port XXXX to change.)
    (specify --dest /path/to/image/storage to change the location used for image storage.)

Save partitions across the network

  1. Boot (USB/CD/PXE)
  2. Save from client machine to the Partimaged server (no need to specify path to image file):

    partimage --server=x.x.x.x --port=4025 -z1 -o -d save /dev/sdXN IMAGE_NAME.partimg.gz
    

Restore partitions across the network

  1. Boot (USB/CD/PXE)
  2. Restore from client machine (again, no need to specify path to image file):

    partimage --server=x.x.x.x --port=4025 restore /dev/sdXN IMAGE_NAME.partimg.gz
    

(Source for manual partimaged setup and network save/restore examples.)

Solution 2:

What you want is a DRBL Server. Then you can use Clonezilla to backup and restore your drive(s).