Partition Image Operation Steps

complete documentation at
PartImage.org

See New Generation No activity since 2010 dedicated site no longer available

Partimage 0.6.8 is included on the SystemRescueCD
which includes remote file system support for Samba(CIFS, MS windows) and NFS (Network File Systems)
and defaults to requiring a login and SSL. Use --noSSL and --noLogin if desired.

no activity since 2010-07-25 V0.6.9

file-server mode

Using a linux system to store the image.
  1. At the file-server
    1. Prepare destination

      For backing up to a local MS Windows volume
      ( after booting a live CD like SystemRescueCD)

      1. Check the list of the partitions:
            fdisk /dev/hda
            print
            quit
        
      2. Make a directory for a "mount point"
         mkdir /mnt/images
      3. mount the partition with the MS windows target volume on the "mount point"
         mount /dev/hda9 /mnt/images
        

    2. Check the available space on the volume
       df   /mnt/images
    3. Verify what is there is what you expect!
       ls -ltr /mnt/images  | more
    4. Make sure the volume is writable
       touch  /mnt/images/`date +%y-%m-%d_%H:%M`.laBerlin
    5. Establish authorization for saving user
       adduser partimage
    6. Verify that the user has write access to the volume for storage of the image
      su partimage 
      touch /images/0_partImages
      exit
      
    1. At the Client being saved
      1. mkdir /mnt/partimgVault
      2. prepare network connection to destination
          Using a remote MS windows system with a file share as the repository:
          mount -t cifs //fdSeville/images /mnt/partimgVault
          password:
          Continue with client


                or


          Using a network file system server
          mount -t nfs fdSeville:images /mnt/partimgVault
          Continue with client

partimaged-server mode

(When server is not running MS windows, no share is available or NFS is not available)
  1. At the partimaged server computer
      If no user authorization will be used (--noLogin) skip to "Start the daemon"

      If using --login, or partimage was compiled requiring user authorizations:

    1. Establish authorizations
      for /etc/passwd
      Partimage authorization file
      Not needed with system Rescue CD since partimage
      is set to nologin
      1. Create server user partimgd
         
        1. sudo adduser --create-home /var/log/partimage partimaged
        2. sudo passwd partimaged
      1. Create partimage auth file
         (if using System Rescue CD skip to add clients)
        1. cat > mkPartimgAuth.sh
          mkdir          $1 
          touch          $1/partimagedusers 
          chmod 600      $1/partimagedusers
          chown partimgd $1/partimagedusers 
          ^D

        2. sudo sh -x mkPartimgAuth.sh /etc/partimaged
      1. Create clients users
        1. cat > mkPartClients.sh
          adduser --comment "partimageID" -M fdLondon
          passwd fdLondon
          adduser --comment "partimageID" -M ladMilan
          passwd ladMilan
          adduser --comment "partimageID" -M franckParis
          passwd franckParis
          …
          ^D

        2. sudo sh -x mkPartClients.sh
      1. add clients

        1. cat >> /etc/partimaged/partimagedusers
          franckParis
          ladMilan
          fdLondon 
          ^D

        2. sudo sh -x mkPartCLientsA.sh

    2. check destination:
                touch /partImages/Seville/0_partionImage_images
    3. Start the daemon:

      Switch to an alternate console [Alt][F2]

      partimged -d /partImages/Seville [--nologin]

      Switch back to original console [Alt][F1]

      partimaged options:
      -d /dd/ddd
      --dest/dd/ddd
      destination directory
      -ppppp
      --port=pppp
      server's port listening (default: 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[2|3]
      --debug=[2|3]
      set the debug level (default: 1)
      -L
      --nologin
      disable login from clients( See compilation options)
      -n
      --nossl
      dissable SSL
      -h
      --help
      show help
      -v
      --version
      show version

