国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
hdparm 優(yōu)化硬盤的配置
hdparm 優(yōu)化硬盤的配置

Reference: 2

1,Linux通用系統(tǒng)優(yōu)化... 2

2,中文手冊(cè): 3

3,英文手冊(cè): 7

4, Speeding up Linux Using hdparm.. 15

 

 

    需要配置的原因是硬盤不斷更新?lián)Q代,linux系統(tǒng)為了兼容和穩(wěn)定,默認(rèn)沒(méi)有采用較新的硬盤技術(shù).

俺們的流媒體服務(wù)器配置:
/sbin/hdparm -c3 -u1 -d1 -m0 /dev/hda
/sbin/hdparm -c3 -u1 -d1 -m0 /dev/sda
/sbin/hdparm -c3 -u1 -d1 -m0 /dev/sdb
/sbin/hdparm -c3 -u1 -d1 -m0 /dev/hdc

分別為采用32位模式,響應(yīng)其他中斷,打開DMA模式,最后一個(gè)是扇區(qū),估計(jì)是因?yàn)椴捎昧俗约旱奈募到y(tǒng),內(nèi)部有優(yōu)化,所以關(guān)閉這個(gè)特性

-X因?yàn)榇蠖鄶?shù)/全部現(xiàn)代 IDE 驅(qū)動(dòng)器默認(rèn)它們最快的 PIO 傳輸模式為打開. 所以擺弄它是沒(méi)有必要的也是冒險(xiǎn)的.

 

 

比較有用的參數(shù)如下:

Hdparm命令的一些常用的其他參數(shù)功能

 

-g 顯示硬盤的磁軌,磁頭,磁區(qū)等參數(shù)。

-i 顯示硬盤的硬件規(guī)格信息,這些信息是在開機(jī)時(shí)由硬盤本身所提供。

-I 直接讀取硬盤所提供的硬件規(guī)格信息。

-p 設(shè)定硬盤的PIO模式。

-Tt 評(píng)估硬盤的讀取效率和硬盤快取的讀取效率。

-u <01> 在硬盤存取時(shí),允許其他中斷要求同時(shí)執(zhí)行。

-v 顯示硬盤的相關(guān)設(shè)定。

 

尤其是

[root@ME_90_146 rss]# hdparm  -Tt /dev/hda

 

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.20 seconds =624.39 MB/sec

 Timing buffered disk reads:  64 MB in  1.39 seconds = 45.94 MB/sec

[root@ME_90_146 rss]#

 

[root@ME_90_146 rss]# hdparm /dev/hda

 

/dev/hda:

 multcount    =  0 (off)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 30401/255/63, sectors = 488397168, start = 0

 

 



Reference:


1,Linux通用系統(tǒng)優(yōu)化
http://blog.chinaunix.net/u/19412/showart_185301.html

使用hdparm改善Linux系統(tǒng)性能

 

如果你的Linux系統(tǒng)運(yùn)行于IDE硬盤,可以使用hdparm工具來(lái)提高磁盤I/O的性能。不過(guò)使用hdparm要小心,因?yàn)榭赡芷茐挠脖P上的數(shù)據(jù)。所以在使用hdparm之前,仔細(xì)閱讀你的硬盤手冊(cè)。根據(jù)你具體的硬盤規(guī)格來(lái)使用相應(yīng)的hdparm開關(guān)參數(shù)。對(duì)一塊UltraATA/66

EIDE 硬盤,其控制芯片支持多 PIO 模式和DMA,我們使用以下命令來(lái)調(diào)諧磁盤性能:

 

# /sbin/hdparm -x66 -d1 -u1 -m16 -c3 /dev/hda

 

選項(xiàng)說(shuō)明:

c3 :就是把硬盤的16位格式轉(zhuǎn)換為32位模式(32-bit mode w/sync)??刂茢?shù)據(jù)如何從pci總線傳遞到控制器。

m16 :改變硬盤的多路扇區(qū)的讀功能,-m16可以使得硬盤在一次i/o中斷中讀入16個(gè)扇區(qū)的數(shù)據(jù)(據(jù)具體硬盤而定)。

d1:打開DMA模式。

x66 :在支持UDMA-capable的硬盤中,這個(gè)參數(shù)可以支持雙DMA通道的數(shù)據(jù)傳輸模式。

u1 Linux在處理磁盤中斷時(shí),可以unmask其他的中斷或者響應(yīng)其他中斷相關(guān)的任務(wù)。

查看以上的更改情況可以使用命令:

# /sbin/hdparm /dev/hda

測(cè)試磁盤I/O性能可以使用命令:

# /sbin/hdparm -tT /dev/hda

如果磁盤的性能有改進(jìn)的話,可以使用以下命令來(lái)保存設(shè)置:

# /sbin/hdparm -k1 /dev/had

 

2,中文手冊(cè):

hdparm 文檔

http://www.linuxsir.org/bbs/printthread.php?t=210179
 

