Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Linux and spin down Hard Disk

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Linux and spin down Hard Disk

#1 Post by Rocker85 »

Time I read that in the Linux kernel there is a bug against the aggression of energy saving and excessive work of the heads of the hard disk ...

Seeing the preferences of xfce4-power-manager, I found the option

- Slow down hard drives

is connected to this topic?

emariz
Posts: 2901
Joined: 2008-10-17 07:59

Re: Linux and spin down Hard Disk

#2 Post by emariz »

I do not use Xfce, but in Gnome, this feature depends on hdparm. Check if it is installed and read its manual page to test it on the command line first.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#3 Post by Rocker85 »

hadparm is installed by default(i have debian testing)

where is its manual page???

Thank u :wink:

kaymre
Posts: 44
Joined: 2012-07-04 19:07

Re: Linux and spin down Hard Disk

#4 Post by kaymre »

run "man hdparm"

or online here http://linux.die.net/man/8/hdparm

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#5 Post by Rocker85 »

how can i understund if hdparm is connected with xfce4-power-manager?

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Linux and spin down Hard Disk

#6 Post by pcalvert »

Hi,

What I did was added the desired command to the bottom of my /etc/hdparm.conf file.

Here's the exact code that I added:

Code: Select all

# Use less aggressive power management to minimize
# wear and tear on the hard disk drive
command_line {
       hdparm -B 200 /dev/sda
}
Of course, you may need to modify that code depending on the hard disk drive(s) you want to control and how aggressive you want the power management to be.

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#7 Post by Rocker85 »

pcalvert wrote:Hi,

What I did was added the desired command to the bottom of my /etc/hdparm.conf file.

Here's the exact code that I added:

Code: Select all

# Use less aggressive power management to minimize
# wear and tear on the hard disk drive
command_line {
       hdparm -B 200 /dev/sda
}
Of course, you may need to modify that code depending on the hard disk drive(s) you want to control and how aggressive you want the power management to be.

Phil
Thank u for reply..how check if my HD now has an aggressive energy management?

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Linux and spin down Hard Disk

#8 Post by vbrummond »

Run hdparm -B /dev/devicename as root. So if your device is /dev/sda, run:

Code: Select all

hdparm -B /dev/sda
It should show a value higher than 128, generally values in the 200s do not spin down. I use 254.
Always on Debian Testing

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#9 Post by Rocker85 »

vbrummond wrote:Run hdparm -B /dev/devicename as root. So if your device is /dev/sda, run:

Code: Select all

hdparm -B /dev/sda
It should show a value higher than 128, generally values in the 200s do not spin down. I use 254.
say OFF

Code: Select all

root@marcus:/home/marcus# hdparm -B /dev/sda

/dev/sda:
 APM_level	= off
root@marcus:/home/marcus# 
:?

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Linux and spin down Hard Disk

#10 Post by vbrummond »

Then the device probably does not support power management. I am not sure.
Always on Debian Testing

User avatar
ComputerBob
Posts: 1181
Joined: 2007-11-30 04:49
Location: The Mountains of the Sunshine State
Been thanked: 1 time

Re: Linux and spin down Hard Disk

#11 Post by ComputerBob »

vbrummond wrote:Then the device probably does not support power management. I am not sure.
Here's what I get from my HD, on which power management is not supported:

Code: Select all

root@pavilion:/home/computerbob# hdparm -B /dev/sda

/dev/sda:
 APM_level	= not supported
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#12 Post by Rocker85 »

i'm confuded :shock:

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Linux and spin down Hard Disk

#13 Post by pcalvert »

Rocker85 wrote: say OFF

Code: Select all

root@marcus:/home/marcus# hdparm -B /dev/sda

/dev/sda:
 APM_level	= off
root@marcus:/home/marcus# 
:?
Did you reboot first before trying that command?

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#14 Post by Rocker85 »

pcalvert wrote:
Rocker85 wrote: say OFF

Code: Select all

root@marcus:/home/marcus# hdparm -B /dev/sda

/dev/sda:
 APM_level	= off
root@marcus:/home/marcus# 
:?
Did you reboot first before trying that command?

Phil
i have just on my laptop

same result

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Linux and spin down Hard Disk

#15 Post by pcalvert »

What happens if you do this (as root)?

Code: Select all

hdparm -B 200 /dev/sda
hdparm -B /dev/sda
Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#16 Post by Rocker85 »

Code: Select all

root@marcus:/home/marcus# hdparm -B 200 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0xc8 (200)
 APM_level	= 200
root@marcus:/home/marcus# hdparm -B /dev/sda

/dev/sda:
 APM_level	= 200
root@marcus:/home/marcus# 

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Linux and spin down Hard Disk

#17 Post by pcalvert »

What is the output of this command?:

Code: Select all

cat /etc/hdparm.conf
Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#18 Post by Rocker85 »

Code: Select all

