為什麼我的非系統硬碟無法降速?

為什麼我的非系統硬碟無法降速?

不幸的是,我的非系統(/媒體)HDD 在大約 1-2 分鐘後從睡眠中喚醒。我嘗試在這些線程的幫助下調查哪個進程可以在睡眠時請求訪問硬碟:

https://unix.stackexchange.com/questions/29409/finding-out-what-is-spinning-up-harddrive

結果: root@xyz:/# dmesg -c | grep sdb [158741.703982] systemd-udevd(22709): READ block 5860530048 on sdb1 (8 sectors) [158748.094970] systemd-udevd(22709): READ block 5860530160 on sdb1 (8 sectors) [158748.107881] systemd-udevd(22709): READ block 0 on sdb1 (8 sectors) [158748.107974] systemd-udevd(22709): READ block 8 on sdb1 (8 sectors) [158748.108050] systemd-udevd(22709): READ block 5860530168 on sdb1 (8 sectors) [158748.108118] systemd-udevd(22709): READ block 5860529912 on sdb1 (8 sectors) [158748.108243] systemd-udevd(22709): READ block 24 on sdb1 (8 sectors) [158748.108306] systemd-udevd(22709): READ block 56 on sdb1 (8 sectors) [158748.108424] systemd-udevd(22709): READ block 0 on sdb (8 sectors) [158748.108510] systemd-udevd(22709): READ block 8 on sdb (8 sectors) [158748.108515] systemd-udevd(22709): READ block 16 on sdb (8 sectors) [158748.108519] systemd-udevd(22709): READ block 24 on sdb (8 sectors) [158748.108522] systemd-udevd(22709): READ block 32 on sdb (8 sectors) [158748.109663] parted(22708): READ block 5860533160 on sdb (8 sectors) [158748.111845] parted(22708): READ block 5860533128 on sdb (8 sectors) [158748.111857] parted(22708): READ block 5860533136 on sdb (8 sectors) [158748.111861] parted(22708): READ block 5860533144 on sdb (8 sectors) [158748.111864] parted(22708): READ block 5860533152 on sdb (8 sectors) [158748.112577] parted(22708): READ block 2304 on sdb (8 sectors) [158748.112655] parted(22708): READ block 2176 on sdb (8 sectors) [158748.112724] parted(22708): READ block 2048 on sdb (8 sectors) [158748.112792] parted(22708): READ block 5860532216 on sdb (8 sectors) [158748.112873] parted(22708): READ block 2112 on sdb (8 sectors) [158748.112973] parted(22708): READ block 2064 on sdb (8 sectors) [158748.113039] parted(22708): READ block 2560 on sdb (8 sectors) [158748.114847] systemd-udevd(22718): READ block 5860532992 on sdb (8 sectors) [158748.115923] systemd-udevd(22718): READ block 5860532904 on sdb (8 sectors) [158748.116003] systemd-udevd(22718): READ block 5860533104 on sdb (8 sectors) [158748.116063] systemd-udevd(22718): READ block 5860532912 on sdb (8 sectors) [158748.116123] systemd-udevd(22718): READ block 5860532768 on sdb (8 sectors) [158748.116180] systemd-udevd(22718): READ block 5860532576 on sdb (8 sectors) [158748.116236] systemd-udevd(22718): READ block 5860532488 on sdb (8 sectors) [158748.116290] systemd-udevd(22718): READ block 5860532432 on sdb (8 sectors) [158748.116345] systemd-udevd(22718): READ block 5860532256 on sdb (8 sectors) [158748.116403] systemd-udevd(22718): READ block 5860532192 on sdb (8 sectors) [158748.116453] systemd-udevd(22718): READ block 5860532176 on sdb (8 sectors) [158748.116507] systemd-udevd(22718): READ block 5860530080 on sdb (8 sectors) [158748.136347] systemd-udevd(22718): READ block 56 on sdb (8 sectors) [158748.136517] systemd-udevd(22718): READ block 120 on sdb (8 sectors) [158748.136734] systemd-udevd(22718): READ block 40 on sdb (8 sectors) [158748.136746] systemd-udevd(22718): READ block 48 on sdb (8 sectors) [158748.136762] systemd-udevd(22718): READ block 64 on sdb (8 sectors) [158748.136766] systemd-udevd(22718): READ block 72 on sdb (8 sectors) [158748.136770] systemd-udevd(22718): READ block 80 on sdb (8 sectors) [158748.136773] systemd-udevd(22718): READ block 88 on sdb (8 sectors) [158748.136778] systemd-udevd(22718): READ block 96 on sdb (8 sectors) [158748.136781] systemd-udevd(22718): READ block 104 on sdb (8 sectors) [158748.136784] systemd-udevd(22718): READ block 112 on sdb (8 sectors) [158748.136787] systemd-udevd(22718): READ block 128 on sdb (8 sectors) [158748.136792] systemd-udevd(22718): READ block 136 on sdb (8 sectors) [158748.136795] systemd-udevd(22718): READ block 144 on sdb (8 sectors) [158748.136798] systemd-udevd(22718): READ block 152 on sdb (8 sectors) [158748.136801] systemd-udevd(22718): READ block 160 on sdb (8 sectors) [158748.136804] systemd-udevd(22718): READ block 168 on sdb (8 sectors) [158748.136808] systemd-udevd(22718): READ block 176 on sdb (8 sectors) [158748.136814] systemd-udevd(22718): READ block 184 on sdb (8 sectors) [158748.136817] systemd-udevd(22718): READ block 192 on sdb (8 sectors) [158748.136820] systemd-udevd(22718): READ block 200 on sdb (8 sectors) [158748.136826] systemd-udevd(22718): READ block 208 on sdb (8 sectors) [158748.136829] systemd-udevd(22718): READ block 216 on sdb (8 sectors) [158748.136836] systemd-udevd(22718): READ block 224 on sdb (8 sectors) [158748.136841] systemd-udevd(22718): READ block 232 on sdb (8 sectors) [158748.136845] systemd-udevd(22718): READ block 240 on sdb (8 sectors) [158748.136848] systemd-udevd(22718): READ block 248 on sdb (8 sectors) [158748.136852] systemd-udevd(22718): READ block 256 on sdb (8 sectors) [158748.136858] systemd-udevd(22718): READ block 264 on sdb (8 sectors) [158748.136862] systemd-udevd(22718): READ block 272 on sdb (8 sectors) [158748.136865] systemd-udevd(22718): READ block 280 on sdb (8 sectors) [158748.136868] systemd-udevd(22718): READ block 288 on sdb (8 sectors) [158748.136874] systemd-udevd(22718): READ block 296 on sdb (8 sectors) [158748.136878] systemd-udevd(22718): READ block 304 on sdb (8 sectors) [158748.136882] systemd-udevd(22718): READ block 312 on sdb (8 sectors) [158748.136885] systemd-udevd(22718): READ block 320 on sdb (8 sectors) [158748.136887] systemd-udevd(22718): READ block 328 on sdb (8 sectors) [158748.136895] systemd-udevd(22718): READ block 336 on sdb (8 sectors) [158748.136899] systemd-udevd(22718): READ block 344 on sdb (8 sectors) [158748.136903] systemd-udevd(22718): READ block 352 on sdb (8 sectors) [158748.136907] systemd-udevd(22718): READ block 360 on sdb (8 sectors) [158748.136911] systemd-udevd(22718): READ block 368 on sdb (8 sectors) [158748.136914] systemd-udevd(22718): READ block 376 on sdb (8 sectors) [158748.136917] systemd-udevd(22718): READ block 384 on sdb (8 sectors) [158748.136923] systemd-udevd(22718): READ block 392 on sdb (8 sectors) [158748.136927] systemd-udevd(22718): READ block 400 on sdb (8 sectors) [158748.136932] systemd-udevd(22718): READ block 408 on sdb (8 sectors) [158748.136936] systemd-udevd(22718): READ block 416 on sdb (8 sectors) [158748.136939] systemd-udevd(22718): READ block 424 on sdb (8 sectors) [158748.136943] systemd-udevd(22718): READ block 432 on sdb (8 sectors) [158748.136945] systemd-udevd(22718): READ block 440 on sdb (8 sectors) [158748.136949] systemd-udevd(22718): READ block 448 on sdb (8 sectors) [158748.136952] systemd-udevd(22718): READ block 456 on sdb (8 sectors) [158748.136954] systemd-udevd(22718): READ block 464 on sdb (8 sectors) [158748.136956] systemd-udevd(22718): READ block 472 on sdb (8 sectors) [158748.136959] systemd-udevd(22718): READ block 480 on sdb (8 sectors) [158748.136961] systemd-udevd(22718): READ block 488 on sdb (8 sectors) [158748.136965] systemd-udevd(22718): READ block 496 on sdb (8 sectors) [158748.136968] systemd-udevd(22718): READ block 504 on sdb (8 sectors) [158748.138198] systemd-udevd(22718): READ block 768 on sdb (8 sectors) [158748.138303] systemd-udevd(22718): READ block 776 on sdb (8 sectors) [158748.138363] systemd-udevd(22718): READ block 784 on sdb (8 sectors) [158748.138445] systemd-udevd(22718): READ block 792 on sdb (8 sectors) [158748.138540] systemd-udevd(22718): READ block 800 on sdb (8 sectors) [158748.138629] systemd-udevd(22718): READ block 808 on sdb (8 sectors) [158748.138712] systemd-udevd(22718): READ block 816 on sdb (8 sectors) [158748.138798] systemd-udevd(22718): READ block 824 on sdb (8 sectors) [158748.138927] systemd-udevd(22718): READ block 832 on sdb (8 sectors) [158748.139047] systemd-udevd(22718): READ block 840 on sdb (8 sectors) [158748.139129] systemd-udevd(22718): READ block 848 on sdb (8 sectors) [158748.139220] systemd-udevd(22718): READ block 856 on sdb (8 sectors) [158748.139312] systemd-udevd(22718): READ block 864 on sdb (8 sectors) [158748.139391] systemd-udevd(22718): READ block 872 on sdb (8 sectors) [158748.139470] systemd-udevd(22718): READ block 880 on sdb (8 sectors) [158748.139610] systemd-udevd(22718): READ block 888 on sdb (8 sectors) [158748.139717] systemd-udevd(22718): READ block 896 on sdb (8 sectors) [158748.140240] systemd-udevd(22718): READ block 904 on sdb (8 sectors) [158748.140307] systemd-udevd(22718): READ block 912 on sdb (8 sectors) [158748.140414] systemd-udevd(22718): READ block 920 on sdb (8 sectors) [158748.140480] systemd-udevd(22718): READ block 928 on sdb (8 sectors) [158748.140544] systemd-udevd(22718): READ block 936 on sdb (8 sectors) [158748.140607] systemd-udevd(22718): READ block 944 on sdb (8 sectors) [158748.140664] systemd-udevd(22718): READ block 952 on sdb (8 sectors) [158748.140721] systemd-udevd(22718): READ block 960 on sdb (8 sectors) [158748.140784] systemd-udevd(22718): READ block 968 on sdb (8 sectors) [158748.140845] systemd-udevd(22718): READ block 976 on sdb (8 sectors) [158748.140901] systemd-udevd(22718): READ block 984 on sdb (8 sectors) [158748.140964] systemd-udevd(22718): READ block 992 on sdb (8 sectors) [158748.141025] systemd-udevd(22718): READ block 1000 on sdb (8 sectors) [158748.141157] systemd-udevd(22718): READ block 1008 on sdb (8 sectors) [158748.141221] systemd-udevd(22718): READ block 1016 on sdb (8 sectors) [158748.141289] systemd-udevd(22718): READ block 512 on sdb (8 sectors) [158748.141359] systemd-udevd(22718): READ block 4096 on sdb (8 sectors)

所以首先我厭倦了找出 system-udevd 負責什麼。我的假設是 SMART 功能可能會喚醒它。但即使我關閉了智慧(smartctl set -off /dev/sdb),硬碟仍然被喚醒。最後我停止了udevd服務,但是parted進程仍然喚醒了它。無論如何,udevd 對於系統來說可能是必不可少的。當然,gparted 不是在後台運行。我還嘗試將 noatime 選項添加到 fstab 中,但它沒有幫助。我已經沒有想法了,而且我在網路上找不到更多的提示。所以我真的很感謝一些有針對性的幫助,以獲得解決方案。

大約一個月來我沒有遇到這個問題,所以我認為這甚至可能是個錯誤。也許是 udev/parted 進程,或者我不知道。如果您需要更多資訊進行調查,我很樂意發布更多資訊。並且請不要卸載硬碟,我想要一個自動化的解決方案,因為它最初是為了工作的。謝謝你!

root@xyz:/# uname -r 3.16.0-33-generic root@xyz:/# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.10 Release: 14.10 Codename: utopic

掛載列表:

root@xyz mount -l ... /dev/mapper/sdb1_crypt on /media/vol1 type btrfs (rw,noatime,device=/dev/mapper/sdb1_crypt,device=/dev/mapper/sdc1_crypt,compress=lzo)

root@xyz:/# sudo smartctl -i -d sat /dev/sdb -P show
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.16.0-33-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
enter code here
Drive found in smartmontools Database.  Drive identity strings:
MODEL:              WDC WD30EFRX-68AX9N0
FIRMWARE:           80.00A80
match smartmontools Drive Database entry:
MODEL REGEXP:       WDC WD(10|20|30)EFRX-.*
FIRMWARE REGEXP:    .*
MODEL FAMILY:       Western Digital Red (AF)
ATTRIBUTE OPTIONS:  None preset; no -v options are required.

答案1

我正在追尋類似的問題並且我正在使用整合查看哪些文件已被訪問,以追蹤正在訪問它們的程式。此指令將監視特定目錄 X 分鐘:

inotifywatch -v -e 存取 -e 修改 -t "$TIME" -r "$STORAGE"

將“$TIME”替換為要監視的長度(以秒為單位),將“$STORAGE”替換為您要監視的目錄。

答案2

根據我的經驗,udisksd惡魔永遠是罪人。如果你能卸載,我就羨慕你了;如果它被一堆 GUI 程式所依賴取決於(KDE4對我來說)這是我的解決方法:

假設您已經為硬碟設定了空閒逾時 (hdparm -S),請查看sudo killall -SIGSTOP udisksd現在是否讓它們自行旋轉。您甚至不需要卸載它們——只要它們不被訪問就足夠了。如果您的檔案系統已安裝noatime,並且您有足夠的頁面緩存,則表示您不能給他們。

如果這有效,您很快就會發現 GUI 程式將在某些情況下掛起。根據我的經驗,KDE4 啟動和開啟/儲存對話方塊將掛起。解決方案是簡單地再次解凍守護進程:sudo killall -SIGCONT udisksd。值得慶幸的是,這不會再次使您的磁碟旋轉,否則這個技巧將毫無價值!然而,每當守護程序啟動時,它們都會旋轉起來,這就是為什麼停止它是沒有用的。為了方便起見,您可能需要一個 cron 作業來執行凍結操作,這樣您就可以專注於解凍操作 – 您將不得不經常這樣做...

相關內容