LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-02-2013, 08:31 AM   #1
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 86

Rep: Reputation: 15
Question HDD spindown info as normal user (script)


Hi all,

I'm trying to monitor my HDD spin state: are they running or idle.
I have a build a small script using hdparm, but it needs to be run as root, wich is absolutely not an option.

Does someone know how I could get this info a normal user? Some cat /proc/something?

Thanks!

Benjamin
 
Old 12-03-2013, 04:11 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399
Did you have a look at /sys/block/sd?/device/?

state might be of interest to you.
 
Old 12-03-2013, 04:29 AM   #3
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 86

Original Poster
Rep: Reputation: 15
Thumbs up Thanks!

Thanks a lot, indeed it looks like what I'm looking for

Now I just need to find out what are the different states...
 
Old 12-03-2013, 04:46 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399
Quote:
Originally Posted by benjalien View Post
Thanks a lot, indeed it looks like what I'm looking for

Now I just need to find out what are the different states...
running is one (confirmed) and I do believe offline is another one (cannot confirm that atm).
 
Old 12-03-2013, 05:27 AM   #5
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 86

Original Poster
Rep: Reputation: 15
Well, I think I rejoyed too quickly...

root@raid:/home/benjalien# cat /sys/block/sdf/device/state
running
root@raid:/home/benjalien# hdparm -C /dev/sdf

/dev/sdf:
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

One command is giving "standby" and the other "running" :'(
 
  


Reply

Tags
bash, hdd, hdparm, root


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
super user privileges check for a normal user in bash script freeindy Programming 2 08-01-2008 07:08 AM
Unable to mount USB HDD as normal user brisbin33 Arch 3 07-25-2008 07:10 AM
IDE HDD spindown iiv Slackware 2 06-06-2008 07:46 AM
where to get linux administrator script, ex: script to let's user change user info. hocheetiong Linux - Server 1 03-17-2008 01:06 AM
How to copy all User and Samba info to new HDD MichaelP Linux - Networking 2 03-06-2005 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:35 PM.

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
Open Source Consulting | Domain Registration