Link to home
Start Free TrialLog in
Avatar of bunny47
bunny47

asked on

Am I doing something wrong here?

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
Avatar of fulp02
fulp02

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
Avatar of bunny47

ASKER

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

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 .
you should look at the hdparm command. Maybe you could tweak the drive a bit....
It might help to know why you are doing this - maybe some incremental program like rsync would do a better job...
Avatar of bunny47

ASKER

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!!!!!!!!!!!!!
ASKER CERTIFIED SOLUTION
Avatar of bytta
bytta
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial