Determining the compression ratio when using -9 with gzip
Linux - SoftwareThis 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
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.
Determining the compression ratio when using -9 with gzip
Hi there --
I am running the dd command to copy a partition to a remote drive. During the process I am running the gzip -9 command syntax to compress the file as much as possible.
I wanted to know if there is a formula that can determine what will be the projected size of the img.gz file. The size of the partition being copied over is 145 gigabytes.
No, & no. You shouldn't use dd, use tar for backing up, and you don't store free space and drive geometry. No, you can't really get an estimate: Ascii shrinks well, but bzipped, jpg, rpm, & pdf hardly change at all.
dd and tar have different uses. g4u is a tool I use all the time for exactly what you are doing. It is simply a floppy set with bsd that uses dd and if you want you can compress it. I originally looked at it to decide based on that compression number. I know it is out on the web someplace. What happens in the end is more based on the files you have. Some compress well and some change little or even get a few bits larger. If your process or is fast enough you can save time with the most compression. Do a few tests, it may end up that your time and size may be about best at 6 or 7.
I agree that free space could be wasted on dd. You can zero that out if you want. It helps ALOT! If you had for example 40G on a free space zeroed out drive then I'd make a wild guess at 19G @ 9 and something like 38 @ 2.
I also agree that your choice of dd or tar would be based more on your backup scheme.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.