Solved

Am I doing something wrong here?

Posted on 2004-09-26
7
203 Views
Last Modified: 2010-04-20
dd bs=2048 if=/dev/hda1 | split -b 2000m - /mnt/1/1.img

Currently it takes 30 mins for the above command for 20 gigs without th bs paramater. I've tried bs=4096 and bs=2048 but the speed doesn't get affected and stas on 30 mins.

Any ideas how dd can be speeded up?

Thanks
0
Comment
Question by:bunny47
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 2

Expert Comment

by:fulp02
ID: 12154273
You are not going to be able to  You  are moving 20 Gigs . the only
way is you need more memory or a faster processor and faster hard drives
I am sorry i know it sucks but it is pretty much the only way.

Or you can keep moving the bs up and see if that keeps the drive rapidly reading more
0
 

Author Comment

by:bunny47
ID: 12154483
WHy is that, why doesn't the bs= work with a 20 gig drive :-( Is there no way I can make it speed up?



Thanks

0
 
LVL 2

Expert Comment

by:fulp02
ID: 12155036
The Problem Is that your drive is to slow . You can only read as fast as the drive will let
you and write is the same, Now if you had two seperate hard drives in there it would be a diffrent story
you could read from one and write to the other. and that should speed it up a good amount.

Maybe if you had 3 hard drives
two in a software raid and one to back up to that  would increase by at least a quater of the time ,
You could also make cron jobs so it backs up everynight while you are not using your computer personaly
that is what i would do .
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 4

Expert Comment

by:EinarTh
ID: 12159394
you should look at the hdparm command. Maybe you could tweak the drive a bit....
0
 
LVL 4

Expert Comment

by:bytta
ID: 12245323
It might help to know why you are doing this - maybe some incremental program like rsync would do a better job...
0
 

Author Comment

by:bunny47
ID: 12268129
Hi, Sorry for the late reply :-(

Okay here's some background - I've got a OS/2 box with on physical drive partitioned as hda2 and hda5 with some extra free space, I want to connect another local drive onto the machine (think it's gonna be hdb1) and make a complete backup of the partitions, boot record, partition table, and data. When I restore the data back from hdb1 (my 2nd physical drive I've inserted) onto hda.

So in other words a blank hard drive (primary) can be fully restored as above > boot record, partition tables, data and partitions - hda2 and hda5...

I've tried partimage but I get a segmentation fault > I think partimage is having trouble reading the filesystem which is hpfs.

-----------------------------------------------------------------------------------------

It kinda works with dd as follows:

 clear
mkdir /mnt/1
mount /dev/hdb1 /mnt/1
 clear
cd /mnt/1
dd if=/dev/hda of=backup-hda.mbr count=1 bs=512
sfdisk -d /dev/hda > backup-hda.sf
 clear
echo Backup has started, please be patient...
dd bs=4096 if=/dev/hda1 | split -b 200m - /mnt/1/image.img
 clear
cd /mnt/1
dd if=/dev/hda of=backup-hda.mbr count=1 bs=4096
sfdisk -d /dev/hda > backup-hda.sf
clear


-----------------------------------------------------------------------------------------
And the restore:

 clear
mkdir /mnt/1
mount -t hpfs /dev/hdb1 /mnt/1
mount /dev/hdb1 /mnt/1
                    echo The restore begins...
cat bs=4096 /mnt/1/1.imgaa | dd of=/dev/hda1
clear
mount -t hpfs /dev/hdb1 /mnt/sydos
mount /dev/hdb1 /mnt/sydos
cd /mnt/sydos
dd if=backup-hda.mbr of=/dev/hda
sfdisk /dev/hda < backup-hda.sf

-----------------------------------------------------------------------------------------

The problem is the speed, I'm backing up a 20 gig drive that's set as slave on the same ide cable sa the master that's running OS/2 My 2 hard drives are 3 x 7200rpm western digital... Surely I can speed it up somehow?

Thanks a Mil for all the input so far!!!!!!!!!!!!!
0
 
LVL 4

Accepted Solution

by:
bytta earned 500 total points
ID: 12271235
Again - I recommend rsync for the job.

To my knowledge - it can not copy to/from an img file, but as it only copies the files that have changed you will probably just need to copy 0-2 Gb each time (depending on how often you backup). This way your backup has the same structure as the original so accessing a single file from it does not require a restore.

The first time everything will need to be copied so it WILL take longer than your 30 min dd command, but after that the process will probably take much less time.
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question