Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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!
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.