LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-08-2010, 01:06 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
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.

Thanks.
 
Old 04-08-2010, 02:09 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,093

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
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.
 
Old 04-08-2010, 03:45 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,921

Rep: Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618
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.

Last edited by jefro; 04-08-2010 at 03:48 PM.
 
  


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
Slax with SquashFS-4 new compression algorithm and layered compression ratios? lincaptainhenryjbrown Linux - Software 2 06-19-2009 05:29 PM
Problem with installpkg - external compression utility gzip missing samkz Slackware 5 04-20-2009 12:48 AM
File Roller: how to set compression ratio? How to preserve all color info in JPEGs? bezdomny Linux - Software 3 03-30-2009 12:53 PM
Is gzip -c9 giving the highest compression? Thaidog Linux - General 2 04-23-2007 05:15 AM
gzip , general compression question ?? glenn69 Linux - Newbie 5 10-12-2004 12:20 AM

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

All times are GMT -5. The time now is 04:03 AM.

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