LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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?

Notices

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

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


Hi,

I have used the following code for HDD spindown.

Quote:
{
#ifndef WIN_STANDBYNOW1
#define WIN_STANDBYNOW1 0xE0
#endif
#ifndef WIN_STANDBYNOW2
#define WIN_STANDBYNOW2 0x94
#endif
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?

Regards,
Vijay
 
Old 05-08-2010, 08:14 PM   #2
DragonSlayer48DX
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?

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

Original Poster
Rep: Reputation: 0
Hi

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.

-Vijay
 
  


Reply

Tags
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 11:40 AM
Screen shakes/wobbles on external HDD spin-up Speng Linux - Hardware 1 01-16-2009 05:07 PM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 07:45 PM
to spin down or not to spin down, that is the question maenho Linux - Software 2 02-05-2005 09:41 AM
hd spin down Henning_1 Linux - Hardware 2 09-24-2004 10:00 AM


All times are GMT -5. The time now is 11:57 AM.

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