LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   external HDD disconnecting (https://www.linuxquestions.org/questions/linux-newbie-8/external-hdd-disconnecting-739035/)

biggles1963 07-09-2009 06:58 PM

external HDD disconnecting
 
I run Mandriva 2008. I have a USB HDD which I've reformatted to FAT32 because I need to use it on both Windows & Linux PCs. It connects perfectly but it periodically disconnects.

It is most annoying! Advice appreciated.

dmesg (after connect)
usb-storage: device found at 27
usb-storage: waiting for device to settle before scanning
scsi 23:0:0:0: Direct-Access Seagate FreeAgent Go 102F PQ: 0 ANSI: 4
sd 23:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB)
sd 23:0:0:0: [sda] Write Protect is off
sd 23:0:0:0: [sda] Mode Sense: 1c 00 00 00
sd 23:0:0:0: [sda] Assuming drive cache: write through
sd 23:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB)
sd 23:0:0:0: [sda] Write Protect is off
sd 23:0:0:0: [sda] Mode Sense: 1c 00 00 00
sd 23:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 23:0:0:0: [sda] Attached SCSI disk
sd 23:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete


dmesg (after hdd dissappeared)
sd 23:0:0:0: [sda] Device not ready: <6>: Sense Key : Not Ready [current]
: Add. Sense: Logical unit not ready, initializing command required
end_request: I/O error, dev sda, sector 163
FAT: FAT read failed (blocknr 100)
sd 23:0:0:0: [sda] Device not ready: <6>: Sense Key : Not Ready [current]
: Add. Sense: Logical unit not ready, initializing command required
end_request: I/O error, dev sda, sector 975121
...etc etc (for pages)

onebuck 07-09-2009 08:18 PM

Hi,

Welcome to LQ!

How do you have the hdd connected? Via a powered or un-powered hub?

Qew 07-09-2009 09:44 PM

There's an issue with Seagate Freeagents with the drive's firmware, which when it shuts down due to being unused for a certain amount of time (fifteen mins, but I've heard less on occasion), will power down. Normally, what you'd expect is that if the drive has powered down, it'll wake up after receiving a signal to be used, but this doesn't happen properly with kernels prior to 2.6.24 with that Seagate drive. I notice that Mandriva 2008 shipped with kernel 2.6.22, which would be prior to the working kernel version I mentioned.

My suggestion would be either to upgrade your kernel to a newer version that supports the fix, upgrade your distro to a newer version (which should give you a kernel beyond the fix), or write a cron job that reads the disk every few minutes (downside is that the drive will always be running, but that could also be a good thing, depending on what you want the drive for).

I have a similar drive to yours, and the drive works fine with my Debian Lenny 2.6.26 kernel. It'll power down, but when I want to access it, it'll spin right up again.

Oh, below are some links to the problem and hackish solutions. Hope they're useful to you.

DealWithAutoSpinDownOnSeagateFreeAgent

Diane Trout - FreeAgent Drives

biggles1963 07-10-2009 12:09 AM

Thank you!
 
Thanks for the reply. It is the segate freeagent & it does seem to be a timeout thing. It makes a lot of sense. Now all I have to do is to figure out how to upgrade the kernal.

I tried a dual usb cable (the ones they used to use to take power from two ports) directly into the PC which didn't help so I guessed it wasn't power.

Robin.

onebuck 07-10-2009 06:45 AM

Hi,

The 'Seagate Freeagent' does have external power via wall wart. I was thinking about the 2.5" units that source from the USB. You could try an move to another computer too see if indeed the issue is the port.

biggles1963 07-10-2009 08:10 AM

I've tried putting a cron job to write to the Segate Freeagent every 2 minutes (a bit extreme but if it works I can throttle it back).

Question: It's supposed to fire every 2 minutes but it's almost an hour before it first fires.... please explain?

$ crontab -l
2 * * * * /home/robin/bin/wakeUpSegateFreeagent


# tail /var/log/cron/info.log
Jul 10 22:12:22 localhost crontab[8850]: (robin) END EDIT (robin)
Jul 10 22:13:01 localhost crond[3160]: (robin) RELOAD (cron/robin)
Jul 10 23:01:01 localhost crond[9463]: (root) CMD (nice -n 19 run-parts --report /etc/cron.hourly)
Jul 10 23:02:02 localhost crond[9472]: (robin) CMD (/home/robin/bin/wakeUpSegateFreeagent)

Qew 07-10-2009 10:48 AM

Quote:

Originally Posted by biggles1963 (Post 3603283)
I've tried putting a cron job to write to the Segate Freeagent every 2 minutes (a bit extreme but if it works I can throttle it back).

Question: It's supposed to fire every 2 minutes but it's almost an hour before it first fires.... please explain?

$ crontab -l
2 * * * * /home/robin/bin/wakeUpSegateFreeagent


# tail /var/log/cron/info.log
Jul 10 22:12:22 localhost crontab[8850]: (robin) END EDIT (robin)
Jul 10 22:13:01 localhost crond[3160]: (robin) RELOAD (cron/robin)
Jul 10 23:01:01 localhost crond[9463]: (root) CMD (nice -n 19 run-parts --report /etc/cron.hourly)
Jul 10 23:02:02 localhost crond[9472]: (robin) CMD (/home/robin/bin/wakeUpSegateFreeagent)

You've got it set to run at two minutes past each hour, which would explain why it runs hourly. What you want to do is below:

*/2 * * * * /home/robin/bin/wakeUpSegateFreeagent

biggles1963 07-10-2009 07:04 PM

I am so in love with you guys and this forum! I'm looking forward to being able to post some advice instead of just distress calls.

re: the segate freeagent problem. I used urpmi to update the kernel to the latest. It only went as far as 2.6.22.19-desktop-2mdv
but it seems to have done the job. The drive goes to sleep but it restarts as soon as you access it (it's been connected for over an hour now).

I don't need the cron anymore, but it's something I'm very pleased to have learned.

..........I may have spoken to soon. It's still exhibiting some funny behaviour, ie Konquerer can still see it but my apps (eg OpenOffice) can't save. Anyway, I've discovered a directory sync (DirSyncPro) which lets me sync directories quickly and work from the local copy. I spent a night trying to install mandriva 2009 which struck me as a good reason to change distros & I've reverted back to 2008.

Qew 07-10-2009 07:29 PM

Yeah, Mandriva might have backported the fix to that kernel you updated to fix that problem. Glad you got it solved.


All times are GMT -5. The time now is 02:30 PM.