hdparm - 獲取/設(shè)置硬盤參數(shù)
總覽
hdparm [ -a [
扇區(qū)數(shù)] ] [ -A [0|1] ] [ -c [芯片組模式] ] [ -C ] [ -d [0|1] ] [ -f ] [ -g ] [ -i ] [ -k [0|1] ] [ -K [0|1] ] [ -L [0|1] ] [ -m [扇區(qū)數(shù)] ] [ -p [0|1|2|3|4|5] ] [ -P [扇區(qū)數(shù)] ] [ -q ] [ -r [0|1] ] [ -S [超時(shí)] ] [ -T ] [ -t ] [ -u [0|1] ] [ -v ] [ -W [0|1] ] [ -X [傳輸模式] ] [ -y ] [ -Y ] [ -Z ] [設(shè)備] ..
描述
hdparm
提供一個(gè)實(shí)現(xiàn)各種硬盤控制動(dòng)作的命令行接口,它由內(nèi)建 Linux IDE/ST-506設(shè)備驅(qū)動(dòng)程序支持.要實(shí)現(xiàn)這種功能需要Linux 核心版本為1.2.13或更高.在早期的核心下有一些選項(xiàng)可能不能正 常工作.另外,一些選項(xiàng)只是為包含了新的IDE設(shè)備驅(qū)動(dòng)程序的核心 所支持,2.0.10版或者更高版本的核心.如果hdparm程序是在使用 舊的核心文件(在目錄usr/include/linux)的機(jī)器上被編譯的,這 些選項(xiàng)將無(wú)法獲得.
選項(xiàng)
當(dāng)未給出標(biāo)記時(shí), -acdgkmnru 被作為假設(shè)值 (除非一個(gè)給定的設(shè)備是SCSI設(shè)備或某種老式 XTMFM/RLL,在這種情況下 -gr -adgr 分別是默認(rèn)值).
-a
為文件系統(tǒng)提前獲得/設(shè)置扇區(qū)號(hào),可以用來(lái)改善連續(xù)讀取大文件時(shí)的系統(tǒng)性能,具體方式為提前讀取額外的預(yù)期中正在運(yùn)行的任務(wù)所需要的 數(shù)據(jù)塊.在當(dāng)前核心版本(2.0.10)中默認(rèn)設(shè)置為8個(gè)扇區(qū)(4KB).對(duì)于 大多數(shù)用途,這個(gè)值看起來(lái)不錯(cuò),但在一個(gè)大多數(shù)文件訪問(wèn)行為是隨機(jī) 搜索的系統(tǒng)中,設(shè)置一個(gè)小一些的值可能效果會(huì)更好.當(dāng)然,很多 IDE驅(qū)動(dòng)器也有一個(gè)獨(dú)立的內(nèi)建的預(yù)讀功能,這在很多情況下可以緩解 對(duì)文件系統(tǒng)預(yù)讀功能的需求.
-A
關(guān)閉/打開IDE驅(qū)動(dòng)器預(yù)讀功能(通常默認(rèn)為打開).
-c
查詢/打開(E)IDE 32-bit I/O 支持.一個(gè)數(shù)字的參數(shù)可以被用來(lái) 打開/關(guān)閉32-bit I/O 支持.當(dāng)前支持的值包括 0 關(guān)閉 32-bit I/O 支持, 1 打開 32-bit 數(shù)據(jù)傳輸, 3 以一個(gè)芯片組要求的特殊的 sync 流程打開 32-bit data 傳輸. 3 幾乎對(duì)所有的32-bit IDE 芯片組起作用,但導(dǎo)致稍微多一些的系統(tǒng)開銷. 注意,32-bit數(shù)據(jù)傳輸僅僅用于通過(guò)PCIVLB總線與接口卡的連接; 所有的IDE驅(qū)動(dòng)器通過(guò)排線從接口卡獲得的連接僅為16-bit.
-C
檢查當(dāng)前IDE能耗模式狀態(tài), 結(jié)果將是下面幾種之一未知 (驅(qū)動(dòng)器不支持此命令), 活動(dòng)/閑置 (普通操作), 待機(jī) (低能耗模式,驅(qū)動(dòng)器待機(jī)), or 睡眠 (最低能耗模式, 驅(qū)動(dòng)器被完全關(guān)閉). 選項(xiàng) -S, -y, -Y, and -Z 用來(lái)操縱能耗模式.
-d
為驅(qū)動(dòng)器關(guān)閉/打開 "using_dma" 標(biāo)志. 此選項(xiàng)僅對(duì)一些支持 DMA并且對(duì)于IDE驅(qū)動(dòng)程序來(lái)說(shuō)是已知的驅(qū)動(dòng)器-接口組合 (包括所有被支持的XT接口).特別的,Intel Triton 芯片組 能和很多驅(qū)動(dòng)器一起實(shí)現(xiàn)總線控制 DMA 操作.(根據(jù)實(shí)驗(yàn)).使用 -X34 選項(xiàng)與 -d1 選項(xiàng)組合確保驅(qū)動(dòng)器自身是為多字DMA模式2設(shè)計(jì)的. 使用DMA不一定對(duì)吞吐量或系統(tǒng)性能有改進(jìn),但很多人信賴它.
-E
設(shè)置光盤驅(qū)動(dòng)器速度.對(duì)于一般性操作這不是必須的,因?yàn)轵?qū)動(dòng)器將自動(dòng)地自行選擇自己的速度.如果你想要使用它,就在選項(xiàng)后提供一個(gè)數(shù)字,通常是24.
-f
當(dāng)設(shè)備退出時(shí)同步并刷新指針高速緩存.此操作也作為選項(xiàng) -t -T 定時(shí)的一部分被執(zhí)行
-g
顯示驅(qū)動(dòng)器物理位置(柱面,磁頭,扇區(qū)),設(shè)備的大小(以扇區(qū)為單位), 以及相對(duì)于驅(qū)動(dòng)器起始的設(shè)備偏移量(以扇區(qū)為單位).
-h
顯示簡(jiǎn)要使用信息(幫助).
-i
顯示引導(dǎo)驅(qū)動(dòng)器時(shí)獲得的識(shí)別信息,如果有的話. 這是一種現(xiàn)代IDE驅(qū)動(dòng)器特性,可能不被較老式的設(shè)備支持. 返回的數(shù)據(jù)可能是或不是當(dāng)前的,這取決于自系統(tǒng)引導(dǎo)后的行為. 然而,當(dāng)前的復(fù)合模式的扇區(qū)計(jì)數(shù)始終被給出. 要獲得更多的關(guān)于識(shí)別信息的詳細(xì)闡釋,請(qǐng)查閱 AT Attachment Interface for Disk Drives (ANSI ASC X3T9.2 working draft, revision 4a, April 19/93).
-I
直接從驅(qū)動(dòng)器獲取識(shí)別信息, 并以原始的,未經(jīng)過(guò)修改和更正的形式顯示. 否則便與選項(xiàng) -i 相同.
-k
獲得/設(shè)置驅(qū)動(dòng)器 keep_settings_over_reset 標(biāo)志. 當(dāng)此標(biāo)志被設(shè)置,驅(qū)動(dòng)程序?qū)⒃谝粋€(gè)軟性的重置后保護(hù)選項(xiàng) -dmu (如同在出錯(cuò)恢復(fù)流程中完成的那樣) 此標(biāo)志默認(rèn)值為關(guān) , 以防止可能由與 -dmu 組合設(shè)置導(dǎo)致的驅(qū)動(dòng)器重置循環(huán). 選項(xiàng) -k 應(yīng)該僅在你確信用一組選定的設(shè)置進(jìn)行正確的系統(tǒng)操作之后被設(shè)置. 實(shí)際中,校驗(yàn)驅(qū)動(dòng)器能夠讀/些并且在此過(guò)程中沒(méi)有出錯(cuò)記錄(核心消息, 大多數(shù)系統(tǒng)上/var/adm/messages),是測(cè)試一個(gè)配置(在用-k之前)必須的.
-K
設(shè)置驅(qū)動(dòng)器的 keep_features_over_reset 標(biāo)志. 此項(xiàng)設(shè)置使驅(qū)動(dòng)器在軟性重置后保留 -APSWXZ 標(biāo)志的設(shè)置 (如同在出錯(cuò)恢復(fù)流程中完成的那樣). 并非所有的驅(qū)動(dòng)器都支持此項(xiàng)特性.
-L
設(shè)置驅(qū)動(dòng)器的doorlock標(biāo)志. 設(shè)置為 將鎖住一些移動(dòng)式硬驅(qū)動(dòng)器( Syquest,ZIP,Jazz..)的 門鎖機(jī)構(gòu).設(shè)置為 一般Linux根據(jù)驅(qū)動(dòng)器用法自動(dòng)維護(hù)門鎖機(jī)構(gòu).(當(dāng)安裝一個(gè)文件 系統(tǒng)時(shí)鎖住).但在系統(tǒng)關(guān)閉時(shí),如果根分區(qū)在一個(gè)移動(dòng)式磁盤上, 可能會(huì)有麻煩,因?yàn)樵陉P(guān)閉后根分區(qū)仍在處在安裝狀態(tài)(只讀). 所以,使用這個(gè)命令在根文件系統(tǒng)以只讀的方式重新被安裝 ,用戶可以在關(guān)閉后從驅(qū)動(dòng)器中移走磁盤.
-m
獲得/設(shè)置驅(qū)動(dòng)器多重扇區(qū)I/O的扇區(qū)數(shù).設(shè)置為 0 關(guān)閉這項(xiàng)特性.多重扇區(qū)模式(aka IDE Block 模式),是大多數(shù) 現(xiàn)代硬盤驅(qū)動(dòng)器的一項(xiàng)特性,它允許每次I/O中斷傳輸多個(gè)扇區(qū), 而不是通常的一次中斷一個(gè).當(dāng)這項(xiàng)特性被打開時(shí),操作系統(tǒng) 處理磁盤I/O的開銷降低30-50%.在許多系統(tǒng)上,它也會(huì)在任何 地方增加5% - 50% 的數(shù)據(jù)流量大多數(shù)驅(qū)動(dòng)器支持最小的設(shè)置 為2,4,8,16個(gè)(扇區(qū)).較大的設(shè)置也可能存在,這取決于驅(qū) 動(dòng)器.在許多系統(tǒng)上設(shè)置為1632看起來(lái)是最理想的. Western Digital在他們的許多驅(qū)動(dòng)器上推薦設(shè)置為48. 歸因于微小的(32kB)磁盤緩沖和非最優(yōu)化的緩沖算法. 選項(xiàng) -i 被用來(lái)查出一個(gè)已安裝驅(qū)動(dòng)器支持的最大設(shè)置 (在輸出中查找 MaxMultSect ).一些驅(qū)動(dòng)器聲稱支持多重扇區(qū)模式, 但在某些設(shè)置下丟失數(shù)據(jù).在極少的情況下,這樣的失敗會(huì)導(dǎo)致 嚴(yán)重的文件系統(tǒng)損壞.
-p
嘗試為指定的PIO模式對(duì)IDE接口芯片重編程,或者嘗試為驅(qū)動(dòng)器支持 的最佳的PIO模式進(jìn)行自動(dòng)調(diào)整.核心中僅針對(duì)于一些"知名"的芯片組支持這項(xiàng)特性,甚至這種支持不一定是最好的.一些IDE芯片組不能為 一個(gè)單一的驅(qū)動(dòng)器改變PIO模式,在這種情況下此選項(xiàng)可能導(dǎo)致PIO 模式的設(shè)置影響到 兩個(gè) 驅(qū)動(dòng)器.許多IDE芯片組支持少于或多于標(biāo)準(zhǔn)的六個(gè)(05)PIO模式, 所以實(shí)際實(shí)現(xiàn)的精確速度設(shè)置將由芯片組和驅(qū)動(dòng)器復(fù)雜的配合改變. 謹(jǐn)慎使用. 這項(xiàng)特性不包含任何針對(duì)不謹(jǐn)慎的保護(hù)措施,一個(gè)不成功的結(jié)果 可能導(dǎo)致 嚴(yán)重的文件系統(tǒng)損壞.
-P
為驅(qū)動(dòng)器的內(nèi)部預(yù)讀機(jī)制設(shè)置最大扇區(qū)數(shù). 不是所有的驅(qū)動(dòng)器都支持這項(xiàng)特性.
-q
安靜的操作下一個(gè)標(biāo)志,壓制正常輸出. 當(dāng)從/etc/rc.c/rc.local運(yùn)行時(shí),可用來(lái)減輕屏幕混亂程度. 不適用于 -i -v -t -T 標(biāo)志.
-r
獲得/設(shè)置驅(qū)動(dòng)器的只讀標(biāo)志.當(dāng)被設(shè)置時(shí),設(shè)備上的寫操作被禁止.
-R
登記一個(gè)IDE接口. 危險(xiǎn). 參見 -U 選項(xiàng)獲取更多信息.
-S
設(shè)置驅(qū)動(dòng)器待機(jī)(低速運(yùn)轉(zhuǎn))超時(shí)值. 驅(qū)動(dòng)器根據(jù)此值決定在關(guān)閉主軸電機(jī)以節(jié)約能耗之前等待多長(zhǎng) 時(shí)間(沒(méi)有磁盤操作).在這種狀態(tài)下,驅(qū)動(dòng)器可能需要來(lái)響應(yīng)一 個(gè)接下來(lái)的磁盤訪問(wèn),雖然大多數(shù)驅(qū)動(dòng)器要快很多.超時(shí)值的編 碼有些特別.0表示"關(guān)".1240被指定為5秒的倍數(shù), 也就是超時(shí)可以從5秒到20分鐘.241251指定30分鐘的111, 也就是超時(shí)可以從30分鐘到5.5個(gè)小時(shí).252表示超時(shí)21分鐘, 253設(shè)置一個(gè)銷售商定義的超時(shí),255表示2115.
-T
用于以基準(zhǔn)測(cè)試和比較為目的的緩存讀取計(jì)時(shí).要得到有意義的結(jié)果, 應(yīng)該在內(nèi)存不少于2M,系統(tǒng)沒(méi)有其它活動(dòng)(沒(méi)有其它活動(dòng)的程序) 的條件下,重復(fù)操作2-3.它顯示了不存取磁盤直接從Linux緩存 讀取數(shù)據(jù)的速度.這項(xiàng)測(cè)量實(shí)際上標(biāo)示了被測(cè)系統(tǒng)的處理器,緩存 和內(nèi)存的吞吐量. 如果標(biāo)志 -t 也被指定,那么一個(gè)基于 -T 輸出結(jié)果的修正量將被綜合到 -t 操作報(bào)告的結(jié)果中.
-t
用于以基準(zhǔn)測(cè)試和比較為目的的緩存讀取計(jì)時(shí).要得到有意義的結(jié)果, 應(yīng)該在內(nèi)存不少于2M,系統(tǒng)沒(méi)有其它活動(dòng)(沒(méi)有其它活動(dòng)的程序) 的條件下,重復(fù)操作2-3.它顯示了不使用預(yù)先的數(shù)據(jù)緩沖從磁盤 這項(xiàng)測(cè)量標(biāo)示了Linux下沒(méi)有任何文件系統(tǒng)開銷時(shí)磁盤可以支持多快的連續(xù)數(shù)據(jù)讀取.為確保測(cè)量的精確,緩存在 -t 的過(guò)程中通過(guò)BLKFLSBUF控制被刷新. 如果標(biāo)志 -T 也被指定,那么一個(gè)基于 -T 數(shù)促結(jié)果的修正量將被綜合到 -t 操作報(bào)告的結(jié)果中.
-u
獲得/設(shè)置驅(qū)動(dòng)器"不屏蔽中斷"標(biāo)志.設(shè)置為 1 允許驅(qū)動(dòng)器在磁盤中斷處理過(guò)程中不屏蔽別的中斷, 它極大改善了Linux的響應(yīng)性能,并排除了"串行端口溢出"錯(cuò)誤. 謹(jǐn)慎使用: 一些驅(qū)動(dòng)器/控制器組合不能承受可能是潛在的 I/O 增長(zhǎng), 而導(dǎo)致 嚴(yán)重的文件系統(tǒng)損壞. 特別, CMD-640B RZ1000 (E)IDE 接口可能是 不可靠的 (由于某種硬件缺陷),當(dāng)在早于 2.0.16 版本的核心下使用此選項(xiàng)時(shí). 關(guān)閉這些接口的(通常通過(guò)設(shè)置BIOS/CMOS) IDE 預(yù)讀 特性可以安全的解決這個(gè)問(wèn)題.
-U
注銷一個(gè)IDE接口. 危險(xiǎn). -R 的對(duì)應(yīng)選項(xiàng). 是為特別設(shè)計(jì)用來(lái)做熱交換的硬件準(zhǔn)備的(很罕見!). 使用時(shí)要有充分的知識(shí)和 非常的謹(jǐn)慎 ,因?yàn)樗苋菀捉K止或破壞你的系統(tǒng). hdparm 的源代碼包括一個(gè) ‘contrib‘ 目錄,里面有一些 用戶捐贈(zèng)的在一臺(tái) ThinkPad 600EUltraBay上作熱交換的記錄. 自己去冒險(xiǎn)吧.
-v
顯示所有的設(shè)置, 除了 -i ( -acdgkmnru 對(duì)于 IDE, -gr 對(duì)于 SCSI -adgr 對(duì)于 XT). 這也是未指定任何標(biāo)志時(shí)的默認(rèn)操作.
-W
關(guān)閉/打開 IDE 驅(qū)動(dòng)器的寫緩存特性 (通常默認(rèn)為 OFF ).
-X
為較新的 (E)IDE/ATA2 驅(qū)動(dòng)器設(shè)置 IDE 傳輸模式 . 特別是當(dāng)在一個(gè)被支持的接口芯片組( Intel 430FX Triton) 上打開通向一個(gè)驅(qū)動(dòng)器的DMA時(shí)與選項(xiàng) -d1 組合使用,在這里用 -X34 來(lái)選擇多字 DMA 模式2 傳輸. 對(duì)于支持 UltraDMA burst timings 的系統(tǒng), -X66 來(lái)選擇 UltraDMA mode2 傳輸 (你需要在這之前為 UltraDMA 準(zhǔn)備好被支持的芯片組). 另外, 幾乎沒(méi)有必要 使用此標(biāo)志,因?yàn)榇蠖鄶?shù)/全部現(xiàn)代 IDE 驅(qū)動(dòng)器默認(rèn)它們最快的
PIO
傳輸模式為打開. 所以擺弄它是沒(méi)有必要的也是冒險(xiǎn)的. 在支持 alternate 傳輸模式的驅(qū)動(dòng)器上, -X 可以被 僅 用來(lái)選擇模式. 在改變傳輸模式之前, 應(yīng)該為新模式的設(shè)置給 IDE 接口跳線或編程( -p 標(biāo)志) 以防止數(shù)據(jù)的丟失或損壞. 請(qǐng)非常小心地使用它! 對(duì)于 Linux 使用的 PIO 傳輸模式,此值就是要求的 PIO 模式號(hào)加 8. 這樣, 09 設(shè)置 PIO mode1, 10 設(shè)置 PIO mode2,
11
設(shè)置 PIO mode3. 設(shè)置為 00 還原驅(qū)動(dòng)器的默認(rèn) PIO 模式, 01 關(guān)閉 IORDY. 對(duì)于多字 DMA, 使用的值時(shí)要求的 DMA 模式號(hào)加 32. 對(duì)于 UltraDMA ,相應(yīng)的值是要求 UltraDMA 模式號(hào)加64.
-y
迫使一個(gè) IDE 驅(qū)動(dòng)器立即進(jìn)入低能耗 待機(jī) 模式, 通常使它低速運(yùn)轉(zhuǎn). 當(dāng)前能耗模式狀態(tài)可以用 -C 標(biāo)志來(lái)檢查.
-Y
迫使一個(gè) IDE 驅(qū)動(dòng)器立即進(jìn)入最低能耗 睡眠 模式, 使它完全關(guān)閉. 一個(gè)來(lái)自硬件或軟件的重置 可以重新喚醒驅(qū)動(dòng)器. ( 如果需要,Linux IDE 驅(qū)動(dòng)器將自動(dòng)產(chǎn)生一個(gè)重置 ).
-Z
關(guān)閉某些 Seagate 驅(qū)動(dòng)器(STxxx ?)的自動(dòng)節(jié)能功能, 以防止它們?cè)诓贿m當(dāng)?shù)臅r(shí)候空轉(zhuǎn)或低速運(yùn)轉(zhuǎn).

