Using dd and gzip to create hard drive image but image is bigger than hard drive?
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.
Using dd and gzip to create hard drive image but image is bigger than hard drive?
What we are trying to accomplish is to migrate 20 windows 2000 machines to new hardware and also to take an image of the machine on the old hardware and the new hardware.
We are using an unbuntu live CD to boot up the machine. The hard drive itself is about 4gb. Using the commands
It seems to work but due to the difference in hardware we have to run the windows repair to get it to work. It adds about 300mb to the total size of the disk.
So now we need to take a new image of the working hardware using the same command
dd if=/dev/sda | gzip > /mnt/landesk/f$/images/image.gz
This time gzip gives us an error saying that the file size has exceeded. So we decided to split the file using
78165360+0 records in
78165360+0 records out
40020664320 bytes (40 GB) copied, 9205.89 s, 4.3 MB/s
The total size of the image is about 11.5gb! Any idea why the size of the image is bigger than the hard drive? There isn't any other partition on the hard drive.
Thanks for your reply billymayday. The drive is 40gb, but only 4.8gb in data. So I thought when you gzip it, it should be less than 4gb in size?
Can't do fdisk -l at the moment as I'm not in at work today.
I used dd if=/dev/sda because it also takes an image of the MBR.
Correct me if I'm wrong, I have a feeling that the size of the image is big is because the drive is not clean? I didn't really wipe the drive before restoring the image on to the hard drive.
After writing 0 to the drive, restoring the image, reimaging the drive again. The size seems to be right again! It's only 1.3gb after gzip.
I'm going to have to do more testing when I get into work in Monday.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.