At the Client

  1. Display partitions

    sfdisk --list |more

    Disk /dev/sda: 4865 cylinders, 255 heads, 63 sectors/track
    Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
    
       Device Boot Start     End   #cyls    #blocks   Id  System
    /dev/sda1   *      0+    536-    537-   4305640+   c  W95 FAT32 (LBA)
    /dev/sda2        536+   2382-   1847-  14832216    f  W95 Ext'd (LBA)
    /dev/sda3       2432    4865-   2434-  19543104    7  HPFS/NTFS
    /dev/sda4          0       -       0          0    0  Empty
    /dev/sda5        536+    791-    256-   2048728+   7  HPFS/NTFS
    /dev/sda6        791+   1047-    256-   2056288+   7  HPFS/NTFS
    /dev/sda7       1047+   1111-     64-    514048+   c  W95 FAT32 (LBA)
     
  2. Save partition table information to files

    1. sfdisk --dump > ladBerlin.partTable.`date +%y%m%d_%H%M`.dmp
    2. sfdisk --list > ladBerlin.partTable.`date +%y%m%d_%H%M`.txt 2> /dev/null

  3. Copy partition table information to server

  4. Begin backup

    The gui is nice but rather unforgiving as errors in last entry will abort and necessatate starting over.
    Maybe you might want to use the command line after all as you can use command line editor to correct command errors. (ed)

    1. start GUI
      partimage [--noLogin --noSSL]

      Additinal documentaion on GUI (character) usage is at:
      partimage.org/Partimage-manual_Usage

        Tips:
      • use [tab] to advance fileds.
      • To save to a file server set up in step I,
        use /mnt/partimgVault for
        Image file to create/use and
        do not select [ ] Connect to server
      • to save to a partimaged running on the same system,
        use localhost for IP/name of the server

                          -- or --

    2. enter command, for example:

      partimage --compress=2 --batch --nodesc \
        --noLogin --noSSL --server=dgNYCvault \
        save \
        /dev/sda3 \
        ladBerlin.testDB.081231.bgz

      partimage save \
        /dev/hda3 /mnt/partimgStore/franckParis_home_081231.pimg.gz

      partimage save \
        /dev/sda1 /mnt/partVault/fdLondon_root_081231.pimg.gz

  -------------------| save partition to image file |---------------
Partition to save: ........../dev/sda1
Size of the Partition .......9.77 GiB = 10487199744 bytes
Current iamge file:  ......../mnt/partimgStore/foxSDA1.000
Image file size:  ...........1.78 GiB¿
Available space for image ...4.43 GiB = 4756237312 bytes¿
Detected file ststem: .......ntfs
Compression level: ..........bzip2

Time elapsed: ................1m: 3Sec¿
Estimaged time remaining: ...21m:30sec¿
Speed: ......................151.98 MiB/min¿ 
Data copied: ................284.24 MiB / 3.40 GiB¿

                    20%       

¿ These fields change as the backup progresses

Performance sample: 2 GHz processor; backing up 10GB, MS windows, System only volume, which was 50% used
to a NTFS file server.
compression MiB rate/min net usageCPU usageelapsed time
(minutes)
file size
(GB)
bzip2 15099% 1.847
gzip 50090% 7 1.871
none90010%15% 53.563 in 2 files (2.36 post compress via Windows)


Detailed options

partimage [imginfo|restmbr]image_file
  imginfoshow information about the image file
  restmbr a MBR of the image file to an hard disk
or
partimage [options] [save|restore] device_partition image_file

partimage save --nossl --noLogin --server 192.168.1.8 /dev/sda2 /mnt/images/imageOfsad2.gz

