LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 04-22-2012, 08:22 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Thumbs down Making image of a partition with dd - slooooowwwwwwwww...


Hello guys!

So I tried to use dd for backing up NTFS partitions like this:
Code:
dd bs=4M if=/dev/sdb2 | gzip -c > backup.img.gz
but it does so slow!

I don't really know how many hours does this take 'cause I ran out of patience but Clonezilla does it in less than half of an hour. The problem with Clonezilla is that it requires booting off of a LiveCD and I would like to be able to manage partitions while in my main OS.

So is there anything I'm doing wrong with dd that doesn't give me sufficient speed?
 
Old 04-22-2012, 08:51 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 5,032

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Rather than using dd for NTFS partitions, use ntfsclone with the special image format option.
dd is a bit copier, and so copies everything including unused space. In your invocation, that then gets passed to gzip, requiring further processing.
 
1 members found this post helpful.
Old 04-22-2012, 08:58 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,164

Rep: Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628
Sensible advice.

I would state it as - "if you think you need dd, you're wrong".

It has its uses, but backup ain't one of them.
Period.
 
1 members found this post helpful.
Old 04-22-2012, 08:59 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860
Are you sure that the slowdown is caused by dd and not by gzip? Also, do you write back to the same disk you make the image from? Using the same disk will causes serious slowdowns due to head movements.
For comparison, if I create an one GB image file with random data on my SSD and then gzip it to a fast RAID 0 (I normally use gzip -9) it is about 40 seconds.
If not the disk or dd but gzip is the culprit it may help to use pigz instead, it is compatible to gzip but uses all cores of your CPU for compression. The same experiment as above with 1GB random data is about 7 seconds on my 6-core machine.
 
Old 04-22-2012, 09:03 AM   #5
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend
Rather than using dd for NTFS partitions, use ntfsclone with the special image format option.
Thanks. I'll check it out.

Last edited by Mr. Alex; 04-22-2012 at 10:18 AM.
 
Old 04-22-2012, 10:17 AM   #6
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Quote:
Are you sure that the slowdown is caused by dd and not by gzip?
Clonezilla with compression also gives good results.

Quote:
Also, do you write back to the same disk you make the image from?
To another physical HDD.

Quote:
If not the disk or dd but gzip is the culprit it may help to use pigz instead, it is compatible to gzip but uses all cores of your CPU for compression. The same experiment as above with 1GB random data is about 7 seconds on my 6-core machine.
I have one CPU core. Ntfsclone seems to do pretty good.
 
  


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
Wrote to partition while making image file w/ dd: Did I mess it up? vincebs Linux - General 3 06-24-2010 09:18 AM
Making an image of my partition in Win2k? Jorophose General 5 06-20-2007 09:00 PM
Making a drive image pcdude Linux - General 3 01-05-2005 10:20 PM
Making a partition image PhuckFonix Linux - General 6 06-27-2004 02:06 PM
Partition Magic eval not making partition SidA Fedora 7 03-16-2004 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:57 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