为什么我的 RAID 中的 WDC WD20EARX-00PASB0 不停止旋转?

jbw*_*wiv 5 filesystem raid hard-drive

我的磁盘已经旋转了几个月。它从 Ubuntu 11.10 开始,一直到 12.04。我不知道如何阻止它。我在网上看了很多人关于 ext4 提交时间、noatime 等的建议。我已经按照他们说的做了,但仍然没有运气。现在就像中国的水刑……我不断地听到那些磁盘的嗡嗡声,它开始让我发疯。

jdb2/dm-1-8 和 jbd2/db-0-8 通常是顶级 IO 用户。但是,我几乎关闭了所有内容,“echo 1 > /proc/sys/vm/block_dump”,并观看了 dmesg。jbd2/dm-1 和 jdb2/dm-0 每 60 秒可靠地刷新一次,但硬盘驱动器在此期间继续旋转。dm-1 挂载在 /home 上,dm-0 挂载为 /。

我的设置有点复杂:

我有一个 root 所在的 SSD,然后是两个使用软件 RAID 镜像的常规驱动器,其他 LVM 分区所在的位置。

在此之上还有 LVM 分区。然后,/home 使用 ecryptfs 加密。

这是 pvdisplay 输出:


  --- Physical volume ---
  PV Name               /dev/sdd6
  VG Name               ROOT_VG
  PV Size               211.46 GiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              54134
  Free PE               18372
  Allocated PE          35762
  PV UUID               1aqBph-m45Y-0bs5-FU7t-zmR7-slLE-ItLneR

--- Physical volume --- PV Name /dev/md2 VG Name FF_VG PV Size 1.82 TiB / not usable 2.87 MiB Allocatable yes PE Size 4.00 MiB Total PE 476931 Free PE 158882 Allocated PE 318049 PV UUID Em7a94-ijwz-YdmO-dBCi-e3N6-EzaA-hX50vJ

Run Code Online (Sandbox Code Playgroud) 这是该raid分区的定义和状态:

/dev/md2:
        Version : 1.2
  Creation Time : Thu Jan 12 05:57:20 2012
     Raid Level : raid1
     Array Size : 1953512312 (1863.01 GiB 2000.40 GB)
  Used Dev Size : 1953512312 (1863.01 GiB 2000.40 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

Update Time : Fri Apr 20 09:11:18 2012
      State : clean 
Run Code Online (Sandbox Code Playgroud)

Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0

       Name : mymachine:2  (local to host mymachine)
       UUID : d2d341dc:e3a8c880:3856e567:02f6ab33
     Events : 124244

Number   Major   Minor   RaidDevice State
   3       8        1        0      active sync   /dev/sda1
   2       8       33        1      active sync   /dev/sdc1
Run Code Online (Sandbox Code Playgroud)

And here's lvdisplay output:

--- Logical volume --- LV Name /dev/ROOT_VG/ROOT_LV VG Name ROOT_VG LV UUID GpQjds-24TR-wO9O-sfdx-7IWc-2O5P-goEW05 LV Write Access read/write LV Status available # open 1 LV Size 139.70 GiB Current LE 35762 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0

--- Logical volume --- LV Name /dev/FF_VG/HOME_LV VG Name FF_VG LV UUID 6aZo1j-S55P-werD-xMmz-JopL-dkjd-cAHgdR LV Write Access read/write LV Status available # open 1 LV Size 698.49 GiB Current LE 178814 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:1

--- Logical volume --- LV Name /dev/FF_VG/SWAP_LV VG Name FF_VG LV UUID Ea5Epe-IXCH-Zgr7-dMaL-UCZi-5nsW-SN6GSZ LV Write Access read/write LV Status available # open 2 LV Size 22.35 GiB Current LE 5722 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:2

--- Logical volume --- LV Name /dev/FF_VG/OPT_LV VG Name FF_VG LV UUID buGIdk-pdtG-msUd-1gVn-DECF-qzZR-2oMqRT LV Write Access read/write LV Status available # open 1 LV Size 139.70 GiB Current LE 35762 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:3

--- Logical volume --- LV Name /dev/FF_VG/VMS_LV VG Name FF_VG LV UUID AJkQgB-L0pp-Y3Tk-Rs9e-P4ox-XI0n-1TCxbH LV Write Access read/write LV Status available # open 1 LV Size 102.45 GiB Current LE 26226 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:4

--- Logical volume --- LV Name /dev/FF_VG/DATA_LV VG Name FF_VG LV UUID 4g38kT-ggv8-b12C-WPxF-buhB-zxtj-MGl0TX LV Write Access read/write LV Status available # open 1 LV Size 279.39 GiB Current LE 71525 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:5

Run Code Online (Sandbox Code Playgroud)
这是 mtab:

/dev/mapper/ROOT_VG-ROOT_LV / ext4 rw,commit=60,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
/dev/sdd1 /boot ext2 rw 0 0
/dev/mapper/FF_VG-HOME_LV /home ext4 rw,noatime,commit=60 0 0
/dev/mapper/FF_VG-DATA_LV /data ext4 rw,noatime,commit=60 0 0
/dev/mapper/FF_VG-VMS_LV /vms ext4 rw,noatime,commit=60 0 0
/dev/mapper/FF_VG-OPT_LV /opt ext4 rw,noatime,commit=60 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
/home/myuser/.Private /home/myuser ecryptfs ecryptfs_check_dev_ruid,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs,ecryptfs_sig=9823493038bb4fe3,ecryptfs_fnek_sig=5687e349843fce9cb 0 0
gvfs-fuse-daemon /home/myuser/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=myuser 0 0
Run Code Online (Sandbox Code Playgroud) 这是每个设备上的 hdparm -I:

########### /dev/sdd

/dev/sdd:

ATA device, with non-removable media Model Number: M4-CT256M4SSD2
Serial Number: xxxxxxxxxxxxxxxxxxxxxx Firmware Revision: 0009
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0 Standards: Used: unknown (minor revision code 0x0028) Supported: 9 8 7 6 5 Likely used: 9 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 500118192 Logical Sector size: 512 bytes Physical Sector size: 512 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 244198 MBytes device size with M = 1000*1000: 256060 MBytes (256 GB) cache/buffer size = unknown Form Factor: 2.5 inch Nominal Media Rotation Rate: Solid State Device Capabilities: LBA, IORDY(can be disabled) Queue depth: 32 Standby timer values: spec'd by Standard, with device specific minimum R/W multiple sector transfer: Max = 16 Current = 16 Advanced power management level: 254 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: * SMART feature set Security Mode feature set * Power Management feature set * Write cache * Look-ahead * Host Protected Area feature set * WRITE_BUFFER command * READ_BUFFER command * NOP cmd * DOWNLOAD_MICROCODE * Advanced Power Management feature set SET_MAX security extension * 48-bit Address feature set * Device Configuration Overlay feature set * Mandatory FLUSH_CACHE * FLUSH_CACHE_EXT * SMART error logging * SMART self-test * General Purpose Logging feature set * WRITE_{DMA|MULTIPLE}_FUA_EXT * 64-bit World wide name * IDLE_IMMEDIATE with UNLOAD Write-Read-Verify feature set * WRITE_UNCORRECTABLE_EXT command * {READ,WRITE}_DMA_EXT_GPL commands * Segmented DOWNLOAD_MICROCODE * Gen1 signaling speed (1.5Gb/s) * Gen2 signaling speed (3.0Gb/s) * Gen3 signaling speed (6.0Gb/s) * Native Command Queueing (NCQ) * Host-initiated interface power management * Phy event counters * NCQ priority information DMA Setup Auto-Activate optimization Device-initiated interface power management * Software settings preservation * SMART Command Transport (SCT) feature set * SCT LBA Segment Access (AC2) * SCT Error Recovery Control (AC3) * SCT Features Control (AC4) * SCT Data Tables (AC5) * Data Set Management TRIM supported (limit 8 blocks) * Deterministic read data after TRIM Security: Master password revision code = xxxxx supported not enabled not locked not frozen not expired: security count supported: enhanced erase 2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: xxxxxxxxxxxxxxxxxx NAA : 5 IEEE OUI : xxxxx Unique ID : xxxxxxxx

################### /dev/sda

/dev/sda:

ATA device, with non-removable media Model Number: WDC WD20EARX-00PASB0
Serial Number: xxxxxxxxxxxxxxxxxx Firmware Revision: 51.0AB51 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0 Standards: Supported: 8 7 6 5 Likely used: 8 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 3907029168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 1907729 MBytes device size with M = 1000*1000: 2000398 MBytes (2000 GB) cache/buffer size = unknown Capabilities: LBA, IORDY(can be disabled) Queue depth: 32 Standby timer values: spec'd by Standard, with device specific minimum R/W multiple sector transfer: Max = 16 Current = 0 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: * SMART feature set Security Mode feature set * Power Management feature set * Write cache * Look-ahead * Host Protected Area feature set * WRITE_BUFFER command * READ_BUFFER command * NOP cmd * DOWNLOAD_MICROCODE Power-Up In Standby feature set * SET_FEATURES required to spinup after power up SET_MAX security extension * 48-bit Address feature set * Device Configuration Overlay feature set * Mandatory FLUSH_CACHE * FLUSH_CACHE_EXT * SMART error logging * SMART self-test * General Purpose Logging feature set * 64-bit World wide name * WRITE_UNCORRECTABLE_EXT command * {READ,WRITE}_DMA_EXT_GPL commands * Segmented DOWNLOAD_MICROCODE * Gen1 signaling speed (1.5Gb/s) * Gen2 signaling speed (3.0Gb/s) * Gen3 signaling speed (6.0Gb/s) * Native Command Queueing (NCQ) * Host-initiated interface power management * Phy event counters * NCQ priority information DMA Setup Auto-Activate optimization * Software settings preservation * SMART Command Transport (SCT) feature set * SCT LBA Segment Access (AC2) * SCT Features Control (AC4) * SCT Data Tables (AC5) unknown 206[12] (vendor specific) unknown 206[13] (vendor specific) Security: Master password revision code = xxxxx supported not enabled not locked not frozen not expired: security count supported: enhanced erase 396min for SECURITY ERASE UNIT. 396min for ENHANCED SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: xxxxxxxxxxxxxxxx NAA : x IEEE OUI : xxxxxx Unique ID : xxxxxxxx Checksum: correct

################### /dev/sdc

/dev/sdc:

ATA device, with non-removable media Model Number: WDC WD20EARX-00PASB0
Serial Number: xxxxxxxxx Firmware Revision: 51.0AB51 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0 Standards: Supported: 8 7 6 5 Likely used: 8 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 3907029168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 1907729 MBytes device size with M = 1000*1000: 2000398 MBytes (2000 GB) cache/buffer size = unknown Capabilities: LBA, IORDY(can be disabled) Queue depth: 32 Standby timer values: spec'd by Standard, with device specific minimum R/W multiple sector transfer: Max = 16 Current = 0 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: * SMART feature set Security Mode feature set * Power Management feature set * Write cache * Look-ahead * Host Protected Area feature set * WRITE_BUFFER command * READ_BUFFER command * NOP cmd * DOWNLOAD_MICROCODE Power-Up In Standby feature set * SET_FEATURES required to spinup after power up SET_MAX security extension * 48-bit Address feature set * Device Configuration Overlay feature set * Mandatory FLUSH_CACHE * FLUSH_CACHE_EXT * SMART error logging * SMART self-test * General Purpose Logging feature set * 64-bit World wide name * WRITE_UNCORRECTABLE_EXT command * {READ,WRITE}_DMA_EXT_GPL commands * Segmented DOWNLOAD_MICROCODE * Gen1 signaling speed (1.5Gb/s) * Gen2 signaling speed (3.0Gb/s) * Gen3 signaling speed (6.0Gb/s) * Native Command Queueing (NCQ) * Host-initiated interface power management * Phy event counters * NCQ priority information DMA Setup Auto-Activate optimization * Software settings preservation * SMART Command Transport (SCT) feature set * SCT LBA Segment Access (AC2) * SCT Features Control (AC4) * SCT Data Tables (AC5) unknown 206[12] (vendor specific) unknown 206[13] (vendor specific) Security: Master password revision code = xxxxx supported not enabled not locked not frozen not expired: security count supported: enhanced erase 388min for SECURITY ERASE UNIT. 388min for ENHANCED SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: xxxxxxxxxxxxxxxxx NAA : x IEEE OUI : xxxxxx Unique ID : xxxxxxxxx Checksum: correct

Run Code Online (Sandbox Code Playgroud) 在关闭包括 rsyslogd 在内的大多数东西并运行 iotop 几分钟后,就会出现最热门的话题。注意 I/O 发生的很少,但磁盘仍在旋转:

Total DISK READ:       0.00 B/s | Total DISK WRITE:       0.00 B/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
1207 be/3 root 0.00 B 24.00 K 0.00 % 0.02 % [jbd2/dm-1-8] 436 be/3 root 0.00 B 20.00 K 0.00 % 0.00 % [jbd2/dm-0-8] 1 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % init 2 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [kthreadd] 3 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [ksoftirqd/0] 6 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/0] 7 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [watchdog/0] 8 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/1] 10 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [ksoftirqd/1] 12 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [watchdog/1] 13 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/2] 14 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [kworker/2:0] 15 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [ksoftirqd/2] 16 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [watchdog/2] 17 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/3] 19 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [ksoftirqd/3] 20 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [watchdog/3] 21 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/4] 22 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [kworker/4:0] 23 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [ksoftirqd/4] 24 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [watchdog/4] 25 rt/4 root 0.00 B 0.00 B 0.00 % 0.00 % [migration/5]
Run Code Online (Sandbox Code Playgroud) 最后,这是 block_dump 输出。这是两分钟的时间(大约)......当没有任何事情发生时有暂停,但磁盘仍在旋转:

