VectorLinux

The nuts and bolts => Hardware & Drivers => Topic started by: pdq1234 on January 07, 2013, 05:40:33 pm

Title: Soved with hardware usb 1.0 card, thanks everyone for your help.
Post by: pdq1234 on January 07, 2013, 05:40:33 pm
I'm sure this is on here some place, but I did a search and looked threw a few pages of several sections and did not find a thread.  

Anyway what happens is my external usb sata hard drive goes into power save mode and I get error like I pulled the usb hard drive or shut it off, etc.   I can get it back by pulling the usb cable out and pluging it back in or shutting power off on the drive and turning it on.   I have all the power save modes set to always on that I could find in system menu.  I also have the power save modes as always on in BIOS too.   I'm figuring there is an additional driver or I need send a command to set the external usb hard drive as always on or something.

I'm using Vector linux 7.0 on an old duron 1.3ghz, but over all it seems to run fine, at least so far, but I haven't had vector linux on the machine for long.  
Title: Re: USB hard drive going into power save shutdown
Post by: bigpaws on January 07, 2013, 06:27:16 pm
Give this a shot:

https://bbs.archlinux.org/viewtopic.php?id=44906 (https://bbs.archlinux.org/viewtopic.php?id=44906)

Bigpaws
Title: Re: USB hard drive going into power save shutdown
Post by: pdq1234 on January 07, 2013, 07:23:31 pm
Give this a shot:

https://bbs.archlinux.org/viewtopic.php?id=44906 (https://bbs.archlinux.org/viewtopic.php?id=44906)

Bigpaws


Hey thanks for the link.

I have a couple of questions.

First off as that link you posted is really old from 2008, are you positive this will work on Vector 7.0, "install the sdpam utility for my Debian Etch distro"?   I'm pretty new to Linux but I in Ubuntu 11.04/11.10/12.04 some Debian stuff worked and others did not.

My other question is once I get the sdpam (sdparm?) utility, I run this in a terminal window  "sdparm --clear STANDBY -6 /dev/sd[Your device]" or did I mess up something?  Also should I run it with SUDO in front?   I'm kina scared of hdparm, Is sdparm the same?    I ran into a problem on hard drive parameters on Ubuntu while reconfiguring a swap partition and some how hosed part of a windows drive partition on a different drive.   Luckily the drive didn't have anything to worry about on it.   I don't want to do that on the USB as it has a lot of stuff on it.


Title: Re: USB hard drive going into power save shutdown
Post by: retired1af on January 08, 2013, 04:30:23 am
sdparm should already be installed on your system. You can use it to turn off the flags that cause the drive to go into sleep mode.

This should give you a fairly good idea on what to do. http://www.ctrlv.ca/2010/04/181/
Title: Re: USB hard drive going into power save shutdown
Post by: pdq1234 on January 09, 2013, 03:16:26 am
sdparm should already be installed on your system. You can use it to turn off the flags that cause the drive to go into sleep mode.

This should give you a fairly good idea on what to do. http://www.ctrlv.ca/2010/04/181/

Thanks, I'll try it out.

Title: Re: USB hard drive going into power save shutdown
Post by: pdq1234 on January 09, 2013, 05:12:47 pm
I am running into a snag, I think the drive looks to be coming up as a hard drive rather than as a usb device.
I get this with "sdparm -a /dev/sdc"
"open error: /dev/sdc [read only]: No such file or directory"

If I look when the usb drive is recognized, before it powers down, is the drives volume label when I look with file manager in "media". 
I should have mentioned this before, I'm not sure if it makes a difference but the usb drive is formatted windows fat32.
OH something else that it does is restart after a little while and open a new file manager window and then it times out shuts off and ..... real annoying.
Anyway any other ideas how to fix this?
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: bigpaws on January 09, 2013, 05:34:08 pm
This may also be something to do with the USB device setting for the drive

Bigpaws
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: pdq1234 on January 09, 2013, 06:08:58 pm
This may also be something to do with the USB device setting for the drive

Bigpaws