BUGS
像上面提到的, -m 扇區(qū)數(shù) 和 -u 1 選項(xiàng)尤其要小心使用, 最好在一個(gè)只讀文件系統(tǒng)上使用. 大多數(shù)驅(qū)動(dòng)器和這些特性配合得很好,但有一些驅(qū)動(dòng)器/控制器 組合不是100%兼容的.使用可能導(dǎo)致文件系統(tǒng)損壞. 請(qǐng)?jiān)趯?shí)驗(yàn)之前給所有的數(shù)據(jù)作備份!

某些選項(xiàng) (例如: -r 對(duì)于 SCSI) 可能在舊的核心下因?yàn)楹诵牟?支持必要的 icctl() 而不能工作.

雖然這個(gè)命令只是為使用 (E)IDE 硬盤設(shè)備準(zhǔn)備的,但有幾個(gè)選項(xiàng)也能夠(允許)用于帶有 XT 接口的 SCSI 硬盤設(shè)備和 MFM/RLL 硬盤.
作者
hdparm
是由 Mark Lord <mlord@pobox.com>, Linux (E)IDE 驅(qū)動(dòng)程序 的主要開發(fā)者和維護(hù)者編寫的,并聽取了很多網(wǎng)友的建議.

關(guān)閉 Seagate 自動(dòng)節(jié)能的代碼是征得
Tomi Leppikangas(tomilepp@paju.oulu.fi)
允許使用的.

 

3,英文手冊(cè):

http://wiki.chinaunix.net/index.php?title=Hdparm&variant=zh-cn

 

Linux命令:hdparm

功能說(shuō)明:顯示與設(shè)定硬盤的參數(shù)。
語(yǔ)  法:hdparm [-CfghiIqtTvyYZ][-a <快取分區(qū)>][-A <01>][-c ][-d <01>][-k <01>][-K <01>][-m <分區(qū)數(shù)>][-n <01>][-p ][-P <分區(qū)數(shù)>][-r <01>][-S <時(shí)間>][-u <01>][-W <01>][-X <傳輸模式>][設(shè)備]
補(bǔ)充說(shuō)明:hdparm可檢測(cè),顯示與設(shè)定IDESCSI硬盤的參數(shù)。
參  數(shù):
-a<快取分區(qū)>   設(shè)定讀取文件時(shí),預(yù)先存入塊區(qū)的分區(qū)數(shù),若不加上<快取分區(qū)>選項(xiàng),則顯示目前的設(shè)定。
-A<01>   啟動(dòng)或關(guān)閉讀取文件時(shí)的快取功能。
-c   設(shè)定IDE32I/O模式。
-C   檢測(cè)IDE硬盤的電源管理模式。
-d<01>   設(shè)定磁盤的DMA模式。
-f   將內(nèi)存緩沖區(qū)的數(shù)據(jù)寫入硬盤,并清楚緩沖區(qū)。
-g   顯示硬盤的磁軌,磁頭,磁區(qū)等參數(shù)。
-h   顯示幫助。
-i   顯示硬盤的硬件規(guī)格信息,這些信息是在開機(jī)時(shí)由硬盤本身所提供。
-I   直接讀取硬盤所提供的硬件規(guī)格信息。
-k<01>   重設(shè)硬盤時(shí),保留-dmu參數(shù)的設(shè)定。
-K<01>   重設(shè)硬盤時(shí),保留-APSWXZ參數(shù)的設(shè)定。
-m<磁區(qū)數(shù)>   設(shè)定硬盤多重分區(qū)存取的分區(qū)數(shù)。
-n<01>   忽略硬盤寫入時(shí)所發(fā)生的錯(cuò)誤。
-p   設(shè)定硬盤的PIO模式。
-P<磁區(qū)數(shù)>   設(shè)定硬盤內(nèi)部快取的分區(qū)數(shù)。
-q   在執(zhí)行後續(xù)的參數(shù)時(shí),不在屏幕上顯示任何信息。
-r<01>   設(shè)定硬盤的讀寫模式。
-S<時(shí)間>   設(shè)定硬盤進(jìn)入省電模式前的等待時(shí)間。
-t   評(píng)估硬盤的讀取效率。
-T   平谷硬盤快取的讀取效率。
-u<01>   在硬盤存取時(shí),允許其他中斷要求同時(shí)執(zhí)行。
-v   顯示硬盤的相關(guān)設(shè)定。
-W<01>   設(shè)定硬盤的寫入快取。
-X<傳輸模式>   設(shè)定硬盤的傳輸模式。
-y   使IDE硬盤進(jìn)入省電模式。
-Y   使IDE硬盤進(jìn)入睡眠模式。
-Z   關(guān)閉某些Seagate硬盤的自動(dòng)省電功能。 


英文版本,歡迎翻譯:

NAME hdparm - get/set hard disk parameters

SYNOPSIS hdparm [ -a [sectcount] ] [ -A [0|1] ] [ -c [chipset_mode] ] [ -C ] [ -d [0|1] ] [ -f ] [ -g ] [ -i ] [ -k [0|1] ] [ -K [0|1] ] [ -L [0|1] ] [ -m [sectcount] ] [ -p [0|1|2|3|4|5] ] [ -P [sectcount] ] [ -q ] [ -r [0|1] ] [ -S [timeout] ] [ -T ] [ -t ] [ -u [0|1] ] [ -v ] [ -W [0|1] ] [ -X [xfermode] ] [ -y ] [ -Y ] [ -Z ] [device] ..

DESCRIPTION hdparm provides a command line interface to various hard disk ioctls supported by the stock Linux IDE/ST-506 device driver. This utility requires Linux kernel version 1.2.13 or later. Some options may not work correctly with earlier kernels. In addition, several options are supported only for kernels which include the new (E)IDE device driver, such as version 2.0.10 or later. These options are unavail? able when hdparm is compiled on systems with older kernel files in /usr/include/linux.

OPTIONS When no flags are given, -acdgkmnru is assumed (except when a given device is SCSI or an old XT-type MFM/RLL, in which cases -gr and -adgr are the defaults, respectively).

-a Get/set sector count for filesystem read-ahead. This is used to improve performance in sequen? tial 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 sec? tors (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 drives read-lookahead feature (usually ON by default).

-c Query/enable (E)IDE 32-bit I/O support. A numeric parameter can be used to enable/disable 32-bit I/O support: Currently supported values include 0 to disable 32-bit I/O support, 1 to enable 32-bit data transfers, and 3 to enable 32-bit data transfers with a special sync sequence required by many chipsets. 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 Check the current IDE power mode status, which will always be one of unknown (drive does not sup? port this command), active/idle (normal operation), standby (low power mode, drive has spun down), or sleeping (lowest power mode, drive is completely shut down). The -S, -y, -Y, and -Z flags can be used to manipulate the IDE power modes.

-d Disable/enable the "using_dma" flag for this drive. This option only works with a few combina? tions of drives and interfaces which support DMA and which are known to the IDE driver (and with all supported XT interfaces). In particular, the Intel Triton chipset is supported for bus-mas? tered DMA operation with many drives (experimental). It is also a good idea to use the -X34 option in combination with -d1 to ensure that the drive itself is programmed for multiword DMA mode2. Using DMA does not necessarily provide any improvement in throughput or system perfor? mance, but many folks swear by it. Your mileage may vary.

-E Set cdrom speed. This is NOT necessary for regular operation, as the drive will automatically switch speeds on its own. But if you want to play with it, just supply a speed number after the option, usually a number like 2 or 4.

-f Sync and flush the buffer cache for the device on exit. This operation is also performed as part of the -t and -T timings.

-g Display the drive geometry (cylinders, heads, sectors), the size (in sectors) of the device, and the starting offset (in sectors) of the device from the beginning of the drive.

-h Display terse usage information (help).

-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 Request identification info directly from the drive, which is displayed in its raw form with no endian changes or corrections. Otherwise similar to the -i option.

-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).

-K Set the drives keep_features_over_reset flag. Setting this enables the drive to retain the set? tings for -APSWXZ over a soft reset (as done during the error recovery sequence). Not all drives support this feature.

-L Set the drives doorlock flag. Setting this to will lock the door mechanism of some removeable hard drives (eg. Syquest, ZIP, Jazz..), and setting it to 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 -b after the root filesystem is remounted read-only, one can then remove the cartridge from the drive after shutdown.

-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, permit? ting 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 multi? ple 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 MaxMult? Sect 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.

-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 sophistication. Use with extreme caution! This feature includes zero protection for the unwary, and an unsuccessful outcome may result in severe filesystem corruption!

-P Set the maximum sector count for the drives internal prefetch mechanism. Not all drives support this feature.

-q Handle the next flag quietly, supressing normal output. This is useful for reducing screen clut? ter when running from /etc/rc.c/rc.local. Not applicable to the -i or -v or -t or -T flags.

-r Get/set read-only flag for device. When set, write operations are not permitted on the device.

-R Register an IDE interface. Dangerous. See the -U option for more information.

-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 "off". Values from 1 to 240 specify multiples of 5 seconds, for timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, for timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes, 253 sets a vendor-defined timeout, and 255 is interpreted as 21 minutes plus 15 seconds.

-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 pro? cesses) 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 incor? porated into the result reported for the -t operation.

-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 pro? cesses) 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 measurments, the buffer cache is flushed during the pro? cessing 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 opera? tion.

-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 Linuxs responsiveness and eliminates "serial port overrun" errors. Use this feature with caution: some drive/con? troller 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 ver? sions 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.

-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.

-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 Disable/enable the IDE drives write-caching feature (usually OFF by default).

-X Set the IDE transfer mode for newer (E)IDE/ATA2 drives. This is typically used in combination with -d1 when enabling DMA to/from a drive on a supported interface chipset (such as the Intel 430FX Triton), where -X34 is used to select multiword DMA mode2 transfers. With systems which support UltraDMA burst timings, -X66 is used to select UltraDMA mode2 transfers (youll need to prepare the chipset for UltraDMA beforehand). Apart from that, use of this flag is seldom neces? sary 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 pre? vent 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 drives "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.

-y Force an IDE drive to immediately enter the low power consumption standby mode, usually causing it to spin down. The current power mode status can be checked using the -C flag.

-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.

-Z Disable the automatic power-saving function of certain Seagate drives (ST3xxx models?), to pre? vent them from idling/spinning-down at inconvenient times.

BUGS As noted above, the -m sectcount and -u 1 options should be used with caution at first, preferably on a read-only filesystem. Most drives work well with these features, but a few drive/controller combina? tions are not 100% compatible. Filesystem corruption may result. Backup everything before experiment? ing!

Some options (eg. -r for SCSI) may not work with old kernels as necessary ioctl()s were not supported.

Although this utility is intended primarily for use with (E)IDE hard disk devices, several of the options are also valid (and permitted) for use with SCSI hard disk devices and MFM/RLL hard disks with XT interfaces.

AUTHOR hdparm has been written by Mark Lord <mlord@pobox.com>, the primary developer and maintainer of the (E)IDE driver for Linux, with suggestions from many netfolk.

The disable Seagate auto-powersaving code is courtesy of Tomi Leppikangas(tomilepp@paju.oulu.fi).

SEE ALSO AT Attachment Interface for Disk Drives, ANSI ASC X3T9.2 working draft, revision 4a, April 19, 1993.

AT Attachment Interface with Extensions (ATA-2), ANSI ASC X3T9.2 working draft, revision 2f, July 26, 1994.

Western Digital Enhanced IDE Implementation Guide, by Western Digital Corporation, revision 5.0, Novem? ber 10, 1993.

Enhanced Disk Drive Specification, by Phoenix Technologies Ltd., version 1.0, January 25, 1994.

Version 3.9 February 2000 1

[Category:Linux]]

 

4, Speeding up Linux Using hdparm

http://www.host01.com/article/server/00070002/0621409064857145.htm

Are you running an Intel Linux system with at least one (E)IDE hard drive?

 

 

Wouldn‘t it be neat if there were a magical command to instantly double the I/O performance of your disks? Or, in some cases, show 6 to 10 times your existing throughput?

 

Did you ever just wonder how to tell what kind of performance you‘re getting on your "tricked-out" Linux box?

 

