LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2009, 02:43 PM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 814

Rep: Reputation: 69
Question Trouble backing-up with "dd"


Hi guys,

I've been running a few comparitive backup tests on my Acer Aspire One netbook between Acronis, Clonezilla and the good ol' "dd" command. Clonezilla came out tops (after I disabled a couple of really DUMB default options that were causing it to fail.) Then Acronis (effective back-up in less than 5 minutes; restore in 32m). Lastly and leastly, "dd" which was *awful*.

Bear in mind this computer's main partition is a tiny 7Gb. dd took 107 minutes to back this up, and a whole THREE HOURS to restore it! Unbelievably slow as I'm sure you'll agree. Plus when the restore finished and I re-booted, the computer reported it had zero free disk space. And I mean ZERO. The command I used (from an external usb Knoppix live CD) was "sudo dd if=/dev/sda5 of=/dev/hdc1" and the backup partition size was 8Gb. I've never had a bum result with "dd" before, so where did it all go wrong?
TIA,

CC.
 
Old 03-11-2009, 02:47 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Keep in mind that dd is REALLY DUMB---it happily copies all the bytes including the empty space.

Also, the speed of dd will depend on the choice of block size. The optimum depends--in turn--on the size of your RAM.
 
Old 03-11-2009, 02:51 PM   #3
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 814

Original Poster
Rep: Reputation: 69
Quote:
Originally Posted by pixellany View Post
Keep in mind that dd is REALLY DUMB---it happily copies all the bytes including the empty space.

Also, the speed of dd will depend on the choice of block size. The optimum depends--in turn--on the size of your RAM.
Gosh, that was a swift reply! I was wondering about specifying a block size but didn't and just entered the command without one as shown. Still can't understand why it's filled the disk up, either. :-/
 
Old 03-11-2009, 03:22 PM   #4
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Did you say you copied an 8Gb partition to a 7Gb one? That'll be why.
 
Old 03-11-2009, 03:28 PM   #5
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
These are good instructions for backing up partitions with dd. You're better off writing the image to a file rather than directly cloning one partition onto another. I think my 20Gb partition takes about 20-30min to back up and 10 min to restore with those instructions (block size 1k - maybe I can increase this but I'm not sure)
 
Old 03-11-2009, 03:29 PM   #6
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 814

Original Poster
Rep: Reputation: 69
Quote:
Originally Posted by openSauce View Post
Did you say you copied an 8Gb partition to a 7Gb one? That'll be why.
Well this is something I don't quite understand. I'm aware that when you use 'dd' you need to be sure that the volume you're writing to is equal to or greater in size than the one you're copying. That's what I did: source partition=7Gb; destination partition=8Gb. However, when restoring the sizes are reversed, I guess. How can one get around this? Is it essential, then with 'dd' the source and destination partitions be of exactly EQUAL size rather than equal or greater?
 
Old 03-11-2009, 03:37 PM   #7
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Well thinking about it, I might be wrong. The filesystem on your system partition is only 7Gb, and cloning it onto a larger partition shouldn't change that - if you mount the backup partition, you should see only 7Gb total space, I think. But still I think this must have something to do with it. Definitely recommend using a gzipped image file if you just want the copy for backup! bzip gives somewhat better compression but is way too slow for this IMO.
 
Old 03-11-2009, 03:40 PM   #8
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
using dd:
if you restore a 10 gb backup to a 5 gb hard drive, the backup will truncate. so any data beyond the 5 gb barrier will be non-existant on the restored hard drive.

if you restore a 5 gb backup to a 10 gb hard drive then the restored harddrive will look like a 5 gb harddrive (essentially half the harddrive will be unusable space).
 
  


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
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 08:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 04:07 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 02:34 PM


All times are GMT -5. The time now is 04:28 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration