|
|
(31 versioni intermedie di 8 utenti non mostrate) |
Riga 1: |
Riga 1: |
| {{stub}} | | {{Versioni compatibili}} |
|
| |
|
| =Introduzione= | | == Introduzione == |
| Hdparm contente la modifica avanzata dei parametri funzionali dei disposibivi ATA/IDE (hard disk, lettori cd/dvd), permettendo un ''fine tuning'' degli hard disk e lettori, ch spesso rappresentano un vero collo di bottiglia per le performance di una macchina. | | '''Hdparm''' consente la modifica avanzata dei parametri funzionali dei disposibivi ATA/IDE (hard disk, lettori cd/dvd), permettendo un ''fine tuning'' degli hard disk e lettori, che spesso rappresentano un vero collo di bottiglia per le performance di una macchina. |
|
| |
|
| =Cosa serve=
| | == Installazione == |
| ==Installazione== | | Il [[pacchetto]] è installato di default in Debian, avendo priorità standard. Se non fosse presente, per installarlo con [[privilegi di amministrazione]] e [[apt]] sarebbe sufficiente eseguire: |
| Il pacchetto � presente in Debian: | |
| <pre> | | <pre> |
| # apt-get install hdparm | | # apt install hdparm |
| </pre> | | </pre> |
|
| |
|
| ==Kernel== | | == Utilizzo da linea di comando == |
| Per poter utilizzare al meglio questo strumento, � consigliato: | | Le impostazioni date da riga di comando hanno effetto immediato ma sono perse a ogni avvio. Per rendere permanenti le modifiche è necessario modificare il file <code>/etc/hdparm.conf</code>, come illustrato nella sezione successiva. |
| * avere una versione del kernel abbastanza recente (quelle presenti in Sarge vanno pi� che bene)
| |
| * avere i moduli per il proprio chipset caricati (o compilati staticamente nel kernel)
| |
|
| |
|
| | Il comando richiede [[privilegi di amministrazione]]. La sintassi standard è: |
| | <pre># hdparm [opzioni] [dispositivo...]</pre> |
|
| |
|
| =Opzioni e Argomenti=
| | Le opzioni disponibili sono tante, alcune delle quali '''critiche''', quindi si sconsiglia vivamente l'utilizzo di opzioni che non si conoscono, per evitare danni e/o malfunzionamenti/perdite di dati. Di seguito sono presentate soltanto le più comuni: |
| Le opzioni disponibili sono tante, alcune delle quali '''critiche''', quindi sconsiglio vivamente l'utilizzo di opzioni che non si conoscono, per evitare danni e/o malfunzionamenti/perdite di dati... (declino ogni responsabilit� su questi). | | ; -B : Modifica le impostazioni della gestione avanzata dell'alimentazione (APM), se supportate. Un valore basso, a partire da 1, implica un comportamento aggressivo per quanto riguarda il risparmio energetico, quindi un consumo minore, un valore alto, invece, fino a un massimo di 255 permette performance migliori. Un valore superiore a ''128'' impedisce lo spegnimento completo del disco, e il valore ''255'' disattiva interamente l'APM. |
| | |
| ; -a : Get/set sector count for filesystem read-ahead. This is used to improve performance in sequential reads of large files, by prefetching additional blocks in anticipation of them being needed by the running task. In the current kernel version (2.0.10) this has a default setting of 8 sectors (4KB). This value seems good for most purposes, but in a system where most file accesses are random seeks, a smaller setting might provide better performance. Also, many IDE drives also have a separate built-in read-ahead function, which alleviates the need for a filesystem read-ahead in many situations.
| |
| ; -A : Disable/enable the IDE drive's read-lookahead feature (usually ON by default). Usage: -A0 (disable) or -A1 (enable).
| |
| ; -b : Restituisce o imposta lo stato del bus [0,1]
| |
| ; -B : Modifica le impostazioni della gestione avanzata dell'alimentazione (APM), se supportate. Un valore basso implica un comportamento aggressivo per quanto riguarda il risparmio energetico, quindi un consumo minore, un valore alto, invece, permette performance migliori. Il valore ''255'' disattiva l'apm. | |
| ; -c : Visualizza lo stato o abilita il supporto per l'I/O a 32 bit per i dispositivi (E)IDE. I seguenti valori numerici possono essere usati per impostare:
| |
| :; 0 : per disabilitare il supporto a 32-bit
| |
| :; 1 : per abilitare il trasferimento dei dati a 32-bit
| |
| :; 3 : per abilitare il trasferimento dei dati a 32-bit con una speciale sequenza di sincronizzazione richiesta da molti chipset. The value 3 works with nearly all 32-bit IDE chipsets, but incurs slightly more overhead. Note that "32-bit" refers to data transfers across a PCI or VLB bus to the interface card only; all (E)IDE drives still have only a 16-bit connection over the ribbon cable from the interface card.
| |
| ; -C : Controlla lo stato corrente dell'alimentazione del dispositivo; le possibili risposte sono: | | ; -C : Controlla lo stato corrente dell'alimentazione del dispositivo; le possibili risposte sono: |
| :; unknown : il dispositivo non supporta la funzione | | :; unknown : il dispositivo non supporta la funzione |
| :; active/idle : stato normale | | :; active/idle : stato normale |
| :; standby : il device � in standby, i piatti dell'hard disk non sono in movimento | | :; standby : il dispositivo è in standby, i piatti dell'hard disk non sono in movimento |
| :; sleeping : il device � completamente spento. | | :; sleeping : il dispositivo è completamente spento |
| : � possibile modificare le modalit� tramite le opzioni '''-S''', '''-y''', '''-Y''', '''-Z'''. | | : È possibile modificare le modalità tramite le opzioni '''-S''', '''-y''', '''-Y''', '''-Z'''. |
| ; -d : Disable/enable the "using_dma" flag for this drive. This option now works with most combinations of drives and PCI interfaces which support DMA and which are known to the kernel IDE driver. It is also a good idea to use the appropriate -X option in combination with -d1 to ensure that the drive itself is programmed for the correct DMA mode, although most BIOSs should do this for you at boot time. Using DMA nearly always gives the best performance, with fast I/O throughput and low CPU usage. But there are at least a few configurations of chipsets and drives for which DMA does not make much of a difference, or may even slow things down (on really messed up hardware!). Your mileage may vary.
| | ; -E : Imposta la velocità del cdrom. Questo NON è necessario normalmente, dato che il drive selezionerà automaticamente la velocità. Ma se vuoi provarci, fornisci un numero dopo l'opzione, di solito un numero come 2 o 4. |
| ; -D : Enable/disable the on-drive defect management feature, whereby the drive firmware tries to automatically manage defective sectors by relocating them to "spare" sectors reserved by the factory for such.
| |
| ; -E : Imposta la velocit� del cdrom. Questo NON � necessario normalmente, dato che il drive selezioner� automaticamente la velocit�. Ma se vuoi provarci, fornisci un numero dopo l'opzione, di solito un numero come 2 o 4. | |
| ; -f : Sincronizza ed esegue un flush del buffer del dispositibo. Viene eseguito anche dutante i test '''-T''' e '''-t''' | | ; -f : Sincronizza ed esegue un flush del buffer del dispositibo. Viene eseguito anche dutante i test '''-T''' e '''-t''' |
| ; -g : Mostra la geometria del drive (cilindri, testine, settori), la dimensione (in settori) del device, e l'offset di partenza (in settori) del device dall'inizio del drive. | | ; -g : Mostra la geometria del drive (cilindri, testine, settori), la dimensione (in settori) del device, e l'offset di partenza (in settori) del device dall'inizio del drive. |
| ;-i : Display the identification info that was obtained from the drive at boot time, if available. This is a feature of modern IDE drives, and may not be supported by older devices. The data returned may or may not be current, depending on activity since booting the system. However, the current multiple sector mode count is always shown. For a more detailed interpretation of the identification info, refer to AT Attachment Interface for Disk Drives (ANSI ASC X3T9.2 working draft, revision 4a, April 19/93).
| | ; -I : Richiede informazioni di identificazione direttamente dal drive, e le mostrerà in un nuovo formato espanso con più dettagli rispetto alla vecchia opzione -i. |
| ; -I : Richiede informazioni di identificazione direttamente dal drive, e le mostrer� in un nuovo formato espanso con pi� dettagli rispetto alla vecchia opzione -i. | | ; -r : Imposta/leggi modalità sola-lettura sul drive. Quando impostata, Linux impedisce operazioni di scrittura sul device. |
| ; -Istdin : This is a special "no seatbelts" variation on the -I option, which accepts a drive identification block as standard input instead of using a /dev/hd* parameter. The format of this block must be exactly the same as that found in the /proc/ide/*/hd*/identify "files", or that produced by the '''-Istdout''' option described below. This variation is designed for use with collected "libraries" of drive identification information, and can also be used on ATAPI drives which may give media errors with the standard mechanism. | | ; -S : modalità di ''standby'', imposta il timeout per l'arresto del disco (spindown). Questo valore viene usato per determinare quanto aspettare (in caso di assenza di attività) prima di arrestare la rotazione dei dischi. In alcuni casi, il disco può impiegare anche 30 secondi prima di rispondere ad una richiesta di lettura, quando i piatti sono fermi. I valori usabili sono i seguenti: |
| ; -Istdout : This option simply dumps the identify data in hex to stdout, in a format similar to that from /proc/, and suitable for later use with the -Istdin option.
| | :; 0 : disattivato: il dispositivo non entrerà automaticamente in standby |
| ; -k : Get/set the keep_settings_over_reset flag for the drive. When this flag is set, the driver will preserve the -dmu options over a soft reset, (as done during the error recovery sequence). This flag defaults to off, to prevent drive reset loops which could be caused by combinations of '''-dmu''' settings. The '''-k''' flag should therefore only be set after one has achieved confidence in correct system operation with a chosen set of configuration settings. In practice, all that is typically necessary to test a configuration (prior to using -k) is to verify that the drive can be read/written, and that no error logs (kernel messages) are generated in the process (look in /var/adm/messages on most systems). | | :; 1-240 : specifica i multipli di 5 secondi, gestendo un timeout variabile tra i 5 secondi e i 20 minuti |
| ; -K : Set the drive's keep_features_over_reset flag. Setting this enables the drive to retain the settings for -APSWXZ over a soft reset (as done during the error recovery sequence). Not all drives support this feature.
| | :; 241-251 : specifica le unità di da 30 minuti fino a 5 or e mezza (ad intervalli di 30 minuti) |
| ; -L : Set the drive's doorlock flag. Setting this to 1 will lock the door mechanism of some removable hard drives (eg. Syquest, ZIP, Jazz..), and setting it to 0 will unlock the door mechanism. Normally, Linux maintains the door locking mechanism automatically, depending on drive usage (locked whenever a filesystem is mounted). But on system shutdown, this can be a nuisance if the root partition is on a removeable disk, since the root partition is left mounted (read-only) after shutdown. So, by using this command to unlock the door after the root filesystem is remounted read-only, one can then remove the cartridge from the drive after shutdown.
| | :; 252 : 21 minutes |
| ; -m : Get/set sector count for multiple sector I/O on the drive. A setting of 0 disables this feature. Multiple sector mode (aka IDE Block Mode), is a feature of most modern IDE hard drives, permitting the transfer of multiple sectors per I/O interrupt, rather than the usual one sector per interrupt. When this feature is enabled, it typically reduces operating system overhead for disk I/O by 30-50%. On many systems, it also provides increased data throughput of anywhere from 5% to 50%. Some drives, however (most notably the WD Caviar series), seem to run slower with multiple mode enabled. Your mileage may vary. Most drives support the minimum settings of 2, 4, 8, or 16 (sectors). Larger settings may also be possible, depending on the drive. A setting of 16 or 32 seems optimal on many systems. Western Digital recommends lower settings of 4 to 8 on many of their drives, due tiny (32kB) drive buffers and non-optimized buffering algorithms. The -i flag can be used to find the maximum setting supported by an installed drive (look for MaxMultSect in the output). Some drives claim to support multiple mode, but lose data at some settings. Under rare circumstances, such failures can result in massive filesystem corruption.
| | :; 253 : imposta un timeout preimpostato dal produttore, variabile tra le 8 e le 12 ore |
| ; -M : Get/set Automatic Acoustic Management (AAM) setting. Most modern harddisk drives have the ability to speed down the head movements to reduce their noise output. The possible values are between 0 and 254. 128 is the most quiet (and therefore slowest) setting and 254 the fastest (and loudest). Some drives have only two levels (quiet / fast), while others may have different levels between 128 and 254. THIS FEATURE IS EXPERIMENTAL AND NOT WELL TESTED. USE AT YOUR OWN RISK. | | :; 254 : valore riservato |
| ; -n : Restituisce o imposta il flag ''ignore write errors'' per i driver del chipset IDE. Non usarlo senza aver controllato molto bene il codice sorgente del driver dei chipset IDE.
| | :; 255 : 21 minuti e 15 secondi |
| ; -p : Attempt to reprogram the IDE interface chipset for the specified PIO mode, or attempt to auto-tune for the "best" PIO mode supported by the drive. This feature is supported in the kernel for only a few "known" chipsets, and even then the support is iffy at best. Some IDE chipsets are unable to alter the PIO mode for a single drive, in which case this flag may cause the PIO mode for both drives to be set. Many IDE chipsets support either fewer or more than the standard six (0 to 5) PIO modes, so the exact speed setting that is actually implemented will vary by chipset/driver sophis tication. Use with extreme caution! This feature includes zero protection for the unwary, and an unsuccessful outcome may result in severe filesystem corruption!
| | : alcuni vecchi dispositivi possono interpretare diversamente questi valori. |
| ; -P : Set the maximum sector count for the drive's internal prefetch mechanism. Not all drives support this feature.
| | ; -T : Effettua misurazioni dei tempi impiegati per la lettura dalla cache, a scopo di benchmark e confronti. Per risultati significativi, questa operazione dovrebbe essere ripetuta 2-3 volte su un sistema altrimenti inattivo (nessun altro processo attivo) con almeno un paio di MB di memoria libera. Ciò visualizza la velocità di lettura direttamente dalla cache del buffer di Linux senza accesso al disco. Questa misura è essenzialmente un'indicazione della capacità di processore, cache e memoria del sistema sotto test. Se anche l'opzione -t è specificata, allora un fattore di correzione basato sul risultato di -T sarà incorporato nei risultati riportati per l'operazione con -t. |
| ; -q : Handle the next flag quietly, suppressing normal output. This is useful for reducing screen clutter when running from system startup scripts. Not applicable to the -i or -v or -t or -T flags. | | ; -t : Effettua misurazioni dei tempi impiegati per la lettura dal dispositivo, a scopo di benchmark e confronti. Per risultati significativi, questa operazione dovrebbe essere ripetuta 2-3 volte su un sistema altrimenti inattivo (nessun altro processo attivo) con almeno un paio di MB di memoria libera. Ciò visualizza la velocità di lettura attraverso la cache del buffer dal disco senza nessuna precedente memorizzazione nella cache dei dati. Questa misura è un'indicazione della velocità con cui il disco può sostenere letture sequenziali di data con Linux, senza il sovraccarico del file system. Per assicurare misure accurate, la cache del buffer è scartata durante l'esecuzione di -t usando il segnale ioctl BLKFLSBUF. Se anche l'opzione -T è specificata, allora un fattore di correzione basato sul risultato di -T sarà incorporato nei risultati riportati per l'operazione con -t. |
| ; -Q : Set tagged queue depth (1 or greater), or turn tagged queuing off (0). This only works with the newer 2.5.xx (or later) kernels, and only with the few drives that currently support it. | | ; -y : Forza un dispositivo IDE ad entrare nello stato di basso consumo (Low power consumption standby mode), normalmente causando la fermata dei piatti. Lo stato corrente può essere verificato tramite l'opzione '''-C'''; |
| ; -r : Imposta/leggi modalit� sola-lettura sul drive. Quando impostata, Linux impedisce operazioni di scrittura sul device. | | ; -Y : Forza un dispositivo IDE ad entrare immediatamente nel più basso livello di consumo energetico, causandone lo spegnimento completo (''sleep mode''). È necessario un hard o soft reset prima che il dispositivo sia nuovamente accessibile (i driver IDE di linux eseguiranno il reset automaticamente, se necessariod). Lo stato corrente può essere controllato con l'opzione '''-C'''. |
| ; -R : Register an IDE interface. Dangerous. See the -U option for more information.
| | ; -z : Forza la rilettura della tabella delle partizioni, utile nel caso di modifiche con ''fdisk'' o simili, senza rendere necessario un riavvio della macchina. È necessario assicurarsi che tutte le partizioni del dispositivo siano smontate. |
| ; -S : Set the standby (spindown) timeout for the drive. This value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpretations of these values. | | |
| ; -T : Perform timings of cache reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least a couple of megabytes of free memory. This displays the speed of reading directly from the Linux buffer cache without disk access. This measurement is essentially an indication of the throughput of the processor, cache, and memory of the system under test. If the -t flag is also specified, then a correction factor based on the outcome of -T will be incorporated into the result reported for the -t operation. | | === Esempi di utilizzo === |
| ; -t : Perform timings of device reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least a couple of megabytes of free memory. This displays the speed of reading through the buffer cache to the disk without any prior caching of data. This measurement is an indication of how fast the drive can sustain sequential data reads under Linux, without any filesystem overhead. To ensure accurate measurements, the buffer cache is flushed during the processing of -t using the BLKFLSBUF ioctl. If the -T flag is also specified, then a correction factor based on the outcome of -T will be incorporated into the result reported for the -t operation. | | In questi esempi si utilizza sempre ''sdb'' come disco, corrispondente tipicamente alla seconda memoria di massa inserita, ma è raccomdandabile prima controllarne il nome con: |
| ; -u : Get/set interrupt-unmask flag for the drive. A setting of 1 permits the driver to unmask other interrupts during processing of a disk interrupt, which greatly improves Linux's responsiveness and eliminates "serial port overrun" errors. Use this feature with caution: some drive/controller combinations do not tolerate the increased I/O latencies possible when this feature is enabled, resulting in massive filesystem corruption. In particular, CMD-640B and RZ1000 (E)IDE interfaces can be unreliable (due to a hardware flaw) when this option is used with kernel versions earlier than 2.0.13. Disabling the IDE prefetch feature of these interfaces (usually a BIOS/CMOS setting) provides a safe fix for the problem for use with earlier kernels. | | <pre>$ lsblk</pre> |
| ; -U : Un-register an IDE interface. Dangerous. The companion for the -R option. Intended for use with hardware made specifically for hot-swapping (very rare!). Use with knowledge and extreme caution as this can easily hang or damage your system. The hdparm source distribution includes a 'contrib' directory with some user-donated scripts for hot-swapping on the UltraBay of a ThinkPad 600E. Use at your own risk.
| | (si ricorda che ''sda1'', ''sda2'', ..., ''sdb1'', ''sdb2'', ... si riferiscono alle partizioni dei dischi ''sda'', ''sdb'', ...; e che <code>hdparm</code> si utilizza sui dischi e non sulle partizioni) |
| ; -v : Display all settings, except -i (same as -acdgkmnru for IDE, -gr for SCSI or -adgr for XT). This is also the default behaviour when no flags are specified. | | |
| ; -w : Perform a device reset (DANGEROUS). Do NOT use this option. It exists for unlikely situations where a reboot might otherwise be required to get a confused drive back into a useable state.
| | Controlla lo stato del dispositivo: |
| ; -W : Disable/enable the IDE drive's write-caching feature (default state is undeterminable; manufacturer/model specific).
| | <pre># hdparm -C /dev/sdb</pre> |
| ; -X : Set the IDE transfer mode for newer (E)IDE/ATA drives. This is typically used in combination with -d1 when enabling DMA to/from a drive on a sup ported interface chipset, where -X mdma2 is used to select multiword DMA mode2 transfers and -X sdma1 is used to select simple mode 1 DMA transfers. With systems which support UltraDMA burst timings, -X udma2 is used to select UltraDMA mode2 transfers (you'll need to prepare the chipset for UltraDMA beforehand). Apart from that, use of this flag is seldom necessary since most/all modern IDE drives default to their fastest PIO transfer mode at power-on. Fiddling with this can be both needless and risky. On drives which support alternate transfer modes, -X can be used to switch the mode of the drive only. Prior to changing the transfer mode, the IDE interface should be jumpered or programmed (see -p flag) for the new mode setting to prevent loss and/or corruption of data. Use this with extreme caution! For the PIO (Programmed Input/Output) transfer modes used by Linux, this value is simply the desired PIO mode number plus 8. Thus, a value of 09 sets PIO mode1, 10 enables PIO mode2, and 11 selects PIO mode3. Setting 00 restores the drive's "default" PIO mode, and 01 disables IORDY. For multiword DMA, the value used is the desired DMA mode number plus 32. for UltraDMA, the value is the desired UltraDMA mode number plus 64. | | |
| :* Modalit� PIO
| | Mette il disco a riposo (modalità ''standby''): |
| :** '''0''' -X08 3.3MB/sec
| | <pre># hdparm -y /dev/sdb</pre> |
| :** '''1''' -X09 5.2MB/sec
| | |
| :** '''2''' -X10 8.3MB/sec NEC PC-98*1
| | Forza lo spegnimento completo del disco (modalità ''sleeping''), se supportato: |
| :** '''3''' -X11 11.1MB/sec
| | <pre># hdparm -Y /dev/sdb</pre> |
| :** '''4''' -X12 16.7MB/sec
| | |
| :* Modalit� Singleword DMA | | Forza la rilettura delle partizioni del disco: |
| :** '''0''' 2.1MB/sec
| | <pre># hdparm -z /dev/sdb</pre> |
| :** '''1''' 4.2MB/sec
| | |
| :** '''2''' 8.3MB/sec | | == File di configurazione == |
| :* Modalit� Multiword DMA
| | Per rendere permanenti le modifiche apportate ai dispositivi è necessario inserire le varie direttive nel file <code>/etc/hdparm.conf</code>. La sintassi generale è: |
| :** '''0''' -X32 4.2MB/sec
| | <pre> |
| :** '''1''' -X33 13.3MB/sec
| | /dev/vostro_dispositivo { |
| :** '''2''' -X34 16.6MB/sec
| | direttiva1 = valore |
| :* Modalit� Ultra DMA | | direttiva2 = valore |
| :** '''0''' 16MB/sec | | ecc. |
| :** '''1''' 25MB/sec | | } |
| :** '''2''' -X66 33MB/sec UDMA33 | | </pre> |
| :** '''3''' 50MB/sec
| | Si noti che è teoricamente possibile utilizzare la stessa sintassi della riga di comando anche all'interno di questo file di configurazione (si vedano le note inserite nel file stesso), ma non è quella consigliata. |
| :** '''4''' -X68 66MB/sec UDMA66 | | |
| :** '''5''' -x69 100MB/sec UDMA100
| | Come per i comandi, alcune direttive '''possono essere pericolose'''. Di seguito pertanto sono presentate solo quelle più comuni: |
| ; -y : Forza un device IDE ad entrare nello stato di basso consumo (Low power consumption standby mode), normalmente causando la fermata dei piatti. Lo stato corrente pu� essere verificato tramite l'opzione '''-C''';
| | ; apm : corrisponde all'opzione <code>-B</code> e imposta il valore della gestione avanzata dell'alimentazione (APM), che è compreso tra 0 (attivo) e 255 (disattivo). Più il valore è elevato, maggiori le prestazioni e minore il risparmio energetico consentito. |
| ; -Y : Force an IDE drive to immediately enter the lowest power consumption sleep mode, causing it to shut down completely. A hard or soft reset is required before the drive can be accessed again (the Linux IDE driver will automatically handle issuing a reset if/when needed). The current power mode status can be checked using the -C flag.
| | ; apm_battery : corrisponde all'opzione <code>-B</code>, ma ha effetto soltanto per un portatile quando il cavo di alimentazione non è attaccato e funziona solo a batteria, per permettere due diverse configurazioni; |
| ; -z : Forza la rilettura della tabella delle partizioni, utile nel caso di modifiche con ''fdisk'' o simili, senza rendere necessario un riavvio della macchina.
| | ; read_only : corrisponde all'opzione <code>-r</code> con possibili valori di ''true'' o ''false'', per impostare il disco fisso di sola lettura; |
| | ; spindown_time : per determinare dopo quanto tempo il disco può essere spento completamente. Corrisponde all'opzione <code>-S</code> e richiede un valore compreso tra 0 e 255, si faccia riferimento alle informazioni già presentate per il significato di questi valori. |
| | |
| | === Esempio di configurazione === |
| | Per far sì che il disco ''sdb'' si metta in standby dopo 15 minuti di inattività, è sufficiente il comando: |
| | <pre> |
| | # hdparm -S 180 /dev/sdb |
| | </pre> |
| | Infatti fino a 20 minuti si può rappresentare il tempo con con un intervallo per multipli di 5 secondi (e 15 minuti sono 900 secondi, che diviso 5 restituisce 180). |
| | |
| | {{Cautionbox | Si ricorda che in un file di configurazione è consigliabile identificare il disco in base all'ID anziché l'assegnazione effettuata da [[udev]] (''sda'', ''sdb'', ecc...), che potrebbe cambiare da un avvio al successivo in presenza di più dischi.}} |
| | Si identifica l'ID del disco attualmente identificato dal file di tipo dispositivo <code>/dev/sdb</code>, per esempio tramite il comando <code>udisksctl</code>: |
| | <pre> |
| | $ udisksctl info -b /dev/sdb |
| | ... |
| | Device: /dev/sdb |
| | ... |
| | Symlinks: /dev/disk/by-id/ata-HGST_HTS545050A7E380_TEA51C49CAS5TR |
| | ... |
| | </pre> |
| | |
| | Per cui, per rendere permanente la modifica, va inserito nel file di configurazione la direttiva <code>spindown_time = 180</code> tra le direttive riservate al dispositivo desiderato, identificato con il link simbolico utilizzante l'ID del disco: |
| | <pre> |
| | /dev/disk/by-id/ata-HGST_HTS545050A7E380_TEA51C49CAS5TR { |
| | spindown_time = 180 |
| | } |
| | </pre> |
| | |
| | == Documentazione == |
| | * Manuale con tutte le opzioni del comando: <br/><code>$ man hdparm</code> |
| | |
| | * Manuale con le principali opzioni del file di configurazione: <br/><code>$ man hdparm.conf</code> |
|
| |
|
| =Test delle Performance=
| | * Commenti nel file di configurazione, per una lista esaustiva: <br/><code>$ pager /etc/hdparm.conf</code> |
|
| |
|
| =Alcuni esempi di Tuning= | | {{Autori |
| | |Autore = [[Utente:HAL 9000|HAL 9000]] <br /> (guida originariamente scritta da [[Utente:MaXeR|MaXeR]]) |
| | |Estesa_da = |
| | |Verificata_da = |
| | :[[Utente:Spoon|Spoon]] 23:57, 30 giu 2017 (CEST) |
| | :[[Utente:HAL 9000|HAL 9000]] 16:25, 14 lug 2019 (CEST) |
| | |Numero_revisori = 1 |
| | }} |
|
| |
|
| =Conclusioni=
| | [[Categoria:Shell]][[Categoria:Hard Disk]] |