root@marcus:/home/marcus# cat /etc/hdparm.conf
## This is the default configuration for hdparm for Debian.  It is a 
## rather simple script, so please follow the following guidelines :)
## Any line that begins with a comment is ignored - add as many as you 
## like.  Note that an in-line comment is not supported.  If a line 
## consists of whitespace only (tabs, spaces, carriage return), it will be
## ignored, so you can space control fields as you like.  ANYTHING ELSE
## IS PARSED!!  This means that lines with stray characters or lines that 
## use non # comment characters will be interpreted by the initscript.  
## This has probably minor, but potentially serious, side effects for your 
## hard drives, so please follow the guidelines.  Patches to improve 
## flexibilty welcome.  Please read /usr/share/doc/hdparm/README.Debian for 
## notes about known issues, especially if you have an MD array.
##
## Note that if the init script causes boot problems, you can pass 'nohdparm' 
## on the kernel command line, and the script will not be run.
##
## Uncommenting the options below will cause them to be added to the DEFAULT
## string which is prepended to options listed in the blocks below.
##
## If an option is listed twice, the second instance replaces the first.
##
## /sbin/hdparm is not run unless a block of the form:
##      DEV {
##         option
##         option
##         ...
##      }
## exists.  This blocks will cause /sbin/hdparm OPTIONS DEV to be run.
## Where OPTIONS is the concatenation of all options previously defined
## outside of a block and all options defined with in the block.

# -q be quiet
quiet 
# -a sector count for filesystem read-ahead
#read_ahead_sect = 12
# -A disable/enable the IDE drive's read-lookahead feature
#lookahead = on
# -b bus state
#bus = on
# -B apm setting
#apm = 255
# -B apm setting when on battery
#apm_battery = 127
# -c enable (E)IDE 32-bit I/O support - can be any of 0,1,3
#io32_support = 1
# -d disable/enable the "using_dma" flag for this drive
#dma = off
# -D enable/disable the on-drive defect management
#defect_mana = off
# -E cdrom speed
#cd_speed = 16
# -k disable/enable the "keep_settings_over_reset" flag for this drive
#keep_settings_over_reset = off
# -K disable/enable the drive's "keep_features_over_reset" flag
#keep_features_over_reset = on
# -m sector count for multiple sector I/O
#mult_sect_io = 32
# -P maximum sector count for the drive's internal prefetch mechanism
#prefetch_sect = 12
# -r read-only flag for device
#read_only = off
# -s Turn on/off power on in standby mode
# poweron_standby = off
# -S standby (spindown) timeout for the drive
#spindown_time = 24
# -u interrupt-unmask flag for the drive
#interrupt_unmask = on
# -W Disable/enable the IDE drive's write-caching feature
#write_cache = off
# -X IDE transfer mode for newer (E)IDE/ATA2 drives
#transfer_mode = 34
# -y force to immediately enter the standby mode
#standby
# -Y force to immediately enter the sleep mode
#sleep
# -Z Disable the power-saving function of certain Seagate drives
#disable_seagate
# -M Set the acoustic management properties of a drive
#acoustic_management
# -p Set the chipset PIO mode
# chipset_pio_mode
# --security-freeze Freeze the drive's security status
# security_freeze
# --security-unlock Unlock the drive's security
# security_unlock = PWD
# --security-set-pass Set security password
# security_pass = password
# --security-disable Disable drive locking
# security_disable
# --user-master Select password to use
# user-master = u
# --security-mode Set the security mode
# security_mode = h

# Root file systems.  Please see README.Debian for details
# ROOTFS = /dev/hda

## New note - you can use straight hdparm commands in this config file 
## as well - the set up is ugly, but it keeps backwards compatibility
## Additionally, it should be noted that any blocks that begin with 
## the keyword 'command_line' are not run until after the root filesystem
## is mounted.  This is done to avoid running blocks twice.  If you need 
## to run hdparm to set parameters for your root disk, please use the 
## standard format.

#Samples follow:
#First three are good for devfs systems, fourth one for systems that do 
#not use devfs.  The fifth example uses straight hdparm command line
#syntax.  Any of the blocks that use command line syntax must begin with
#the keyword 'command_line', and no attempt is made to validate syntax.  
#It is provided for those more comfortable with hdparm syntax. 

#/dev/discs/disc0/disc {
#	mult_sect_io = 16
#	write_cache = off
#	spindown_time = 240
#}

#/dev/discs/disc1/disc {
#	mult_sect_io = 32
#	spindown_time = 36
#	write_cache = off
#}

#/dev/cdroms/cdrom0 {
#	dma = on		   
#	interrupt_unmask = on
#	io32_support = 0
#}

#/dev/hda {
#	mult_sect_io = 16
#	write_cache = off
#	dma = on
root@marcus:/home/marcus# 

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Linux and spin down Hard Disk

#19 Post by pcalvert »

Copy the text in the box below and save it as a text file called hdparm-addon.txt
Use a text editor such as gedit, kate, leafpad, mousepad, etc.
Save the file wherever you want.

Code: Select all

# Use less aggressive power management to minimize
# wear and tear on the hard disk drive
command_line {
       hdparm -B 200 /dev/sda
}

#
Now, making sure that you are in the same directory as hdparm-addon.txt,
run these commands as root:

Code: Select all

cp -p /etc/hdparm.conf /etc/hdparm.conf.bak.20130617
cat hdparm-addon.txt >> /etc/hdparm.conf
Reboot and then run this command (as root):

Code: Select all

hdparm -B /dev/sda
Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Rocker85
Posts: 67
Joined: 2011-08-24 08:09

Re: Linux and spin down Hard Disk

#20 Post by Rocker85 »

Code: Select all

root@marcus:/home/marcus# cp -p /etc/hdparm.conf /etc/hdparm.conf.bak.20130617
root@marcus:/home/marcus# cat hdparm-addon.txt >> /etc/hdparm.conf
cat: hdparm-addon.txt: File o directory non esistente
root@marcus:/home/marcus# 

Post Reply