Pagina 1 di 1
[Risolto] Conteggio cicli attivazione/disattivazione hd
Inviato: giovedì 26 aprile 2012, 12:48
da gia_72
Salve, ho notato che il Conteggio cicli attivazione/disattivazione del mio hd del notebook è arrivato a circa 49197. Facendo un controllo con alimentazione da rete elettrica ho notato che tale conteggio aumenta di un solo ciclo ad accensione, e fin qui bene. Il problema sussiste quando sono alimentato a batteria perchè il conteggio cicli va su che una bellezza, perchè si incrementa di circa 6 cicli al minuto. Come posso abbassare i cicli di attivazione/disattivazione quando sono alimentato a batteria?
Grazie
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: giovedì 26 aprile 2012, 18:22
da Man from Mars
Al posto di /dev/sda metti eventualmente l'identificativo giusto del device (ma hai un portatile = un solo hard disk quindi sarà sda) ed al posto di 254 puoi mettere un valore più basso (192 ad esempio). Nel manuale di hdparm ci sono tutti i dettagli.
Che nb hai? Il pacchetto laptop-detect è installato?
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 27 aprile 2012, 9:39
da gia_72
dpkg -l | grep detect
gianfranco@gianfranco:~$ dpkg -l | grep detect
ii laptop-detect 0.13.7ubuntu2
sembra che sia installato. Dovrei fare qualche operazione?
il comando :
sudo hdparm -B 254 /dev/sda
1) va bene anche con alimentazione a batteria? (perchè il problema sussiste solamente a batteria).
2) devo lanciarlo ogni volta ad ogni riavvio o basta solo una volta?
A proposito il notebook è un Hp dv6
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 27 aprile 2012, 15:06
da Man from Mars
il problema è che il risparmio energetico è troppo "aggressivo" quando sei a batteria, ecco perchè devi "correggere" con hdparm i cicli di disattivazione dell'hd.
Il comando ha effetto finchè non riavvii, quindi ogni volta che accendi e sei a batteria dovresti darlo. Con alimentazione da rete il valore dell'impostazione -B è già a 254 (nessun risparmio energetico).
Puoi verificarlo lanciando
(senza niente davanti a -B). Potresti farti un lanciatore o un alias per questo comando da lanciare quando serve.
In alternativa verifica dalle impostazioni del power manager se puoi cambiare la gestione energetica del disco con alimentazione a batteria. Avendo laptop-detect installato il power manager funziona correttamente (ecco perché ti ho chiesto di vedere se c'era).
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: mercoledì 2 maggio 2012, 10:18
da gia_72
Il laptop detec è presente, e ho notato che lanciando il comando
sudo hdparm -B 254 /dev/sda
hd non fa nessun ciclo di att. testina
Come faccio a inserirlo per poter essere eseguito automaticamente ad ogni riavvio? Devo farlo tramite "applicazioni d'avvio?
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: mercoledì 2 maggio 2012, 10:37
da Man from Mars
Puoi mettere il comando in /etc/rc.local prima della riga di "exit 0"
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: mercoledì 2 maggio 2012, 12:26
da shouldes
aggiungi in fondo al file
così a batteria si comporta esattamente come a corrente.
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 4 maggio 2012, 9:49
da gia_72
sudo gedit /etc/hdparm.conf
aggiungi in fondo al file
Codice: Seleziona tutto
/dev/sda {
apm = 254
apm_battery = 254
}
Questo comando lo avevo già utilizzato seguendo la guida del metodo 2 da:
http://wiki.ubuntu-it.org/Hardware/Disp ... 8hdparm%29
ma al riavvio con batteria inserita, la testina faceva sempre i suoi cicli di attivazione e disattivazione. C'è da dire comunque che con questo comando i cicli si erano un pò ridotti, da 4 al minuto a circa la metà.
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 4 maggio 2012, 9:56
da gia_72
Ho risolto inserendo il comando
hdparm -B 254 /dev/sda
nel file /etc/rc.local
alla fine di quello che c'è dentro ma prima di
exit 0
così come indicato da Man from Mars
In questo modo quando il notebook è alimentato a batteria la testina non fa nessun ciclo di attivazione/disattivazione.
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 4 maggio 2012, 13:17
da shouldes
gia_72 ha scritto:Ho risolto inserendo il comando
hdparm -B 254 /dev/sda
nel file /etc/rc.local
alla fine di quello che c'è dentro ma prima di
exit 0
così come indicato da Man from Mars
In questo modo quando il notebook è alimentato a batteria la testina non fa nessun ciclo di attivazione/disattivazione.
C'è il file hdparm.conf che seve a passargli i paramentri, ma fate un po' voi.
Potresti tranquillamente mettere un:
/dev/sda {
apm = 254
apm_battery = 192
}
Se prediligi un pochino di risparmio a batteria senza troppi clack (tutto in teoria e dipende dall'hardware)
o un:
/dev/sda {
apm = 192
apm_battery = 254
}
Se a corrente lo usi per tantissime ore e vorresti temperature un pelo più basse (tutto in teoria e dipende dall'hardware)
Il comando hdparm -B va a settare ogni avvio il parametro apm di hdparm, tanto vale farlo con l'apposito file di configurazione di hdparm.
Io uso il metodo che ti avevo suggerito e funziona (certo che funziona, visto che quel file serve ad impostare hdparm).
Re: Conteggio cicli attivazione/disattivazione hd
Inviato: venerdì 4 maggio 2012, 13:49
da shouldes
gia_72 ha scritto: sudo gedit /etc/hdparm.conf
aggiungi in fondo al file
Codice: Seleziona tutto
/dev/sda {
apm = 254
apm_battery = 254
}
Questo comando lo avevo già utilizzato seguendo la guida del metodo 2 da:
http://wiki.ubuntu-it.org/Hardware/Disp ... 8hdparm%29
ma al riavvio con batteria inserita, la testina faceva sempre i suoi cicli di attivazione e disattivazione. C'è da dire comunque che con questo comando i cicli si erano un pò ridotti, da 4 al minuto a circa la metà.
http://forum.ubuntu-it.org/viewtopic.ph ... 4#p3019435
http://ubuntuforums.org/showthread.php?t=1488096
http://ubuntuforums.org/showthread.php?t=1956333
http://ubuntuforums.org/showthread.php?t=1705406
Altre 1000 discussioni tutte con la stessa soluzione e utenti diversi.
Questo aveva installato laptop-mode (infatti prima di lucid la procedura era diversa, c'era laptop-mode.conf da toccare), glielo hanno fatto disattivare e gli hanno fatto aggiungere quelle righe:
http://ubuntuforums.org/showthread.php?t=1849893
Dare hdparm -B e configurare hdparm.conf è la stessa cosa, se a te non va è un gravissimo bug,
almeno che non hai installato qualcosa che andrebbe quindi disattivata.
Tipo nel primo link, quando mi posi il dubbio delle modifiche da fare ora che mancava laptop-mode, il primo consiglio (errato) fu quello di installarlo.
Sono anni che metto Ubuntu su portatili (e da Lucid in avanti mi è sempre bastato fare quello) , non li tiro dal cilindro i consigli.

Re: Conteggio cicli attivazione/disattivazione hd[R I S O L
Inviato: venerdì 4 maggio 2012, 23:07
da gia_72
Scusami ma non volevo offenderti o minimizzare le tue capacità. Io ho seguito alla lettera quello indicato nel metodo 2 dall'indirizzo posto nel messaggio precedente. Forse avrò sbagliato qualcosa io inquanto ho cancellato tutto il contenuto di hdparm.conf e scritto quello da te indicato.
Mi pacerebbe sapere di più riguardo i comandi da te indicati:
Potresti tranquillamente mettere un:
/dev/sda {
apm = 254
apm_battery = 192
}
Se prediligi un pochino di risparmio a batteria senza troppi clack (tutto in teoria e dipende dall'hardware)
o un:
/dev/sda {
apm = 192
apm_battery = 254
}
Se a corrente lo usi per tantissime ore e vorresti temperature un pelo più basse (tutto in teoria e dipende dall'hardware)
Che differenza c'è tra apm e apm_battery?
impostando tutto a 254 alzo troppo le temperature dell'hd?
Re: Conteggio cicli attivazione/disattivazione hd[R I S O L
Inviato: domenica 6 maggio 2012, 21:57
da shouldes
gia_72 ha scritto:Scusami ma non volevo offenderti o minimizzare le tue capacità. Io ho seguito alla lettera quello indicato nel metodo 2 dall'indirizzo posto nel messaggio precedente. Forse avrò sbagliato qualcosa io inquanto ho cancellato tutto il contenuto di hdparm.conf e scritto quello da te indicato.
Mi pacerebbe sapere di più riguardo i comandi da te indicati:
Potresti tranquillamente mettere un:
/dev/sda {
apm = 254
apm_battery = 192
}
Se prediligi un pochino di risparmio a batteria senza troppi clack (tutto in teoria e dipende dall'hardware)
o un:
/dev/sda {
apm = 192
apm_battery = 254
}
Se a corrente lo usi per tantissime ore e vorresti temperature un pelo più basse (tutto in teoria e dipende dall'hardware)
Che differenza c'è tra apm e apm_battery?
impostando tutto a 254 alzo troppo le temperature dell'hd?
apm equivale al comando sudo hdparm -B a corrente
apm_battery equivale al comando sudo hdparm -B a batteria
254 è il valore predefinito a corrente, su molti portatili inibisce completamente ogni forma di risparmio, mentre il valore a batteria (se non ricordo male 128) predefinito per molti portatili è eccessivo.
Sul cancellare tutto il contenuto, dipende cosa c'era di decommenteto (riga senza # davanti) che non dovevi tigliere.
Così a memoria, di commentato c'è:
/dev/sda {
apm = 255
}
quindi basta decommentare quelle righe e modificare 255 a 254.
Ma io ho sempre aggiunto la riga
apm_battery = valore
prima della graffa, che sicuramente serve solo a poter avere due valori differenti, ma non ho fatto prove, anche se metto entrambi i valori uguali, metto sempre:
/dev/sda {
apm = 254
apm_battery = 254
}
A parte che qualche prova la faccio sempre, ma direttamente con hdparm -B, per evitare di riavviare.
Re: Conteggio cicli attivazione/disattivazione hd[R I S O L
Inviato: lunedì 7 maggio 2012, 9:22
da gia_72
Questo è quello che c'è dentro il mio hdparm.conf
Codice: Seleziona tutto
## 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
# -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
#}
Penso comunque che come default sia dato 254 perchè ricondo bene di aver provato il comando
hdparm -B 255 (a corrente) e l'hd mi faceva diversi cicli al minuto.
Re: Conteggio cicli attivazione/disattivazione hd[R I S O L
Inviato: lunedì 7 maggio 2012, 21:56
da shouldes
gia_72 ha scritto:Questo è quello che c'è dentro il mio hdparm.conf
Codice: Seleziona tutto
## 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
# -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
#}
Penso comunque che come default sia dato 254 perchè ricondo bene di aver provato il comando
hdparm -B 255 (a corrente) e l'hd mi faceva diversi cicli al minuto.
Quel file contiene solo:
Comunque è 254 a corrente, di quello ero e sono sicuro.
Per il 255 a quanto pare il tuo disco non accetta il parametro per quello che è (risparmio disattivato) ma lo considera un parametro che setta un risparmio aggressivo.
I valori andrebbero scelti da disco a disco.
Sull'ultimo portatile che ho provato, 255~192 nessun parcheggio, 191-130 parcheggio continuo e regolare, 129 parcheggio molto moderato e buono (tipo uno ogni 5~10 minuti), 128 parcheggio ogni 1~5 minuti, 127 parcheggio molto moderato e buono (tipo uno ogni 5~10 minuti), 126 in giù parcheggi regolari sempre più frequenti scendendo col parametro, da uno ogni 2 minuti a 1 ogni 2 secondi.
Purtroppo ogni sistema è diverso e da una release all'altra lo stesso sistema si comporta in modo diverso.