device_partition partition to save/restore (example: /dev/hda1)
image_file name for image file (example: server.volume.yymmdd.gz
For restore, image_file can be stdin which allows for providing image files via a pipe.

 -sa.a.a.a
--server=a.a.a.a
partimaged server ip address or name
Examples: -s dgNYimages , --server=dgNYimages
 -ppppp
--port=pppp
partimaged server's listening port (default: 4025)
 -L
--noLogin
noLogin see partimaged server screen if ithis is permitted
 -Uuname
--username=uname
username on server
 -Ppass
--password=pass
 
 partition related
 -c
--nocheck
don't check the partition before saving
 -m
--allowmnt
don't fail if the partition is mounted.
warning, contents will be changing !
 -e
--erase
ZERO empty blocks on restore
 -d
--nodesc
don't ask for description
 save destination related
Don't expect significant reduction if the partition being saved is a MS Windows volume with compression.
 -z1
--compress=1
using gzip: fast and small image file (default)
 -z2
--compress=2
using bzip2: very slow and very small image file.
 -z3
--compress=3
using lz: fastest and smallest
 -z0
--compress=0
don't compress: very fast but very big image file(not recommended)
 
 -o
--overwrite
overwrite the existing image file without confirmation
 -V
--volume
split image into multiple volumes files (when backup device fills up)
  -Vxxx
 --volume=xxx
create volumes with a size of xxx MB
4000 is a good number as you can watch the server as segments are created.
 -w
--waitvol
wait for a confirmation after each volume change
 -M
--nombr
don't create a backup of the MBR (Mast Boot Record) in the image file
Normally the MBR is saved with every partition.
However see forum regarding correct size of MBR! and destination.
 when completed partimage should:
 -f0
--finish=0
wait
 -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
 -Bresp
--fully-batch=resp
batch mode without GUI, resp is a challenge response string
"quest=answer" gui=no
 
 -y
--nosync
don't synchronize the disks at the end of the operation (dangerous)
 -n
--nossl
disable SSL in network mode
 -S
--simulate
simulation of restoration mode. (verifies image file is valid)
 -aopts
--automnt=opts
automatic mount with opts options.
 
 -g
--debug=n
set the debug level to n
1(user), 2(developer) or 3(debugging), default 1
 -h
--help
show help
 -v
--version
show version
 -i
--compilinfo
show compilation options used
Display from SysRescueCD:
* Version is 0.6.7 [4.2.4 (Gentoo 4.2.4 p1.0)].

*Supported file systems:
 - ext2fs,ext3fs,reiserfsi-3.5,reiserfs-3.6,reiserfs,fat,fat16,fat32,ntfs,
          hpfs,jfs,hfs,ufs
 - Ext2fs support: Internal code

 * Debug options:
   - PARTIMAGE_LOG=/var/log/partimage-debug.log
   - PARTIMAGED_LOG=/var/log/partimaged.log
   - DEVEL DISABLED
   - DEFAULT_DEBUG_LEVEL=1

 * Other options:
   - CURRENT_IMAGE_FORMAT=0.6.1
   - USERS DON'T LOGIN
   - PARTIMAGED_USERS not used
   - SSL DISABLED
   - CHEUID* DISABLED

Additional Examples:

partimage -z2 -o -d save \
partimage -a/dev/hda6#/mnt/partimg#vfat -V1440 save \
 /dev/hda12 \
 /mnt/backup/ladBerlin.testDB.081231.bgz

partimage -m save \
/dev/hda9 /mnt/backup/franckZurich.SYS.WIN95-OSR2.081130.partimg.gz


Restoring

  1. Check what you have:
    partimage imginfo /mnt/backup/francoisRome.home.081231.bz2

  2. If necessary, recover the master Boot Record
    partimage restmbr /mnt/backup/francoisRome.home.081231.bz2

  3. If necessary, restore the partition table
    sfdisk < /mnt/backup/francoisRome.home.081231.dmp

  4. Recover the partition
    partimage restore \
    /dev/hda13 /dev/hda12 /mnt/backup/francoisRome.home.081231.bz2


Errors

  1. Return Code 134 no space left(no error message!)
    Unknown error -47 no space left
    Cannot Create temp file No Space left on device return code 1
    return code 1 user canceled

    This occurs when the partimaged is expecting an SSL connection and partimage is not.
    start partimage with the -n

  2. cannot create file temp.[.] user partimg not created


Additional notes:

Unstable version 7.x.x supports lz compression for -z3 and encryption.

Saving a partition on x86 architecture cannot be restored on a powerpc nor on a x64
"...This seems to be an endianness/types issue which leads to the data not being recognised correctly on other arches than the originating one.
Details here ...

-V sss Does not always work correctly. details

No support for evms volumes details

Other utilities of interest: FOG, Altiris, and Ghostcast, Clonezilla (unicasting and multicasting)
Filesystem supported:

  1. ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs of GNU/Linux,
  2. FAT, NTFS of MS Windows,
  3. HFS+ of Mac OS,
  4. UFS of FreeBSD, NetBSD, and OpenBSD, and
  5. VMFS of VMWare ESX.
For these file systems, only used blocks in partition are saved and restored.
For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.

DRBL Diskless Remote Boot in Linux,
partclone,
ntfsclone and
udpcast,
Amanda