LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


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

Rep: Reputation: 15
Partimage


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.
Thanks
 
Old 12-15-2004, 04:58 PM   #2
tbayer
Member
 
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.
Thanks
 
Old 12-17-2004, 10:50 PM   #3
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Australia
Distribution: Devuan
Posts: 5,476

Rep: Reputation: Disabled
you may want to look at Crito"s reply here
http://www.linuxquestions.org/questi...ight=partimage

I have not tested it

I use PI in gui mode so can not help with commands
 
Old 12-18-2004, 12:10 AM   #4
homey
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
or
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 http://www.sysresccd.org 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
or
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.

Code:
#!/bin/bash
#
clear
echo
echo "********************************************************************"
echo "     Caution!!!     This program will erase your hard drive"
echo
echo -n "                Do you want to proceed (Y/N)?"
read answer
if test "$answer" != "Y" -a "$answer" != "y";
then exit 0;
fi
#
clear
#
#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
clear
#
#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
#
clear
echo "Image restore is complete"
echo
#
#####End

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


Reply


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 09:51 AM
partimage help bungle_42 Linux - Software 11 06-17-2004 10:40 AM
Partimage or ??? HELP! Braveheart1980 Linux - General 7 02-08-2004 04:38 AM
Help with Partimage?? maestro52 Linux - Software 6 01-17-2004 07:03 AM
Help with Partimage please sluggo Linux - General 3 11-25-2003 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:40 PM.

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