[74559.007437] flush-252:0(1233): WRITE block 54790360 on dm-0 (8 sectors)
[74562.199606] console-kit-dae(1953): dirtied inode 1573426 (history) on dm-0
[74562.199616] console-kit-dae(1953): dirtied inode 1573426 (history) on dm-0
[74562.199620] console-kit-dae(1953): dirtied inode 1573426 (history) on dm-0
[74562.898697] dmesg(13435): dirtied inode 326099 (out) on tmpfs
[74568.992176] flush-252:0(1233): WRITE block 50331928 on dm-0 (8 sectors)
[74568.992192] flush-252:0(1233): WRITE block 50331936 on dm-0 (8 sectors)
[74568.992200] flush-252:0(1233): WRITE block 50332016 on dm-0 (8 sectors)
[74568.992208] flush-252:0(1233): WRITE block 54525968 on dm-0 (8 sectors)
[74568.992215] flush-252:0(1233): WRITE block 54526080 on dm-0 (8 sectors)
[74568.992222] flush-252:0(1233): WRITE block 54527088 on dm-0 (8 sectors)
[74568.992228] flush-252:0(1233): WRITE block 54593984 on dm-0 (8 sectors)
[74568.992234] flush-252:0(1233): WRITE block 83886088 on dm-0 (8 sectors)
[74568.992240] flush-252:0(1233): WRITE block 83886336 on dm-0 (8 sectors)
[74568.992247] flush-252:0(1233): WRITE block 159385288 on dm-0 (8 sectors)
[74568.992260] flush-252:0(1233): WRITE block 159386960 on dm-0 (8 sectors)
[74568.992266] flush-252:0(1233): WRITE block 192937992 on dm-0 (8 sectors)
[74568.992273] flush-252:0(1233): WRITE block 213910472 on dm-0 (8 sectors)
[74568.992279] flu

小智 3

根据型号 (WDC WD20EARX-00PASB0),您的两个 RAID 磁盘都是“绿色”驱动器,这些驱动器因不断停放和取出驱动器磁头而臭名昭著,不建议用于 RAID 应用程序。

查看 smartctl 的输出或通过图形“磁盘实用程序”查看这些驱动器的 SMART 统计信息。由于其节能特性,它们很容易出现非常高的加载/卸载循环次数。

WD 提供了一个名为“WDIDLE”的实用程序:

http://support.wdc.com/product/download.asp?groupid=609&sid=113

这将允许您更改此属性并减少或禁用自动头部停车,以帮助您恢复理智。

不幸的是,如上所述,不建议在 RAID 应用程序中使用这些驱动器,因此最好的方法是用合适的驱动器替换它们,并在将来避免使用它们。

谷歌搜索“绿色驱动器突袭”,您会发现很多人都遇到这些驱动器的问题。