I'm pretty sure there aren't any settings, and no jumpers for sure, not even a place to solder one on, on the device.     Its an external drive case with a SATA drive in it that plugs into a USB port,  the critter didn't have any software with it or available on their web site either.  That's the big problem with modern crap hardware no way to config things if default won't work.  So I'm jumping threw hoops to find a software fix.  And search ain't working worth shit as I don't know the exact way to state the problem.

It seems to be power save to me as it stays on when writing but shuts off if left alone or when reading a big file.  And after it shuts off you can't restart the read even after the drive is reloaded, like when when trying to copy a big file off the drive it stops and the drive disappears from file manager and that's it.



Title: Re: USB hard drive going into power save shutdown
Post by: retired1af on January 10, 2013, 04:38:48 am
I am running into a snag, I think the drive looks to be coming up as a hard drive rather than as a usb device.
I get this with "sdparm -a /dev/sdc"
"open error: /dev/sdc [read only]: No such file or directory"

If I look when the usb drive is recognized, before it powers down, is the drives volume label when I look with file manager in "media". 
I should have mentioned this before, I'm not sure if it makes a difference but the usb drive is formatted windows fat32.
OH something else that it does is restart after a little while and open a new file manager window and then it times out shuts off and ..... real annoying.
Anyway any other ideas how to fix this?


Are you mounting the drive before you run sdparm?
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: bigpaws on January 10, 2013, 08:17:01 am
Perhaps Name, Make and Model would be in order.

That way research is a little easier.

Bigpaws
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: overthere on January 10, 2013, 08:37:24 am
I am curious and wondering if you have done a best of three. if it appears to time out is the time consistent, you say it does this on large files so if you have three different.... also if you have a couple of live cd you could test on other systems to see if it does the same. may help to pin it to something via time or if it is vector specific. perhaps you have done this, was just a thought while reading.
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: retired1af on January 10, 2013, 09:15:21 am
I am curious and wondering if you have done a best of three. if it appears to time out is the time consistent, you say it does this on large files so if you have three different.... also if you have a couple of live cd you could test on other systems to see if it does the same. may help to pin it to something via time or if it is vector specific. perhaps you have done this, was just a thought while reading.

This is a common problem with some USB drives. If you do a search, you'll see it's not limited to a specific distribution. The drive itself is responsible for letting the OS know it's time to go to sleep.
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: overthere on January 10, 2013, 03:16:28 pm
Yes, I guessed it was related to newer sata usb. I have an older usb enclosure for ide drives but it will take various drives, I thought it may be a newer version with sata or ide and perhaps the time out would shed some light ..the links suggest that sdparm is the key..perhaps I should stick to reading...cheers
Title: Re: USB hard drive going into power save shutdown
Post by: pdq1234 on January 10, 2013, 08:25:19 pm
I am running into a snag, I think the drive looks to be coming up as a hard drive rather than as a usb device.
I get this with "sdparm -a /dev/sdc"
"open error: /dev/sdc [read only]: No such file or directory"

If I look when the usb drive is recognized, before it powers down, is the drives volume label when I look with file manager in "media". 
I should have mentioned this before, I'm not sure if it makes a difference but the usb drive is formatted windows fat32.
OH something else that it does is restart after a little while and open a new file manager window and then it times out shuts off and ..... real annoying.
Anyway any other ideas how to fix this?


Are you mounting the drive before you run sdparm?

Yes I did try that, no go.
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: pdq1234 on January 10, 2013, 08:28:54 pm
Perhaps Name, Make and Model would be in order.

That way research is a little easier.

Bigpaws

The case is a IO magic, its a pretty generic SATA to USB.
I have several drives, I swap in and out of it.
One is a Hitachi, and several Western Digital's. all have the power save bit, which I'm thinking is my problem.
Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: pdq1234 on January 10, 2013, 08:32:39 pm
I am curious and wondering if you have done a best of three. if it appears to time out is the time consistent, you say it does this on large files so if you have three different.... also if you have a couple of live cd you could test on other systems to see if it does the same. may help to pin it to something via time or if it is vector specific. perhaps you have done this, was just a thought while reading.