Don‘t overlook hdparm(. If you‘ve never heard of it, don‘t worry. Most people I‘ve talked to haven‘t either. But if you‘re running an IDE/Linux system (as many folks are,) you‘ll wonder how you ever got this far without it. I know I did.

 

What‘s the big deal?

So, you‘ve got your brand-new UltraATA/66 EIDE drive with a screaming brand-new controller chipset that supports multiple PIO modes and DMA and the leather seat option and extra chrome... But is your system actually taking advantage of these snazzy features? The hdparm( command will not only tell you how your drives are performing, but will let you tweak them out to your heart‘s content.

 

Now before you get too excited, it is worth pointing out that under some circumstances, these commands CAN CAUSE UNEXPECTED DATA CORRUPTION! Use them at your own risk! At the very least, back up your box and bring it down to single-user mode before proceeding.

 

With the usual disclaimer out of the way, I‘d like to point out that if you are using current hardware (i.e. your drive AND controller AND motherboard were manufactured in the last two or three years), you are at considerably lower risk. I‘ve used these commands on several boxes with various hardware configurations, and the worst I‘ve seen happen is the occasional hang, with no data problems on reboot. And no matter how much you might whine at me and the world in general for your personal misfortune, we all know who is ultimately responsible for the well-being of YOUR box: YOU ARE. Caveat Fair Reader.

 

Now, then. If I haven‘t scared you away yet, try this (as root, preferably in single-user mode):

 

hdparm -Tt /dev/hda

You‘ll see something like:

 

/dev/hda:

 Timing buffer-cache reads:   128 MB in  1.34 seconds =95.52 MB/sec

 Timing buffered disk reads:  64 MB in 17.86 seconds = 3.58 MB/sec

What does this tell us? The -T means to test the cache system (i.e., the memory, CPU, and buffer cache). The -t means to report stats on the disk in question, reading data not in the cache. The two together, run a couple of times in a row in single-user mode, will give you an idea of the performance of your disk I/O system. (These are actual numbers from a PII/350 / 128M Ram / newish EIDE HD; your numbers will vary.)

 

But even with varying numbers, 3.58 MB/sec is PATHETIC for the above hardware. I thought the ad for the HD said something about 66MB per second!!?!? What gives?

 

Well, let‘s find out more about how Linux is addressing your drive:

 

hdparm /dev/hda

 

/dev/hda:

 multcount    =  0 (off)

 I/O support  =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  0 (off)

 keepsettings =  0 (off)

 nowerr       =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 1870/255/63, sectors = 30043440, start = 0

These are the defaults. Nice, safe, but not necessarily optimal. What‘s all this about 16-bit mode? I thought that went out with the 386! And why are most of the other options turned off?

 

Well, it‘s generally considered a good idea for any self-respecting distribution to install itself in the kewlest, slickest, but SAFEST way it possibly can. The above settings are virtually guaranteed to work on any hardware you might throw at it. But since we know we‘re throwing something more than a dusty, 8-year-old, 16-bit multi-IO card at it, let‘s talk about the interesting options:

multcount: Short for multiple sector count. This controls how many sectors are fetched from the disk in a single I/O interrupt. Almost all modern IDE drives support this. The man page claims: 


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.
I/O support: This is a big one. This flag controls how data is passed from the PCI bus to the controller. Almost all modern controller chipsets support mode 3, or 32-bit mode w/sync. Some even support 32-bit async. Turning this on will almost certainly double your throughput (see below.) 


unmaskirq: Turning this on will allow Linux to unmask other interrupts while processing a disk interrupt. What does that mean? It lets Linux attend to other interrupt-related tasks (i.e., network traffic) while waiting for your disk to return with the data it asked for. It should improve overall system response time, but be warned: Not all hardware configurations will be able to handle it. See the manpage. 


using_dma: DMA can be a tricky business. If you can get your controller and drive using a DMA mode, do it. But I have seen more than one machine hang while playing with this option. Again, see the manpage (and the example on the next page)! 


Turbocharged
So, since we have our system in single-user mode like a good little admin, let‘s try out some turbo settings:

 

hdparm -c3 -m16 /dev/hda

/dev/hda:
 setting 32-bit I/O support flag to 3
 setting multcount to 16
 multcount    =  16 (on)
 I/O support  =  3 (32-bit w/sync)

Great! 32-bit sounds nice. And some multi-reads might work. Let‘s re-run the benchmark:

hdparm -tT /dev/hda


/dev/hda:
 Timing buffer-cache reads:   128 MB in  1.41 seconds =90.78 MB/sec
 Timing buffered disk reads:  64 MB in  9.84 seconds = 6.50 MB/sec
WOW! Almost double the disk throughput without really trying! Incredible.

But wait, there‘s more: We‘re still not unmasking interrupts, using DMA, or even a using decent PIO mode! Of course, enabling these gets riskier. (Why is it always a trade-off between freedom and security?) The man page mentions trying Multiword DMA mode2, so:

hdparm -X34 -d1 -u1 /dev/hda
...Unfortunately this seems to be unsupported on this particular box (it hung like an NT box running a Java app.) So, after rebooting it (again in single-user mode), I went with this:

hdparm -X66 -d1 -u1 -m16 -c3 /dev/hda

/dev/hda:
 setting 32-bit I/O support flag to 3
 setting multcount to 16
 setting unmaskirq to 1 (on)
 setting using_dma to 1 (on)
 setting xfermode to 66 (UltraDMA mode2)
 multcount    = 16 (on)
 I/O support  =  3 (32-bit w/sync)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
And then checked:

hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   128 MB in  1.43 seconds =89.51 MB/sec
 Timing buffered disk reads:  64 MB in  3.18 seconds =20.13 MB/sec

20.13 MB/sec. A far cry from the miniscule 3.58 we started with...

 

By the way, notice how we specified the -m16 and -c3 switch again? That‘s because it doesn‘t remember your hdparm settings between reboots. Be sure to add the above line to your /etc/rc.d/* scripts once you‘re sure the system is stable (and preferably after your fsck runs; having an extensive fs check run with your controller in a flaky mode may be a good way to generate vast quantities of entropy, but it‘s no way to administer a system. At least not with a straight face...)

 

Now, after running the benchmark a few more times, reboot in multi-user mode and fire up X. Load Netscape. And try not to fall out of your chair.

 

In conclusion

This is one of those interesting little tidbits that escapes many "seasoned" Linux veterans, especially since one never sees any indication that the system isn‘t using the most optimal settings. (Gee, all my kernel messages have looked fine....) And using hdparm isn‘t completely without risk, but is well worth investigating.

 

And it doesn‘t stop at performance: hdparm lets you adjust various power saving modes as well. See the hdparm( for the final word.

 

Many thanks to Mark Lord for putting together this nifty utility. If your particular distribution doesn‘t include hdparm (usually in /sbin or /usr/sbin), get it from the source at http://metalab.unc.edu/pub/Linux/system/hardware/

 

Happy hacking! 

 

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
IDE接口資料
BIOS中E文對(duì)照表+BIOS的設(shè)置及其影響 (三)
BIOS設(shè)置圖解教程**
BIOS的基本知識(shí)
Windows XP系統(tǒng)優(yōu)化設(shè)置 體驗(yàn)飛一般感覺
如何在Linux系統(tǒng)下用DMA方式傳輸數(shù)據(jù)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服