Solved

Am I doing something wrong here?

Posted on 2004-09-26
7
198 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
  • 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now