Yes it seems to be exactly the same amount of time.

It times out(shuts off is the effect, drive disapears from system it will come back, I'm guessing this is from rescan of USB by Linux?) if setting, times out if reading, but seems to stay while writing but times out after write is over.

These things have the same bugs on windows.

Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: pdq1234 on January 10, 2013, 08:42:32 pm
I am curious and wondering if you have done a best of three. if it appears to time out is the time consistent, you say it does this on large files so if you have three different.... also if you have a couple of live cd you could test on other systems to see if it does the same. may help to pin it to something via time or if it is vector specific. perhaps you have done this, was just a thought while reading.

This is a common problem with some USB drives. If you do a search, you'll see it's not limited to a specific distribution. The drive itself is responsible for letting the OS know it's time to go to sleep.

Yep, I found an old driver(combo of drivers) to fix windows, a few years ago. I'm sure Linux will work, its just finding the commands or package I need.

There is a command you can send to the hard drive its self to set the drive not to time out but I have no idea what it is or how you would send in in Linux and it doesn't save when the drive is powered off it will go back to default.

I'm wondering if there is just some way to set the time Linux will wait for the drive to restart and if that would even work right?

I'll keep looking and thanks everyone for your help.

Title: Re: update,help, USB hard drive power save shutdown sdparm not recognising drive?
Post by: pdq1234 on January 10, 2013, 08:57:04 pm
I just found this link on Google but have no idea if it has the info I need or not, but it may give someone an idea who knows more about Linux.
http://www.mjmwired.net/kernel/Documentation/usb/power-management.txt (http://www.mjmwired.net/kernel/Documentation/usb/power-management.txt)

I see others have taken actions to work around the problem see his post towards the end of this page.     http://ask.metafilter.com/36580/Why-wont-my-USB-hard-drive-stay-mounted-without-constant-disk-access (http://ask.metafilter.com/36580/Why-wont-my-USB-hard-drive-stay-mounted-without-constant-disk-access)

However this does not seem a viable work around to me, as it would seem to cause problems with reading and writing to the usb hard drive with this cron thing writing this little file in the middle of say copying a big file off the drive, etc. I would think it was also torture on the drive writing all the time.

I know there have to be lots of people using these critters and someone has to know the right way to fix this?

Thanks for any help you can give me.
Title: Re: still need help, USB hard drive disco's, help, help help
Post by: bigpaws on January 11, 2013, 09:03:52 am
There is one common denominator. The I/O magic case.

That is where there is more than likely firmware that is
making these drives suspend. The newer drives also have
spin down set on the hard drives. Which is what some of the
posts were trying to get at.

This may get you somewhere:

http://sobell.com/mgsblog/archives/5 (http://sobell.com/mgsblog/archives/5)

DISCLAIMER:
I skimmed the information and I have used these commands before.
However that does not reduce the risk of loosing data. Only use
on a drive where the data can be lost.

HTH

Bigpaws
Title: Re: still need help, USB hard drive disco's, help, help help
Post by: overthere on January 11, 2013, 03:48:01 pm
del
Title: Re: still need help, USB hard drive disco's, help, help help
Post by: pdq1234 on January 11, 2013, 05:11:05 pm
There is one common denominator. The I/O magic case.

That is where there is more than likely firmware that is
making these drives suspend. The newer drives also have
spin down set on the hard drives. Which is what some of the
posts were trying to get at.

This may get you somewhere:

http://sobell.com/mgsblog/archives/5 (http://sobell.com/mgsblog/archives/5)

DISCLAIMER:
I skimmed the information and I have used these commands before.
However that does not reduce the risk of loosing data. Only use
on a drive where the data can be lost.

HTH

Bigpaws

The drives themselves(WD green and Hitachi green) have a spindown feature and will spindown to save power when not accessed after a set time all by themselves on any interface, SATA in a machine or on the USB SATA enclosure, they will then restart when they are accessed again.  

Thanks for the link as far as I can tell(So far I don't know much about Linux, in the future I hope to change that, but at the moment I need help to get things working.), I think that link you gave me has the info needed to get this working as long as someone can tell me the exact way to enter this,  
"With an argument of 0 (zero), the –S option prevents the drive from entering low-power mode and spinning down. The numeric arguments cause the drive to spin down after a specified period of inactivity. An argument in the range of 1-240 causes the drive to spin down after nx5 seconds (120 causes the drive to spin down after 10 minutes of inactivity). An argument in the range 241-251 cause the drive to spin down after (n-240)x30 minutes. These values may vary between drive manufacturers." ,
As you see it doesn't explain how to setup the command for the terminal(Almost all the commands had examples but this one.   >:(   ), as far as I can tell it would be something like "sudo hdparm -s /dev/sdf  ? ? ?" ware the ? ? ? bit is the numeric argument? but I could not find an example of how to do it.  

I searched and found this link which has all the hdparm entries
http://www.clearfoundation.com/docs/man/index.php?s=8&n=hdparm (http://www.clearfoundation.com/docs/man/index.php?s=8&n=hdparm)
but it has no example of how to enter the -S command either.
(On a personal note, I wonder why the programmer created parameters for hdparm in both upper and lower case letters that do different things?   This seems real scary to me, in that simply putting in the wrong case could screw up your hard drives data.)

If someone could help me out and show me the exact commands to use to shut off the spindown all together I would be most great full.  

Also how would I make this permanent so the drive is always set so it doesn't spindown.  

I only have the USB drive on when I'm reading or writing to it anyway, as I figure the less a hard drive runs the longer it will last.

Anyway thanks for the help.

Title: Re: still need help, USB hard drive disco's, help, help help
Post by: bigpaws on January 11, 2013, 05:21:23 pm
Sudo is not setup on Vector Linux.

Open a terminal and then use su
and enter root password.

Then issue the hdparm command:

hdparm -S 0 /dev/sdb

That will turn off spin down on the drive. Please note to change to the
appropriate drive.

Linux is case sensitive. Cost and cost are not the same thing.
The reason for switches to be upper and lower case is that it adds
another 26 letters to use before needing to do something else.

HTH

Bigpaws
Title: Re: still need help, USB hard drive disco's, help, help help
Post by: pdq1234 on January 11, 2013, 09:02:47 pm
Sudo is not setup on Vector Linux.

Open a terminal and then use su
and enter root password.

Then issue the hdparm command:

hdparm -S 0 /dev/sdb

That will turn off spin down on the drive. Please note to change to the
appropriate drive.

Linux is case sensitive. Cost and cost are not the same thing.
The reason for switches to be upper and lower case is that it adds
another 26 letters to use before needing to do something else.

HTH

Bigpaws

That didn't work, I tried another option I found it didn't work either.

Then for some reason my addled mind thought of something I should have tried long before this, I had an old dual port USB 1.x pci card.  I put it in the computer disabled the motherboards USB 2.0 ports fired up vector and wala it worked the first try.   No shut down or well no disconnect anyway, its slower than hell but the drive stays active on the system and you can let it sit for a long while, copy a huge file, play a video, and everything works fine, well almost, you can't play an hd movie off the USB but on USB 1.x I don't really figure it should. 

I'll order me a couple of those cheapo $1.30 Chinese usb 2.x cards and away we go.   This is more of an experiment anyway.  I have a faster computer I was using on Linux but it developed a intermittent problem after a storm.   I think the power supply is messed up, the old boxes power supply is too small to run the newer motherboard or I would have just swapped out the power supply.  I was out of luck till I got a new power supply.   So I was left with the old beast as the only thing I had laying around to play with Linux on.  I figured I'd see if I could find a distro that works on the old Duron, Lubuntu didn't, it was so slow as to be unusable.  I was gona try Xubuntu but when the the download of the ISO was gona take over 5 hours I decided to look around some more.  I saw a site saying Vector Linux was good on old boxes.  I downed a copy and it works quit well.   Actually its about as fast as Ubuntu was on the faster box which has 3 times the clock speed, twice as much ram, and a much faster video card.

Anyway, Thanks everyone for your help.