Updated Nov 8 2004

The Partimage/G4U Backup Page

 
This page has been produced to assist you with a backup strategy using Partimage and G4U

 


1.   What is Partimage?
2.   Why did you create this page?
3.   What are the limitations?
4.   What software do I need?
5.   How do I download and create the Partimage Boot and Root disks?
6.   What should I do to my Source drive before backing up?
7.   How do I prepare a Backup hard disk for storing the backup files?
8.   I'd like to use HDPARM to speed up the Backup/Restore process
9.   I want to use Partimage to backup my partitions to a locally connected drive
10.  I want to use Partimage to restore my partitions from a locally connected drive
11.  I want to use Partimage to backup/restore a partition to a Network drive
12.  How do I backup/restore my Source hard disk Primary and Extended partition table?
13.  I need to create a new Boot disk with support for my NIC
14.  I'd like to see the Partimage Help file
15.  I'd like to see the Partimaged (Daemon) Help file
16.  I need some more help with ifconfig and other BusyBox commands
17.  I'd like to see some links to Linux documentation, Kernels, Modules and Distributions.
18.  I need help with the mkisofs command
19.  I'd like to add my modified Partimage boot disk to the Partimage Bootable CD-ROM image.
20.  Help!!  I need a quick and hopefully fool proof partimage program source now !!
21.  I'd like some information on Ghost for Unix or g4u
22.  I'd like to zero out (clean) a partition, slice or entire disk before backing up.  I need help
23.  How can I change the partimaged maximum client connection number?
24.  I'd like to use the fully batch mode (-BX) what is the correct context?
25.  I'd like to use the fully batch mode (-BX) and I am getting a delay with the partimage client
26.  Partimage 0.6.4 can't restore MBR if image is bzip2 compressed.  I need help
27.  What are the known bugs for partimage 0.6.4?
 


1.  What is Partimage?
"Partimage is a Linux/UNIX utility which saves partitions in many formats to an image file.
The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example)
The partition can be saved across the network since version 0.6.0"
Partimage authors are Francois Dupoux and Franck Ladurelle
Partimage is freely distributed under the GPL 2 (GNU General Public License)
Here is the Partimage home page
 

<>
2.  Why did you create this page?
Like everything else on ISGSP/Digital Issues, I needed a place to park the information in my head.
I wanted to play around with Linux some more and wanted a "peace of mind" backup strategy so I could confidently do whatever I want
I tried Ghost under MS DOS but silly issues came up.  (lack of file system support)
Partimage is much more flexible and feature rich
BTW.  I'm not a Partimage developer.
I'm simply a friendly power user who like to share
 


3.  What are the limitations?
NTFS isnt fully supported.  (I call that a benefit  :-)  )
Here is a link to the Partimage FAQS
 


4.  What software do I need?
All that you need are two floppies
1.  The Partimage Boot Disk
2.  The Partimage Root Disk
Everything is included on these disks
To use Partimage over the network, you must create your own Partimage Boot disk that includes support for your NIC.  See here
 


5.  How do I download and create the Partimage Boot and Root disks?
You can download the raw images for these disks here
Look for "Boot & Root disks for Partition Image"
After downloading you will need to copy the raw images to a floppy

Under Linux:

Under DOS/Windows: You will need to use a program called Rawwrite written by John Newbigin.  Download it from here


6.  What should I do to my Source drive before backing up
It would be wise to clean out any junk you dont need
It would also be wise to run a file system check on your partitions
Here is an example under Linux
Boot your Linux Box with the bootable CDROM that comes with your distribution
Type        e2fsck -f /dev/hda1        File system check /dev/hda1 -f forces checking.  Use -y to assume yes to all questions
Repeat     e2fsck -f /dev/hda6       Or whatever your other partitions are.  You cannot e2fsck swap or extended
Make sure the e2fsck version isnt too old.
I tried running e2fsck from the Boot/Root disk (V1.19 13 July 2000) on my Ext3 partitions and it killed them
The e2fsck from my Mandrake 8.2 CD is V1.26 3 Feb 2002.  I'm pretty sure this had something to do with it. 

You should also consider zeroing out any drives, slices or partitions as well.
More info here 




7.  How do I prepare a Backup hard disk for storing the backup files?
You will need a hard disk to store your backups
If you want to prepare one with a MS FAT partition go ahead.
I dont do the Microsoft thing anymore so you will have to find out how somewhere else

I will assume you want to prepare a backup disk with a Linux partition
Its really easy, here is how

