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.
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.
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.
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.
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.