[plug] Stressing a disk

Harry McNally harrymc at decisions-and-designs.com.au
Thu Jan 9 11:24:11 WST 2003


On Thu, 9 Jan 2003 03:31:16 +0000 Derek Fountain <derekfountain at yahoo.co.uk> wrote:

> > Make two partitions of the same size and do:
> >
> > while true ; do
> > 	dd if=/dev/hdN1 of=/dev/hdN2
> > 	dd if=/dev/hdN2 of=/dev/hdN1
> > 	md5sum /dev/hdN[12]
> > done
> >
> > where N is the approriate letter.  I have no idea how stressfull that is on
> > a disk?  It looks bad tho.
> 
> I like it! I don't think it's too stressful since all reads and writes will be 
> contiguous

Not so. Remember that it must seek to one partition, read, then seek to the other partition, and write.
It's not random seek distances but .. it will suffice :)

> and the kernel and disk between them will make full use of large 
> read ahead buffers and big write buffers

Try bs=512
I don't know yet whether raw partition writes are cached. Are they ? 

Is this evil[er] ?

# Disclaimer. "Do _NOT_ do this on a live filesystem even if you are feeling a bit dim"  

while true ; do
 	dd if=/dev/hdN1 of=/dev/hdN2 bs=512 &
	dd if=/dev/hdN2 of=/dev/hdN1 bs=512 &
	md5sum /dev/hdN[12]
done

# Disclaimer. "If you admit you have done this foolhardy deed to a live filesystem
#              my reply will be: 'Feeling dim ? QED' " :)  

Harry

-- 
linux.conf.au 2003		The Australian Linux Technical Conference
http://linux.conf.au/		22-25 January 2003 in Perth, Western Australia

Are you a computer angel?	http://www.ca.asn.au/



More information about the plug mailing list