Create and format the Linux partition
You are going to need to use utilities like FDISK to create the Linux partition
You are also going to need to use tools like MKFS to format the Linux Partition
You can get access to these utilities several ways.
1.  Bootable Linux CDROM
2.  Toms Root Boot Disk

1.  Bootable Linux CDROM
If your computer supports bootable CDROM's, put your Linux CDROM into your drive and boot it up
I used the Mandrake 8.2 CD and hit F1 for more options and type rescue at the prompt
Hopefully your Linux distribution has this sorta rescue option
If you are stuck, there are many floppy and CD based Linux rescue disks with these and many other tools.  Here are some links
 

Choose go to console from the list of options
Type    fdisk/dev/hda    (I am assuming your backup disk is Primary Master)
Type    p     To show the existing partition structure.  (Make your decision now as to what partitions you want to keep or remove)
Type    d     To delete any partitions.  (To delete any existing partitions you no longer need)
Type    n     To start creating a new partition
Type    p     To select a primary partition
Type    1     To select primary partition number 1
Type    1     To enter the starting cylinder (Enter defaults to 1)
Type    x     To enter the size in MB, KB or cylinder (Enter default to last cylinder)
Type    p     To confirm your settings
Type    w    To write the partition table to disk

Formatting the partition with parted
Type     parted                This starts the partition editor parted.
Enter     mkfs 1 ext2        This tells parted to format minor number 1 (in my case, the partition /dev/hda1) using ext2

Your Linux backup disk is ready
 

2.  Toms Root Boot Disk
Tom Oehser is the creator of  TOMSRTBT  "The most GNU/Linux on 1 floppy disk."
This bootable disk contains the tools we need  (And so much more)
Download and create this 1.72MB floppy on a Linux or Window$ box
Ensure your hard disk is connected and boot with TOMSRTBT disk
Follow the on-screen instructions.

Using FDISK to create a primary partition taking up the entire hard disk
Type    fdisk/dev/hda    (I am assuming your backup disk is Primary Master)
Type    p     To show the existing partition structure.  (Make your decision now as to what partitions you want to keep or remove)
Type    d     To delete any partitions.  (To delete any existing partitions you no longer need)
Type    p     To select a primary partition
Type    1     To select primary partition number 1
Type    1     To enter the starting cylinder (Enter defaults to 1)
Type    x     To enter the size in MB, KB or cylinder (Enter default to last cylinder)
Type    p     To confirm your settings
Type    w     To write the partition table to disk

Using MKE2FS to format this new partition
Type     mke2fs /dev/hda1    Uses MKE2FS defaults to create the file system on /dev/hda1

Your Linux backup disk is ready


8.  I'd like to use HDPARM to speed up the Backup/Restore process
HDPARM is a great utility written by Mark Lord to view and manipulate IDE driver parameters
It is included with the Partimage Boot/Root disks and it speed things up very fast
Here is an excellent article regarding HDPARM
If you have an ATA66 or faster hard disk and the hardware to support it, you will notice huge improvements in Backup/Restore times
I'll leave it up to you to read the HDPARM article so you understand what this means
hdparm -X66 -d1 -u1 -m16 -c3 /dev/hda  (This is what my hardware supports. It may not work with yours)
 
 

9.  I want to use Partimage to backup my partitions to a locally connected drive
Put your Linux hard disk you want to backup (Source) on Primary Master
Put your destination disk (backup) on Primary Slave
Boot with the Partimage Boot disk and when asked, the Root disk
Type    mount -t ext2 /dev/hdb1 /mnt    Mount your backup hard disk
If you are unsure of the /dev/hd number, start partimage to see what values are there.  Then exit partimage and start again
Type    partimage                                  Start the partimage application

Use the up down arrow keys and the space bar to select your options
Use F5 to go to the next screen, Exit is F6
Use the tab key to move to the next fields

