Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-15-2004, 09:59 AM   #1
Registered: Jun 2003
Distribution: Debian
Posts: 33

Rep: Reputation: 15

I am trying to make a cron job that will backup partitions. I can use partimage GUI to back up partitions and it works great, but when I try using it running batch mode it locks up at "partimage: status: copying used data blocks". As far as I can see the image file was made, it just seems to lockup there.

The command I'm running is:

partimage -B=foo save -z1 -f3 -b -d /dev/scsi/host2/bus0/target1/lun0/part1 /root/backup/`date +%d%b%G`.server1.gz

Another question while I'm posting, as you can see I am using "/dev/scsi/host2/bus0/target1/lun0/part1" which is /dev/sda1. When I try and use /dev/sda1 it never works, any ideas why? I don't know a ton about the dev fs so it may be something real obvious.
Old 12-15-2004, 03:58 PM   #2
Registered: Jun 2003
Distribution: Debian
Posts: 33

Original Poster
Rep: Reputation: 15
If anyone have experience with partimage using the command line. I would like to see examples of what other people have done.

Or is there a better program to do a full disk and/or partition backup using a network client, this is for a server at a remote location, so I won't be able to pop in a CD or floppy whnever I what to make an image.
Old 12-17-2004, 09:50 PM   #3
LQ 5k Club
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,827

Rep: Reputation: Disabled
you may want to look at Crito"s reply here

I have not tested it

I use PI in gui mode so can not help with commands
Old 12-17-2004, 11:10 PM   #4
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Here's my notes on partimage from the command line. I didn't include the save option but it shouldn't be too much different.

EDIT: Running partimage in batch mode to save the partitions would look something like this .....
partimage save -c -b -d -z2 -f3 /dev/hda2 /mnt/images/backup/linux
partimage save -B=foo -c -b -d -z2 -f3 /dev/hda2 /mnt/images/backup/linux

If you are going to clone an NTFS partition, you may want to run defrag and scandisk first.

Get a cd bootable version of linux like system rescue at and bootup with that cd.

Mount the partition where the images are going to be saved to.
mount /dev/hdb1 /mnt/images/backup -t ext3

Run partimage to make the images and save it to the backup directory which was created in the previous step.

In this example, I have a dual boot system so I backed up both operating systems with partimage.

Save the ENTIRE PARTITION TABLE to a file using sfdisk.
sfdisk Ėd /dev/hda > /mnt/images/backup/partfile

If you have an Extended partition, sfdisk may give you an error when you try to restore. In this case, it's better to use dd to backup and restore the partition table.
dd if=/dev/hda of=/mnt/images/backup/mbrfile bs=512 count=1

The clone script will restore that partition table and MBR from files to the new hard drive using the commands:
sfdisk /dev/hda < /mnt/images/backup/partfile
dd if=/mnt/images/backup/mbrfile of=/dev/hda bs=512 count=1

After you have saved the images and the partition table, install the new hard drive, make sure that bios sees it as the /dev/hda ( Primary Master ) so you donít accidently zap your backup images which are saved on the /dev/hdb ( Primary Slave ) .

Bootup with the rescue cd and run the clone script to restore the images to your new hard drive.

echo "********************************************************************"
echo "     Caution!!!     This program will erase your hard drive"
echo -n "                Do you want to proceed (Y/N)?"
read answer
if test "$answer" != "Y" -a "$answer" != "y";
then exit 0;
#Erase the old boot sector
dd if=/dev/zero if=/dev/hda bs=512 count=1
#Restore the partition table from file using sfdisk
sfdisk /dev/hda < /mnt/images/backup/partfile
# Restore the partition table from file using the dd tool
#dd if=/mnt/images/backup/mbrfile of=/dev/hda bs=512 count=1
#Restore the images with Partimage
partimage restore -b -z2 -f3 /dev/hda1 /mnt/images/backup/windows.000
partimage restore -b -z2 -f3 /dev/hda2 /mnt/images/backup/linux.000
echo "Image restore is complete"

Last edited by homey; 12-18-2004 at 09:12 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
partimage salv236 Linux - Software 1 01-24-2005 08:51 AM
partimage help bungle_42 Linux - Software 11 06-17-2004 09:40 AM
Partimage or ??? HELP! Braveheart1980 Linux - General 7 02-08-2004 03:38 AM
Help with Partimage?? maestro52 Linux - Software 6 01-17-2004 06:03 AM
Help with Partimage please sluggo Linux - General 3 11-25-2003 06:54 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration