« PCI SATA Controller is Working | Main | The LVM Advantage: Migrating Data »

July 17, 2006

New Hard Drive? Test It First

As you may have read in my most recent entries, I am updating my home file server, replacing the two existing ATA data drives with a new larger, faster SATA drive.

The old drives are 45GB & 120GB in size, which works out to approximately 41GB and 111GB formatted capacity, for just over 152GB storage. The new drive is a 320GB model, which works out to just over 299GB formatted capcity.

Since the old drives are nearly full, I'm going to be moving a lot of data. As I'm using LVM, I can migrate the data to the new drive with ease, while I have everything online and in use, but I'll cover that later. But before I move the data over, I would like to know if the new drive is good. Although this technique won't tell you for sure (as in life, sometimes there is no certainty), but it's a good indication that things are OK and it gives the new drive a little bit of a workout.

I simply used the badblocks command to test the entire drive, like so:

# time badblocks -b 4096 /dev/sda > sda.badblocks
real    95m41.158s
user    0m1.764s
sys     3m0.631s

I ran that after connecting remotely to the server from work via SSH. I used screen so that I could disconnect from the session, come home and reconnect later. When I did, I saw that the entire drive was checked in under 96 minutes. Not bad.

Of course, it's always a good sign when there are no error messages from STDERR, but I'll have to check the sda.badblocks created by my command:

# ls -l sda.badblocks
-rw-r--r-- 1 root root 0 Jul 17 16:38 sda.badblocks

As you can see, the file is empty. So, it looks like my new drive is just fine. That means I'm ready to copy all of my data over to it, but you'll have to read my next post to learn how I'm doing that without interfering with normal operations.

Posted by lamontp at July 17, 2006 8:08 PM

Trackback Pings

TrackBack URL for this entry:
http://blogs.gurulabs.com/cgi-bin/mt-tb.cgi/48

Comments

That badblocks file only works with ext[23], that's the problem.

Plus, you can have it generate one on formatting, too. :)

Posted by: Steve Dibb at July 17, 2006 9:31 PM

Actually, I used the "-b 4096" parameter specifically so that I could use any resulting badblocks file with reiserfs. Check out [ http://www.namesys.com/bad-block-handling.html ]

Posted by: Lamont R. Peterson at July 17, 2006 9:41 PM

@Lamont,

That's great to know! I'm always glad to be proven wrong, especially when something like that is gonna come in handy. :)

Posted by: Steve Dibb at July 18, 2006 7:53 AM

Post a comment




Remember Me?

(you may use HTML tags for style)