HDD Stress Test with Python

B

Bart Nessux

A bit off topic, but here goes: Does this look like a reasonable hard
drive stress-test? I run it repeatedly for a few days on our new
PowerMac G5's (they come with Python 2.3 installed!!!) which we've had
drive problems with. Two 80GB SATA Maxtor drives replaced already. Only
been in use for a few days. Apple is replacing them with Seagate drives,
not that that matters. Here's the script:

def dd_test():
import os
import time
print
print "DDing first partition to second partition... please wait."
fp = os.popen("/bin/dd if=/dev/disk0s3 of=/dev/disk0s5", "r")
fp
fp.close()
print "DD has completed."
print
print "Formatting first partition UFS"
print
fp1 = os.popen("/sbin/newfs /dev/disk0s3", "r")
fp1
fp1.close()
print
print "Formatting second partition UFS"
print
fp2 = os.popen("/sbin/newfs /dev/disk0s5", "r")
fp2
fp2.close()
print "Sleeping 60 seconds before starting again..."
print
time.sleep(60)
dd_test()
dd_test()

# Make two equal sized partitions on Mac internal HDD.
# Unmount the internal HDD, boot from firewire drive
# and run script.
# Used 'pdisk /dev/disk0 -dump' to get info about drive.
# Used 'newfs /dev/disk0s3' to format a partition UFS.
 
S

Skip Montanaro

Bart> A bit off topic, but here goes: Does this look like a reasonable
Bart> hard drive stress-test?

...

Bart> fp1 = os.popen("/sbin/newfs /dev/disk0s3", "r")
...
Bart> fp2 = os.popen("/sbin/newfs /dev/disk0s5", "r")
...

My guess is that newfs isn't all that random in its behavior, nor that it
touches all that much of the disk. I think it mostly lays down inode
structure. I doubt it even zeroes out the data chunks. You might want to
do something like build multiple copies of some huge program (Emacs? GCC?
Gimp? Darwin kernel?) in parallel, while constantly creating and deleting a
bunch of large files stuffed with random bits.

Skip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top