Use the Up/Down arrow keys to select the partition you want to backup
Use the Tab key to move to "Image file to create/use"
Type    /mnt/name_of _backup    (name_of_backup is the name you choose for the backup.  I suggest including the device name ie linux_hda1)
I also suggest including the extension with the file name.  (IE  linux_hda1.gz or linux_hda1.bz2)
Use the tab key again and ensure "Save partition into a new image file is checked"
Hit F5 to move to the next screen
Select the compression you wish to use.  I personally prefer gzip.  I find bz2 takes too long and isnt much smaller
Check or uncheck your other options if you want
You can choose to split the image into smaller chunks if you want (For floppies, ZIP drives, CD's ...)
Lastly you can choose what happens after the backup is done.
Hit F5 to move through the next screens
Your backup has begun.
Repeat this same process for any other Partitions you want to backup
 


10.  I want to use Partimage to restore my partitions from a locally connected drive
You may be in one of several situations
1.  Your Linux box is slightly pooched, the partitions are still there and you want to restore from backup 1 or more partitions
2.  Your Linux box is more than slightly pooched and you want to re-build your Linux box from scratch using your backups
1.  Your Linux box is slightly pooched, the partitions are still there and you want to restore from backup 1 or more partitions
Not a problem, you will not have to create partitions or file systems
All you should need to do is mount your backup disk and run Partimage
Put your Linux hard disk you want to restore on Primary Master
Put your destination disk (backup) on Primary Slave
Boot with the Partimage Boot disk and when asked, the Root disk
Type    mount -t ext2 /dev/hdb1 /mnt    Mount your backup hard disk
If you are unsure of the /dev/hd number, start partimage to see what values are there.  Then exit partimage and start again
Type    partimage                                  Start the partimage application

Use the up down arrow keys and the space bar to select your options
Use F5 to go to the next screen, Exit is F6
Use the tab key to move to the next fields

Use the Up/Down arrow keys to select the partition you want to backup
Use the Tab key to move to "Image file to create/use"
Type    /mnt/name_of _backup    (name_of_backup is the name you chose for the backup)
Use the tab key again and ensure "Restore partition from a new image file is checked"
Hit F5 to move to the next screen
Repeat this same process for any other Partitions you want to restore

Reboot your machine and cross your fingers
If it doesn't boot, you may need to reinstall your MBR or Boot loader.  See here

2.  Your Linux box is more than slightly pooched and you want to re-build your Linux box from scratch using your backups
Hopefully you can boot your machine with your Linux CD.  I used Mandrake 8.2 CD1 (You can use TOMSRTBT as well)
Boot your box with the Linux CDROM.  (Hit F1 type Rescue)
Type    fdisk /dev/hda    (Type lsparts if your hard disk differs from this)
Type    p        To check your hard disk to ensure if it is clean.
Type    d        To delete any partitions if necessary
Type    n        To add new partitions

You may want to create 1 primary partition, 1 Extended partition, and two logical partitions
The starting cylinder is automatically selected for you.  You can specify the end of the partition in MB (+xxxM) is so desired
You will have to use t (Change partition's system id) to create the swap partition
I cant go into too much detail here sorry.  Here is more information if you need some
The only partition you need to to format or create a file system is the swap partition.  The partitions will be created when restoring.
My swap partition is /dev/hda5
Type    mkswap -c -v1 /dev/hda5     Checks and sets up a version 1 swap space on /dev/hda5.  Search for the mkswap man pages here

Your hard disk is ready to go now
Go up to step 1 now to continue


11.  I want to use Partimage to backup/restore a partition to a Network drive
We will need two computers here.
The Partimage Server    Stores the Partition backup files
The Partimage Client     The computer that is backed up or restored

The Partimage Server
The Partimage Server must have a mounted partition to act as the partition storage area
It does not matter if it is a MSDOS Fat partition or a Linux Ext2 whatever
Here is a procedure to create a Linux partition
Boot your backup machine with the Boot and Root disks
Give your NIC an IP address.        ifconfig device ip_address    (IE  ifconfig eth0 192.168.10.36)
If you need help with the ifconfig command try here first

If you get errors like "SIOCSIFADDR: No such device" this probably means your partimage disks does not have your NIC modules included
To use Partimage over the network, you must create your own Partimage Boot disk that includes support for your NIC.  See here
Ping the client or a known live IP address to confirm connectivity
Use HDPARM to optimize your IDE performance
Now you must mount your partition storage area
Type    mount -t ext2 /dev/hda5 /mnt    (This mounts the ext2 partition /dev/hda5 onto /mnt )
If you dont know what /dev/hda number to use, start partimage to see what drives are present and the letters associated.  Then exit the program

Type    partimaged -D    Starts the partimaged Daemon in Daemon mode and not in the foreground
Now you should be ready to connect with the Partimage Client

If you didn't start the Daemon in Daemon mode your terminal will appear locked on the Partimaged screen
If you want another terminal window, hold together ALT-F2, ALT-F3 or ALT-F4
You can now use ps ef to show the running processes and use kill to shutdown the Daemon if you want
(I would not suggest killing the partimaged daemon during a crucial partition transfer if you have a fondness for your data :-)   )
Please note that for this example we are not using any security (SSL) or any login
The Partimage Client
Boot your machine to be backup up with the Boot and Root disks
Give your NIC an IP address.        ifconfig device ip_address    (IE  ifconfig eth0 192.168.10.36)
Use HDPARM to optimize your IDE performance
Type    partimage    Starts the application

Use the up down arrow keys and the space bar to select your options
Use F5 to go to the next screen, Exit is F6
Use the tab key to move to the next fields

Highlight the partition you want to save or restore
Enter the path to the source    (IE /mnt/hda1.gz)
Select Save partition/Restore partition into/from an image file
Select connect to server and enter the IP address of the Partimage server
If you selected everything correctly the next screen should come up (when you hit F5) without errors
Confirm your settings and cross your fingers
Repeat the process for any other partitions you may have

Reboot your machine and again,  cross your fingers
If it doesn't boot, you may need to reinstall your MBR or Boot loader.  See here
 

I need to re-install the MBR or Boot loader
Method 1
You can use Partimages "Restore an MBR from the image file"
You can choose the entire MBR, only the boot loader or only the partition table
If the source and destination drives are the same, it should be safe to choose the whole MBR
If however they are not the same, I suggest "Only the boot loader"  You will have warnings but It worked fine here

Method 2
Reboot your box with the Linux bootable CD
Mandrake 8.2 for example has an excellent rescue mode
Boot with CD, Hit F1, type rescue, Choose reinstall Boot loader.



12  How do I backup/restore my Source hard disk Primary and Extended partition table?
I placed this information at the bottom of this page since I did not need to use it in my backup strategy
If you have two identical hard disks, you should be able to follow these steps to replicate the MBR and Extended partition table

If however, your disks are of difference types or sizes, it may be wiser (As we did above) to manually create the partitions for the new disk

Either way, here are the Backup and Restore commands for the MBR and Extended table.

Be really careful with your device number (dev/hda) when restoring

 
Backup the Primary partition table
Start a terminal and su to root
Type    dd if=/dev/hda of=backup-hda.mbr count=1 bs=512
This will create a small (512 bytes) file
This file is a copy of the MBR.  Move it somewhere safe.  (Do it now or forever wish you did)
Backup the Extended partition table
Start a terminal and su to root
Type    sfdisk -d /dev/hda > backup-hda.sf    (Dump the partitions of a device in a format useful as input to sfdisk)
This will create a small (344 bytes) file
This file is a copy of the Extended partitions.  Move it somewhere safe.  (Do it now or forever wish you did)
 
Restoring  the Primary partition table
Start a terminal and su to root
Type    dd if=backup-hda.mbr of=/dev/hda
This will write the file backup-hda.mbr to the MBR of /dev/hda
Be very, very carefull that you ensure you have the correct device name.
 
Restoring the Extended partition table
Start a terminal and su to root
Type    sfdisk /dev/hda < backup-hda.sf
Be very, very carefull that you ensure you have the correct device name
 
 


13.  I need to create a new Boot disk with support for my NIC
This is pretty easy if you have a fairly recent Linux Box
You are going to have to download the kernel source and compile a new kernel.  Cool !

If this is a bit overwhelming or confusing for you, I have a raw image that includes the modules for 3coms 3c509/3c529 "Etherlink III", 3c590/3c900 "Vortex/Boomerang" and NE2000/NE1000 NICS
In our lab these cards are pretty popular.  It seems to work well.  If you have these NICs, feel free to download it here (940KB)

<>Ok lets get back to the harder way.
First you need the Kernel Source.  I used 2.4.18 found here
This is a quick rundown on my Mandrake 8.2 machine
It helps if you also have the "Config" file. 
Look for partimage-bootdisk-2.4.18-x.conf  from here
Use bzip2, bunzip2 and tar to decompress the Kernel source
CD to the Linux directory just created
Now we are ready to compile.  I prefer to use the GUI. (Ok, I'm a self admitted lazy person.  Plus I haven't figured out how to open and modify a config file before compilation yet)
su to root
Type     make xconfig                            Starts an X windows based configuration tool
Click Load Configuration from file and type the exact path to the Partimage Boot disk config file...
Click Network Device Support
Ensure Y is checked for Network device support
Scroll down to Ethernet (10 or 100Mbit) or (Ethernet 1000 Mbit) and click
Now scroll down to your NIC module name.  Select Y  Use help to confirm
Now choose save and exit.
Dont try to select a whole bunch of NICS, the final compile it wont fit on a floppy (I tried)
Type    make dep                                This sets up the dependencies
Type    make bzImage                        This created a compressed Kernel called bzImage
Type    cd  arch/i386/boot                   CD to the directory containing bzImage
Type    rdev bzImage /dev/fd0            Set the image root device of bzImage to /dev/fd0  Search for the rdev man pages here
Type    rdev -r bzImage 49152            Sets the bzImage ram size
Type    rdev -R bzImage 0                  Sets the bzImage root flag
Type    dd if=bzImage of=/dev/fd0       Reads bzImage and outputs to /dev/fd0  (Makes your floppy)

Your Partimage Boot disk should be ready.  Boot it and try it out
During the booting of the Partimage Boot disk you should see details about NIC module in the log
You can type dmesg to repeat these Daemon messages
The real test for NIC functionality is to give it an IP address and try to ping a known working IP
Type    ifconfig eth0 192.168.10.1        Change the IP for your network
Type    ping 192.168.10.50                  Ping an IP on your network.  A good ping will say x.x.x.x is alive!
If you need help with the ifconfig command try here first
 


<>14.  I'd like to see the Partimage Help file
===============================================================================
Partition Image (http://www.partimage.org/) version 0.6.4 [stable]
---- distributed under the GPL 2 license (GNU General Public License) ----

Supported file systems:....ext2fs, reiserfs, fat16, fat32, ntfs(exp), hpfs

usage: partimage [options] <action> <device> <image_file>
       partimage <imginfo/restmbr> <image_file>

ex: partimage -z1 -o -d save /dev/hda12 /mnt/backup/redhat-6.2.partimg.gz
ex: partimage restore /dev/hda13 /mnt/backup/suse-6.4.partimg
ex: partimage restmbr /mnt/backup/debian-potato-2.2.partimg.bz2
ex: partimage -z1 -om save /dev/hda9 /mnt/backup/win95-osr2.partimg.gz
ex: partimage imginfo /mnt/backup/debian-potato-2.2.partimg.bz2
ex: partimage -a/dev/hda6#/mnt/partimg#vfat -V1440 save /dev/hda12 /mnt/partimg/redhat-6.2.partimg.gz

Arguments:
* <action>:
  - save: save the partition datas in an image file
  - restore: restore the partition from an image file
  - restmbr: restore a MBR of the image file to an hard disk
  - imginfo: show informations about the image file
* <device>: partition to save/restore (example: /dev/hda1)
* <image_file>: file where data will be read/written. Can be very big.
                For restore, <image_file> can have the value 'stdin'. This allows
                for providing image files through a pipe.

Options:
* -z,  --compress      (image file compression level):
  -z0, --compress=0    don't compress: very fast but very big image file
  -z1, --compress=1    compress using gzip: fast and small image file (default)
  -z2, --compress=2    (compress using bzip2: very slow and very small image file):
* -c,  --nocheck       don't check the partition before saving
* -o,  --overwrite     overwrite the existing image file without confirmation
* -d,  --nodesc        don't ask any description for the image file
* -V,  --volume        (split image into multiple volumes files)
  -VX, --volume=X      create volumes with a size of X MB
* -w,  --waitvol       wait for a confirmation after each volume change
* -e,  --erase         erase empty blocks on restore with zero bytes
* -m,  --allowmnt      don't fail if the partition is mounted. Dangerous !
* -M,  --nombr         don't create a backup of the MBR (Mast Boot Record) in the image file
* -h,  --help          show help
* -v,  --version       show version
* -i,  --compilinfo    show compilation options used
* -f,  --finish        (action to do if finished successfully):
  -f0, --finish=0      wait: don't make anything
  -f1, --finish=1      halt (power off) the computer
  -f2, --finish=2      reboot (restart the computer):
  -f3, --finish=3      quit
* -b,  --batch         batch mode: the GUI won't wait for an user action
* -BX, --fully-batch=X batch mode without GUI, X is a challenge response string
* -y,  --nosync        don't synchronize the disks at the end of the operation (dangerous)
* -sX, --server=X      give partimaged server's ip address
* -pX, --port=X        give partimaged server's listening port
* -g,  --debug=X       set the debug level to X (default: 1):
* -n,  --nossl         disable SSL in network mode
* -S,  --simulate      simulation of restoration mode
* -aX, --automnt=X     automatic mount with X options. Read the doc for more details
* -UX  --username=X    username to authenticate to server
* -PX  --Password=X    password for authentication of user to server
===============================================================================


15.  I'd like to see the Partimaged (Daemon) Help file
===============================================================================
Partition Image Daemon (http://www.partimage.org/) version 0.6.4
---- distributed under the GPL 2 license (GNU General Public License) ----

usage: partimaged [options]

Options:
* -h,  --help            show help
* -v,  --version         show version
* -d,  --dest            destination directory
* -pX, --port=X          server's port listening (defaults to 4025)
* -D,  --daemon          start in daemon mode, not foreground
* -i,  --compilinfo      show compilation options used
* -r dir, --chroot dir   use chroot to improve security
* -g, --debug=X          set the debug level to X (default: 1)
* -L, --nologin          disable login from clients
================================================================================

16.  I need some more help with ifconfig and other BusyBox commands
The ifconfig command included with partimage and many other miniaturized linux distributions comes from the BusyBox tool set.
A reference for all the included BusyBox commands can be found here
In the past, when you typed ifconfig you got all kinds of great feedback about your NIC's
It is perfectly normal to now see this when you type ifconfig  "ifconfig: ifconfig was not compiled with interface status display support"
(Note to self:  Try to fix the ifconfig thingy)

If you type ifconfig eth0 192.168.10.35, I believe the subnet mask defaults to a Classfull 255.255.255.0
I'm honestly not entirely sure how to specify a IP address without a Classfull subnet mask
I have tried these
ifconfig eth0 192.168.10.35/16
ifconfig eth0  netmask 255.255.0.0
The command is accepted but I cant seem to figure out how to test if it worked.  Pinging still works ...  Can you help?

If this Classfull subnet mask stuff is too confusing, you probably dont have to worry about it

If you need more TCP/IP documentation, 3COM has a great PDF called Understanding IP Addressing.  Check it out here



17.  I'd like to see some links to Linux documentation, Kernels, Modules and Distributions.
Here is a page that may help



18.  I need help with the mkisofs command

Here is a page that may help


19.  I'd like to add my modified Partimage boot disk to the Partimage Bootable CD-ROM image.
Here is a page that may help


20.  Help!!  I need a quick and hopefully fool proof partimage program source now !!
Ok, so you may have already tried the partimage boot and root disks and they dont have support for your NIC
Or, you have a laptop, PCMCIA NIC, with/without floppy/CDROM drive
What ever the case, I know what it is like to need a solution but not have the time to learn from the ground up
Dont worry !!
There are several ready to go linux distributions on CD-ROM available in ISO format
Some even have partimage already installed
Some of these CD-ROMs have support for multiple NICS, hardware, PCMCIA ... all ready to go
Just download the ISO image, burn it to CD and boot your computer from the CD
If your computer doesnt support CD-ROM booting, no problem.  Just read the documentation to create a CD-ROM boot disk and away you go

Here's a few to check out
System Rescue CD http://www.sysresccd.org/
KNOPPIX  http://www.knoppix.org/
Timo's Rescue CD Set  http://rescuecd.sourceforge.net/
Make CD-ROM Recovery  http://mkcdrec.ota.be/

My personal favourite Bootable CDROM so far is Knoppix
This amazing Linux CD has a huge amount of programs including partimage.
It takes little time to boot and has hardware support for every machine I have thrown at it (Including laptops)
It's a full Linux Distro with KDE and tonnes of programs so its a hefty download
As of October 2004, under Knoppix, the partimage daemon is compiled with "Users Must Login".  Doh !!
This makes things tricky since the Knoppix file system is on CD-ROM (read only)
I get errors like this

Connexion refuse by server:
incompatibles networking
options. Try disabling login
option for server with '-L'

I have not figured out how to create the required partimagedusers file yet.
I'm hoping a newer version of Knoppix has this sorted out

In the meantime, why not use the precompiled static partimage binaries?
These partimage static binaries are compiled with the Login and SSL disabled
Simply download,decompress and execute them

Here is an example where the precompiled static partimage binaries helped out.
I received an email from Diego Algorta Casamayou
He has a MicroNotebook Sony VAIO PCG-505TS
The Sony has PCMCIA Lan, floppy but no CD-ROM
One solution would be to recompile the partimage boot disk kernel to support PCMCIA and his NIC.  (Lots of work but fun to learn)
I suggested using Tom Oehser's TOMSRTBT as a platform to see if his PCMCIA NIC is seen and it worked
Then I suggested copying some older pre-compiled binaries I had posted on this site
Diego discovered the binaries created Segmentation faults so he went with the more current static binaries
It worked quite well

So here is a verified step by step;

Download the files
Download partimage-0.6.4-static.tar.bz2.
You can browse for this file here

Decompress the file under *nix
#bzip2 -d partimage-0.6.4-static.tar.bz2
#tar xvf  partimage-0.6.4-static.tar

Get partimaged onto your server
Get partimaged onto your server using what ever means you need
In my case, I used WinSCP to copy the file over to a machine running Knoppix to be my partimage server

Get partimage onto your client
In my case, I used both a floppy and wget under TOMSRTBT to get partimage to the client

FLOPPY under DOS
If you chose to download partimage-0.6.4-static.tar.bz2, the decompressed partimage client is 1464048 bytes
You will have to compress it to fit it onto a 1.44MB floppy.
#gzip partimage
Copy partimage.gz to a floppy
Place the floppy in the TOMSRTBT client
mount -t msdos /dev/fd0 /mnt
cp /mnt/partim~1.gz /tmp/partimage.gz  (Note DOS renamed the file to partim~1.gz)
umount /mnt

WGET
You can optionally use WGET to get the partimage binary from a Web (HTTP) or FTP server
I used wget -O partimage.gz ftp://192.168.10.254:21/outgoing/partimage.gz
Under tomsrtbt type man wget for more information

Some final steps
#cd /tmp
#gzip -d partimage.gz
#chmod u+x partimage
#./partimage

For convenience,  I've seperated these statically compiled partimage-0.6.4 binaries into two files
partimage.gz and partimaged.gz
You will have to adjust the instructions above slightly to get these onto your server and client

Update - Nov 7 2004
I've finally built a Partimage development box to compile my own binaries.
It was a bit tricky getting all the pieces to fit together but it's done
If anyone is interested, I have a 163 MB G4U image of my Debian 2.2.20 Partimage development machine.
I can make the image and the instructions to get the image to a hard disk available to any that ask
Here's some Debian related setup notes:

dselect        Debian package handling front end

base-config    Debian base system configuration
apt-setup      Interactive program for apt sources
apt-setup will prompt for proxy settings if proxy settings are not already stored in /etc/apt/apt.conf

With this development box I compiled my own binaries with the following options
Version 0.6.4
- CURRENT_IMAGE_FORMAT=0.6.1
- USERS DON'T LOGIN
- PARTIMAGED_USERS not used
- SSL DISABLED
- CHEUID DISABLED
I also compiled with the --enable-all-static so there are no library dependancies
I tested both the client and server under Tomsrtbt and Knoppix and they work great

Here they are partimage.tar.gz and partimaged.tar.gz


21.  I'd like some information on Ghost for Unix or g4u
Do you want to backup/restore a x86 based hard disk, over the network using FTP?
How about independant of the OS?
Ghost for Unix is your answer
This program rocks http://www.feyrer.de/g4u/
Normally I'd feel obligated to write up a page on how to use it ...
G4U was so easy to use that it needs no explanation


22.  I'd like to zero out (clean) a partition, slice or entire disk before backing up.  I need help
I recently experienced this and it really makes a huge difference
If  you do not do a full format on any newly created slices or partitions, old hard disk data will remain
Although the old data is virtually useless, it will still be read by your backup utility and included with the final image
Here are two examples

Example 1
I have a 3.2GB hard disk with a single fat 32 partition.
I fill the entire partition with data
I then installed a full distribution of FreeBSD 4.7
During the install I asked the FreeBSD Fdisk and Disklabel editor to delete the fat 32 partition and use the entire disk
FreeBSD was installed and functions great
When I used G4U to back up this hard disk, the resulting file size was 2.438 GB

Example 2
http://www.bris.ac.uk/is/services/computers/general/disposal/data_erase.htm
Using the same hard drive, I used the excellent IBM utility "Wipe" to write zero's the hard drive
Under Linux, Unix you could use something like dd if=/dev/zero of=/dev/hda bs=1024
I then installed the exact same FreeBSD distribution using the exact same procedure
I used G4U to back up this hard disk and this time the resulting file size was 255 MB
Wow !  Try getting 2.4 GB on a CDROM for backing up
The point here is this;
If during the installation of your operating system any unused (or perhaps used) hard disk space is not formatted, it will still contain data
G4U doesnt care about the data and will back it up, clogging your image

Ideally you can wipe your drive clean before the installation of your operating system.
If however you cannot, you can use some simple tools to find empty/unused blocks and fill them with zeros

I borrowed this from Hubert Feyrer, the author of G4U

"Effectively, you just fill up the disk's unused blocks with zero-bytes. Open file for writing, stuff in 0-bytes until the disk is full, then close the file and remove it.
The result is that all unused blocks were used by the file, and filled with data that g4u can then compress easily.
Usually the operating system will just mark the blocks as unused, without changing the actual data content."

Hubert outlines some simple commands/scripts/programs that find empty/unused blocks and fill them with zeros

It is important to note that these tools will only find and fill empty/unused blocks of existing partitions

Lets say you have a 20GB disk. 
It was once completely filled with an operating system. 
You have chosen to delete all partition data (deleted, not wiped or zeroed) and create a single 10GB partiton for whatever OS is your fancy
This could be a single Fat32, NTFS or FreeBSD slice ... whatever
Once your new operating system is installed, you can run one of the many tools to find empty/unused blocks and fill them with zeros.
Great, your 10GB partition is ready for backing up.  But what about the rest of the 20 GB drive?
You have not created a partition, thus these tools cannot see it, and wont work ...yet
I'd suggested creating another partition equal to the size of the rest of the disk
For simplicity, create a partition type matching the operating system on the first 10 gig of your drive
Now run the tools on this new partition to find empty/unused blocks and fill them with zeros
Then optionally, delete the partition
Now you can be sure that the entire drive's empty/unused blocks are filled with zeros

23.  How can I change the partimaged maximum client connection number?
I borrowed this information from partimage-users@lists.sourceforge.net

There is the "symbol" MAX_CLIENTS defined in the /src/server/partimaged.h file
This constant limits the maximum number of allowed clients and is set to 15.
I have set it to 50 and enclosed the patch to the 0.6.2 below.
You just have to apply the patch and compile the sources again.

One could also add an command line switch to change the maximum number of allowed clients dynamically.

> ------------- snip ----------------
>
> --- partimaged.h 2002-10-24 22:36:42.000000000 +0200
> +++ partimaged.h.new 2003-04-03 09:38:30.000000000 +0200
> @@ -22,7 +22,7 @@
> #include "pathnames.h"
>
> #define BUFFER_LEN BUFFER_SIZE
> -#define MAX_CLIENTS 15
> +#define MAX_CLIENTS 50
> #define SERVER_LISTEN_PORT 4025
>
> extern bool g_bBeDaemon;
>
>
> ------------- snip ----------------


24. I'd like to use the fully batch mode (-BX) what is the correct context?
I borrowed this comment from DW, a guest on the partimage forum. Thanks DW

"I don't think that the value for the -B option does anything, but it does need to be there.
In other words you need to use -B=something , but partimage does not seem to care what "something" is."

Here's a line that works for me
partimage save -z1 -m -b -B=foo -f3 -d -o -s192.168.10.183 /dev/hda1 /backup.gz


25. I'd like to use the fully batch mode (-BX) and I am getting a delay with the partimage client
I met a friend by the name of Grzegorz who asked me about this via email
After typing something like this
partimage save -z1 -m -b -B=foo -f3 -d -o -s192.168.10.183 /dev/hda1 /backup.gz
He discovered partimage takes several minutes to start.
The partimage client will pause at "partimage: status: initializing the operation. Please wait"
Using the GUI with the same parameters, the initialization takes a few seconds.
I noticed fully-batch-mode.patch in the partimage-0.6.4-1 sources patch directory.
This patch had already been applied to these sources so I figured it would be fun to try a compile
Well the resultant binaries worked flawlessly and with no delay time.
(Grzegorz was really happy)
Here they are if you want to give them a try


26. Partimage 0.6.4 can't restore MBR if image is bzip2 compressed. I need help
Jheyu sent me an email regarding this. Thanks Jheyu
According to partimage 0.6.4 partimage-0.6.4/BUGS
"partimage can't restore MBR if image is bzip2 compressed"

Patch file partimage-0.6.4/patches/error_less.diff now adds this to the partimage screen as you are creating a bz2 image
"Because of a bug, you won't be able to restore MBR from any bzip2 compressed image unless you manualy run bzip2 -d on them"

On 11/08/2004 I tried this an I could not get past this error. "Can't read block zero from image"
My only solution was to decompress my bzip2 image and recompress it with gzip
From there I was able to restore an MBR


27. What are the known bugs for partimage 0.6.4?

* when using compression, the volumes sizes are a little bigger than the need
size (FIXED for gzip compression)(FIXED but files are far too small)

* some avail space problems

* if the link between server and a client fails for any reason, client
and/or server *may* die.

* partimage imginfo imagefile fails on wrong permissions but with wrong message
'can't find compression level' instead of 'permission denied'

* partimage doesn't rightly detect end of space so corrupts images maid with
compression. Image seems correct but restoring fails with 'invalid magic'.
This doesn't affect non compressed images nor multivolume images based on
size spliting.

* partimage can't restore MBR is image is bzip2 compressed

Home                   Back

If you find an error or wish to comment please let me know