Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 05-08-2010, 04:34 AM   #1
LQ Newbie
Registered: May 2010
Posts: 2

Rep: Reputation: 0
How to spin-up HDD using ioctl


I have used the following code for HDD spindown.

#define WIN_STANDBYNOW1 0xE0
#define WIN_STANDBYNOW2 0x94
unsigned char args1[4] = {WIN_STANDBYNOW1,0,0,0};
unsigned char args2[4] = {WIN_STANDBYNOW2,0,0,0};
int fd;

if ((fd = open(device, O_RDWR)) < 0)
return -1;

if (ioctl(fd, HDIO_DRIVE_CMD, &args1) &&
ioctl(fd, HDIO_DRIVE_CMD, &args2))
return -1;

return 0;
Is ther any ioctl command to do HDD spin-up from spin-down? or Is there any way to HDD spin-up?

Old 05-08-2010, 07:14 PM   #2
Registered User
Registered: Dec 2006
Posts: 1,454
Blog Entries: 1

Rep: Reputation: 74
Hi, and welcome to LQ!

One simple question-- Why reinvent the wheel, does your power manager not work properly?

Old 05-09-2010, 03:21 AM   #3
LQ Newbie
Registered: May 2010
Posts: 2

Original Poster
Rep: Reputation: 0

I am working for an PVR settop box. In standby mode I have to put HDD in spin-down. Once wakeup i have to spin-up the HDD. So HDD will have power always.



hdd, spindown

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
External HDD spin down / powerdown fjanoos Linux - Hardware 1 09-21-2009 10:40 AM
Screen shakes/wobbles on external HDD spin-up Speng Linux - Hardware 1 01-16-2009 04:07 PM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 06:45 PM
to spin down or not to spin down, that is the question maenho Linux - Software 2 02-05-2005 08:41 AM
hd spin down Henning_1 Linux - Hardware 2 09-24-2004 09:00 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration