Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This 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.


  Search this Thread
Old 06-28-2005, 08:38 PM   #1
Registered: Mar 2004
Location: Canberra, Australia
Distribution: Fedora Core 9
Posts: 242

Rep: Reputation: 30
dd to back up a HDD to file. Too big!

I am using dd to back up my 80gb harddisk, and I want the resulting image to be <700MB. I know that sounds unreasonable however my partition sizes are:

/dev/hda1 118MB Used:2.2MB /boot
/dev/hda2 3.8GB Used:335MB /
/dev/hda3 71GB Used:672K /mediafiles

I realise that dd copies warts and all (including unusued blocks) so I used the following to zero out all usued blocks:

dd if=/dev/zero of=/deleteme bs=8M
rm /deleteme

Then I mounted to the server and dd'ed my drive to it and passing it through heavy bzip2 compression as:

dd if=/dev/hda bs=1k conv=sync,noerror | bzip2 -9 | dd of=/mnt/mountedserver/backup.bz2 bs=1k

As far as I can tell, the drive should be nicely zeroed and should compress very well to equal or be less than the total size of the data on the drive, approx 339MB.

Can anyone lend a hand where my logic might be going wrong? I am getting files > 2.1GB. Way too big.
Old 06-28-2005, 11:04 PM   #2
Registered: Mar 2004
Location: Canberra, Australia
Distribution: Fedora Core 9
Posts: 242

Original Poster
Rep: Reputation: 30
I worked it out. Such a goose. You have to do the dd /dev/zero thing in each partition, so I had to do it in /, /boot and /mediafiles. That way a file would be created in each, filling up all three partitions. I made the mistake of assuming that because / was the root, it would eventually fill up /boot and /mediafiles as well (being subfolders under / ).

Anyway, all solved, and a handy reference to anyone else wanting to do this.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
create big file system dev_mohamed Linux - General 4 10-03-2005 04:33 PM
Nuked HDD - Can I get the files back? Nige Linux - General 2 09-11-2005 10:43 PM
Squid.conf big file Linutzo Linux - Networking 1 05-06-2005 11:51 PM
How Do I Back Up All My Vhs Tapes To My Hdd In Linux? LinuxGuru707 Linux - Software 2 01-03-2005 06:26 PM
How to back up data onto a external HDD in RHL ?? sudhir Linux - General 8 09-26-2003 05:46 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration