[Gllug] dd and iotop weirdness

general_email at technicalbloke.com general_email at technicalbloke.com
Mon Nov 29 19:05:52 UTC 2010


Dear list, WTF?

I wanted to zerofill 2 drives, both SATA2 1.5TB from the same batch, so 
I put them both in a spare box and booted to an Ubuntu 9.04 live CD 
(10.04 wouldn't start properly on it). If listed the drives with fdisk 
-lu and saw they were /dev/sda and /dev/sdb respectively. To zero each 
disk I issued the command 'sudo dd if=/dev/zero of=/dev/sdX bs=1M &' for 
each of them. I then, in 2 separate terminals issued 'sudo watch -n 5 
kill -USR1 <PID>' so I could see how far they had got. The two watch 
commands seemed to want to both output the the same terminal which was 
messy (no carriage returns) but I could make out that /dev/sdb was being 
written at +80MB/s and /dev/sda was only averaging ~15MB/s. Both disks 
are identical samsungs. I installed iotop to confirm these speeds and 
saw the same thing.

This puzzled me so I used df to double check neither were mounted and 
sure enough they weren't so I decided to kill the dd that was wiping 
/dev/sda and restart it. I duly killed it and then, as the output from 
watch was so messy, I installed gnu ddrescue which shows where you are 
as it goes and started it zeroing 'ddrescue /dev/zero /dev/sda 
/var/log/zero.log'. I then checked iotop and it showed ddrescue was 
writing /dev/sda about 25MB/s AND now /dev/sdb was writing at over 
500MB/s! Much as I would like that to be the case these are good old 
fashioned mechanical hard drives so I knew something was wrong. A quick 
check with fdisk shows /dev/sdb has disappeared although iotop claims it 
is writing faster than ever!

What on earth is going on?
Why should the write speeds be so far apart?
Where is iotop getting it's numbers from?
Why should starting ddrescue bump off a disk that isn't even referenced 
in its invocation?
What log should I check to see what happed to it?
Also, my caddy/mobo isn't hot swappable AFAIK but given it has 
disappeared from fdisk (and so presumably the kernel) is it safe to yank 
the dead drive out so I can put it in another machine and scan it for 
errors?

Yours confused,

Roger.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list