LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-28-2005, 09:38 PM   #1
sausagejohnson
Member
 
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-29-2005, 12:04 AM   #2
sausagejohnson
Member
 
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.
 
  


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 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 05:33 PM
Nuked HDD - Can I get the files back? Nige Linux - General 2 09-11-2005 11:43 PM
Squid.conf big file Linutzo Linux - Networking 1 05-07-2005 12:51 AM
How Do I Back Up All My Vhs Tapes To My Hdd In Linux? LinuxGuru707 Linux - Software 2 01-03-2005 07:26 PM
How to back up data onto a external HDD in RHL ?? sudhir Linux - General 8 09-26-2003 06:46 AM


All times are GMT -5. The time now is 01:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration