Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#247459 - 25/01/2005 21:43 Does linux 'dd' copy boot blocks?
TigerJimmy
old hand

Registered: 15/02/2002
Posts: 1049
Hey you guys,

If I use dd with disk devices like:

dd if=/dev/hda of=/dev/hdb

this will copy the boot blocks and everything, right?

Thanks,

Jim

Top
#247460 - 25/01/2005 21:56 Re: Does linux 'dd' copy boot blocks? [Re: TigerJimmy]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
It will copy everything. The new drive must be equal or greater size however.

Top
#247461 - 25/01/2005 23:21 Re: Does linux 'dd' copy boot blocks? [Re: TigerJimmy]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Yup.

But so would a simpler "cp /dev/hda /dev/hdb" or a "cat /dev/hda >/dev/hdb".

Cheers

Top
#247462 - 25/01/2005 23:36 Re: Does linux 'dd' copy boot blocks? [Re: mlord]
TigerJimmy
old hand

Registered: 15/02/2002
Posts: 1049
Really? Cool. Why is it simpler, though? Which is fastest?

Thanks,

Jim

Top
#247463 - 26/01/2005 00:24 Re: Does linux 'dd' copy boot blocks? [Re: TigerJimmy]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
I think they're all comparable in speed, since Linux is so good at optimizing streaming disk read/write operations.

"cat" is probably the slowest of the three, due to pipe buffering defaults. But cp and dd should be equal with default parameters. One might be able to tweak out a slightly faster time with dd using an appropriate bs=nnn parameter.

Cheers

Top
#247464 - 26/01/2005 04:45 Re: Does linux 'dd' copy boot blocks? [Re: mlord]
TigerJimmy
old hand

Registered: 15/02/2002
Posts: 1049
Cool. Thanks you guys.

Mark, a while back you mentioned you increased the disk throughput on your little biscuit-tin server by tweaking, mostly a custom kernel. Did the custom kernel have weird IO stuff in it, or was it a kernel with all of the unneeded stuff stripped out? Just curious how that performance increase was achieved.

Thanks again you guys. I'm off to make a current backup of my mp3 collection.

Jim

Top
#247465 - 26/01/2005 21:59 Re: Does linux 'dd' copy boot blocks? [Re: TigerJimmy]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
I think I merely fixed an efficiency bug in the IDE driver (placed there after I passed it on to others). My 80GB drive understands LBA48 commands, which have nearly double the setup overhead (microseconds) of the older LBA28 commands. The IDE driver, by default, tries to use LBA48 exclusively whenever a drive claims to support it.. EVEN WHEN NOT NEEDED!!!

Duh.. So I just hacked it to not do LBA48 when not needed, which is nearly 100% of the time on my 80GB drive (all of which falls into the LBA28 addressible space).

A small win, not much difference, but it saves some CPU horsepower for other things, and removes 3-5 microseconds from each disk I/O operation.

Cheers


Edited by mlord (27/01/2005 00:32)

Top
#247466 - 26/01/2005 22:24 Re: Does linux 'dd' copy boot blocks? [Re: mlord]
schofiel
carpal tunnel

Registered: 25/06/1999
Posts: 2993
Loc: Wareham, Dorset, UK
Listen!

The sound of a true craftsman in action...
_________________________
One of the few remaining Mk1 owners... #00015

Top
#247467 - 27/01/2005 03:15 Re: Does linux 'dd' copy boot blocks? [Re: schofiel]
TigerJimmy
old hand

Registered: 15/02/2002
Posts: 1049
No kidding. I am not worthy...

Thanks again, Mark.

Top