I've hunted around on various forums but everything seems distro specific.
I'm running the latest debian image from a USB Laptop HDD and want it to spin down when idle for a period of time so the drive doesn't end up dying on me.
I've tried HDParam on it but get SG_IO bad/missing sense data.
Any input is appreciated
when you get the answer let me know - this was another roadblock on my previous SLUG centred attempt on a silent, low power, near-zero-moving-part home server....
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?
Yes hdparm is he way to do this. Can make things a tad unstable, when the OS tries to access the hard disk, and it needs to spin up first, things time out.
There are various flags you can pass, -y -Y -s -S, read the man page.
Not all hard drive take all options - but you might as well try. Usually some work.
I tried all night last night, but HDParm kept giving me errors, so I'm tempted to try it in an old USB/SATA bridge from a TrekStor caddy that behaved quite well, in terms of spinning itself down...
Have you tried sdparm?
[moderator removed outdated link]
FollowingGhosts wrote:I tried all night last night, but HDParm kept giving me errors ...
what errors out of interest
I've usually found errors are bcause the HDD doesn't support some options ...
Hi
Just been playing around to get my pi set up as a simple NAS and will be syncing files daily for backup. I'm completely new to Linux so it's taken a bit of time to get it working (lot's of reading!), but have managed to get my external HDD to spin down (which never used to even with my Windows machine I use everyday).
At boot I'm running sudo /sbin/hdparm -S120 /dev/sda1 . This shuts down the drive after 10 minutes. When I try to open a folder on the mapped drive, it spins up and allows me to access my files. No errors so far!
For me, this project has proved the value of the Pi - in that it has reignited my enjoyment with playing around with computers - rather than just using them!
I was trying to get my WD My Passport 500GB drive to spin down after 10minutes in Openelec.
I tried various hdparm commands, and found that while I could read various settings from the drive, I could not write any settings back to the drive.
I wanted the drive to power down after 10 idle minutes, in the end the easiest way for me to set this was to connect the drive to a Windows PC, load up the WD Smartware software, and from there set the sleep timer to 10mins.
It worked, when I connected the drive back onto my raspberry pi, it spun down properly after 10 idle minutes.
I have no idea what the following post is fully about but it seems to have something in it I hope this is helpful if not sorry.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
Solid State Disks are getting cheap. $50 or less now for 64GB. $80 or so for 128GB
In my case, the RPi just uses SMB to access shares on my small NAS via the LAN or WiFi LAN.
All of the media my RPi accesses is via a NAS using the WiFi (no LAN) with a mounted partition(s).
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com
I am using an old (7 years?) WD 320 GB Drive with an ICIDU USB3.0 enclosure I picked up at the store yesterday. Gave it a shot.
The persist through reset flags give a bunch of errors:
Code: Select all
sudo hdparm -k1 -K1 -S120 /dev/sda
/dev/sda:
setting keep_settings to 1 (on)
HDIO_SET_KEEPSETTINGS failed: Invalid argument
setting drive keep features to 1 (on)
HDIO_DRIVE_CMD(keepsettings) failed: Input/output error
setting standby to 120 (10 minutes)
HDIO_GET_KEEPSETTINGS failed: Invalid argumentRunning the command without additional flags works fine however:
Code: Select all
pi@raspberrypi ~ $ sudo hdparm -S120 /dev/sda
/dev/sda:
setting standby to 120 (10 minutes)
I can hear it spin down after 10 minutes now.
To set this setting every time the pi boots, I have edited /etc/hdparm.conf:
This is untested as my pi has a few things running and can't just be rebooted. Should work in theory though.
To save the sanity of anyone who found this thread...
sometimes the USB controller doesn't support telling the HDD to spindown... thus (if you haven't broken your HDD through overheating already) you need to buy a new USB HDD controller that supports spinning down...
the only question is.... how do you find a cheap USB controller for a 2.5" drive that supports the spindown command?
jago25_98 wrote:how do you find a cheap USB controller for a 2.5" drive that supports the spindown command?
I use a USB to 3.5"PATA/2.5"PATA/SATA adaptor with a Jmicron chip. They are very common and cheap on ebay from china (around 2 quid).
I just tested to see if it supports the spindown settings, and, although hdparm did give a "failed: Invalid argument" message, the setting did work.
Code: Select all
debian:~# hdparm -S5 /dev/sdb
/dev/sdb:
setting standby to 5 (25 seconds)
HDIO_DRIVE_CMD(setidle) failed: Invalid argument
(I tried this on my Debian laptop, as my Pi is busy doing other things)
I'm trying to do achive the external usb hdd spin down.
Each hdparm command always return "SG_IO: bad/missing sense data, sb[]: "
Code: Select all
sudo hdparm -S5 /dev/sda
/dev/sda:
setting standby to 5 (25 seconds)
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Someone is able to suggest me how to spin down my external usb hdd?
I found out that the "error" message is something normal ![]()
I tried
Code: Select all
sudo hdparm -Y /dev/sda
/dev/sda:
issuing sleep command
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
sudo hdparm -C /dev/sda
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
drive state is: standby
but the drive still turn ![]()
Another edit:
with
or
Code: Select all
sudo sdparm --command=stop /dev/sda
the drive immediatly stop turning and wake up when need..
Now I have to understand how to configure a delay to run this command and how to run it ![]()
Great to be getting somewhere on this:
does spin down the drive for me but then it spins straight up again. The drive isn't mounted so I can't see anything trying to access it...
My usb hdd is mounted through fstab, my problem is that it only spindown when the command is run and not after x seconds ![]()
mcgyver83 wrote:I had to restart from scratch and now I'm not able to install sdparm from apt-get (raspbian jessie).
Any hints?
I reckon you're going to have to pull the source code and compile it.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on Bluesky or by LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Can I move sorces.list back to wheezy and install sdparm with apt-get?
Compilation done
Usb external HD now is silent ![]()
Return to “General discussion”
Jump to