LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-29-2005, 01:11 PM   #1
max_mad
LQ Newbie
 
Registered: Sep 2005
Distribution: SuSE Linux 9.3
Posts: 21

Rep: Reputation: 15
PARTIMAGE, restoring to bigger/smaller partition


I use PARTIMAGE for backing up / , which is /dev/hda2 (reiserfs, no logical volumes).

What happens if - for instance after head-crash - the size of a new /dev/hda2 on a new harddisk differs from the original one?

Can I restore and find a working system?

What, if the new partition is smaller than the original one, but bigger than the data-size?

What, if the new partition is bigger than the old one? Will hd-space be lost or do I have to resize?

Thanks!
 
Old 09-29-2005, 02:44 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,319

Rep: Reputation: 140Reputation: 140
You can only restore to a partition greater than or equall to the imaged partition with partimage. And if you restore to a partition greater than the original, your system will see the partition as equall to the original partition, i.e. you will lose some space. Well, not really lose space but just have the extra space inaccessible.
If your just working with linux filesystems and partitions you can get around that by using tar and gzip to backup the partition instead of partimage. With tar, you can restore to any size partition and not lose space. Post back if you want details on how to do this with tar.
 
Old 09-29-2005, 02:50 PM   #3
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
I didn't like partimage for backing up. It always had trouble reading some of my files. I prefer DAR, which is a command-line driver backup utility based that uses tar and includes all the options for compression, filtering files and directories and slicing at a specified size. I get a 5GB / partition saved into a 1.5GB archive that I can store on a DVD-RW.
 
Old 09-29-2005, 03:27 PM   #4
max_mad
LQ Newbie
 
Registered: Sep 2005
Distribution: SuSE Linux 9.3
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks for answers, I will try DAR
@kilgoretrout: Yes, I am very interested in learning to backup via tar etc because it seems to be more flexible! Thank you!
 
Old 09-29-2005, 06:10 PM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,319

Rep: Reputation: 140Reputation: 140
If your backing up /, I never like to do that with a live system. I usually use a live linux cd like knoppix or kanotix to do those kinds of backups. You just boot off the live cd, determine where you want to place the tar backup and mount that partition read/write. Then mount your "/" partition, in your case /dev/hda2; in knoppix or kanotix that would be mounted at /mnt/hda2. Open a console, su to root, and run:

# cd /mnt/hda2
# tar -cvzf /mnt/hd**/archive_name.tgz .

Where hd** corresponds to the mount point for the partition where you want to put your tar archive backup. A very important point - the trailing period after "tgz" is essential so don't overlook it. That "." tells tar to recursively archive the current directory and everything below it. Since your at the mount point of the partition you want to back up, your entire root partition will be backed up to a gzipped compressed tar archive named "archive_name.tgz" and placed in /mnt/hd**.

To restore from the tar archive, boot off your live cd again, mount hd** and hda2 read/write, open a console, su to root and run:

# cd /mnt/hda2
# tar -xvzf /mnt/hd**/archive_name.tgz

Tar extracts to the directory you are in by default. Tar archives also preserve all file permissions/ownerships and links from the original source. In the above the tar archive is decompressed and opened in /mnt/hda2, the mount point for your root partition.
 
Old 09-29-2005, 11:39 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
Not really a Linux security question, moving your thread to the Linux - General forum to get the exposure it deserves.
 
Old 09-30-2005, 10:55 AM   #7
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Quote:
Originally posted by kilgoretrout
You can only restore to a partition greater than or equall to the imaged partition with partimage. .
Not quite. Let's restate what you said with a correction (what you MEANT to say is correct):

You can only restore to a partition greater than or equall to the used space of the imaged partition with partimage.

I build disk images on an 80GB drive, using about 5.6GB worth of space, and image the drives, then restore them to various drive sizes ranging from 40GB to 300GB without problems.

$.02
 
Old 09-30-2005, 12:19 PM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,319

Rep: Reputation: 140Reputation: 140
I don't think that's right. See:

http://www.partimage.org/doc/index-3.html#ss3.2

Quote:
The partition to restore must have the same size as the saved partition. If the partition is smaller than the original one, the operation will fail. If it is bigger, space can be lost. You can read the FAQ of this handbook, for more details about this.
Partimage uses, among other things, the dd command to make the image. The above effect is a well known by product of copying a partition with dd.
 
Old 09-30-2005, 01:05 PM   #9
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
It's referring to used space. Try it. I do it all the time. It bleeping works!

Edit: I should mention I use ReiserFS and not ext, just FYI. I haven't tried it with EXT.

Last edited by KimVette; 09-30-2005 at 01:14 PM.
 
Old 09-30-2005, 07:48 PM   #10
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Quote:
It's referring to used space. Try it. I do it all the time. It bleeping works!

Edit: I should mention I use ReiserFS and not ext, just FYI. I haven't tried it with EXT.
It may be the difference is Reiserfs but that sure does NOT work with ext3.
I have restored to bigger partitions, then resized the filesystem to a smaller amount. Next, I re-created the partition at or slightly larger than the new filesystem size.
 
Old 10-02-2005, 01:43 PM   #11
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,319

Rep: Reputation: 140Reputation: 140
I use reiserfs and partimage will refuse to restore to a partition smaller than the original. If I restore to a larger partition, the partition will be reported as the same size as the original, i.e. I lose space as indicated in the above quote from the partimage documentation.
 
Old 10-03-2005, 10:04 PM   #12
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Well I created an image from an 80GB drive. I restored the image to a 40GB drive. When I run df -h the partition is reported as 36GB, which is what I defined, and 9.2GB is reported as used, which is exactly what I expected. The docs say otherwise, but I find that it does actually work. I have done the same with NTFS partitions, and although I have to run CHKDSK /F it seems to work flawlessly afterward.

I've been looking for a disk imaging solution and partimage seems mature now, and it seems the documentation is lagging behind the current state of the software.
 
Old 10-04-2005, 07:51 PM   #13
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,319

Rep: Reputation: 140Reputation: 140
What version are you using? I have 0.6.4; that came out in February 2004. I saw a 0.6.5_beta2 on SourceForge dated July 2005:

http://sourceforge.net/project/showf...?group_id=6212

There hasn't been a lot of activity on partimage till recently.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a partition bigger Tsukasa7 Linux - Newbie 8 10-24-2005 12:41 PM
making linux partition bigger? M O L8ingN2dust Linux - Newbie 1 03-23-2005 03:47 PM
cannot I run partimage to create a partition after booting the system? parv Linux - Software 2 09-20-2004 05:45 PM
Making a partition bigger rverlander Linux - General 8 07-19-2002 08:49 PM
bigger or smaller acid_kewpie General 20 04-09-2002 09:41 AM


All times are GMT -5. The time now is 06:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration