LinHES Forums
http://forums.linhes.org/

I need some education re: USB hard drives - FIXED
http://forums.linhes.org/viewtopic.php?f=5&t=18218
Page 1 of 1

Author:  nbdwt73 [ Sat Apr 26, 2008 11:33 am ]
Post subject:  I need some education re: USB hard drives - FIXED

I am seeing a strange issue that I do not understand and is perhaps "just the way it works"... I have two external USB drives that work fine - I mount them to /mnt/USB1 and /mnt/USB2 and complete the backups. My problem is that if, say USB1 finishes first and I umount that drive and turn it off, USB2 fails with "mythserv kernel: scsi 3:0:0:0: rejecting I/O to dead device" errors or "mythserv kernel: journal commit I/O error". It is as if I umounted USB2 also in the middle of a write (which I didn't).

I have tried this with both drives (umounting the other first) with the same result - the syslog reports the error above (and a few others) however, if I do not shutoff either USB drive, everything is fine.

So my questions is - am I doing something wrong? Should I not umount a USB drive when multiples are connected until all activity is finished? And, of course, educate me as to why this is happening - what is the root cause?

Author:  cliffsjunk [ Sat Apr 26, 2008 11:59 pm ]
Post subject: 

You didn't say what kind of backup software you were running...

It sounds to me like each backup program has something open
on both USB drives. You can test this after the first backup is
complete with something like the following (as root):
Code:
lsof | grep 'USB[12]' | less


You should not be able to umount a drive with files still open on
it so I suspect that you are just "pulling the plug" without a
successful umount after the first backup is complete? Before
pulling the plug on either of these USB drives they should be
unmounted with one of these (possibly need to be root here
too):
Code:
umount  /media/USB1
umount  /media/USB2
I suspect that you will find that it says that it cant' umount it
because it is busy.

Cliff

Author:  nbdwt73 [ Sun Apr 27, 2008 7:43 am ]
Post subject: 

Thanks for the reply Cliff. I am using a standard rsync... And I agree with you - I should be able to umount the drives. That is why I am asking this question. The umount executes fine - it returns no error or message. It just unmounts the first drive then the second immediately has the problem noted above. I am begining to suspect some sort of journaling issue.

I will look for open files and report back - I didn't do that in my last test...

Author:  slowtolearn [ Sun Apr 27, 2008 7:57 am ]
Post subject: 

And if you are properly unmounting the device then I would guess udev is changing device nodes around on you when you power one of the drives down. I know very little about udev and how to "fix" node/device names to hot-pluggable devices, but a Google for "udev persistent naming" yields many promising hits.

Author:  nbdwt73 [ Sun Apr 27, 2008 8:46 pm ]
Post subject: 

OK - figured it out. What a pain. Turns out it was a compound issue. First, I did have a journal problem; e2fsck fixed that one. But I still had occasional errors when I powered down the external drives and it seemed to be random. Slowtolearn was right - I had some weird udev issue (udevtest pinpointed it) so I wrote some rules for my external mounts, wrote a script to detect them properly and automate my backups. Now they detect and sync to the correct drives, umount and shutdown.

Much better... Thanks.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/