Guest Posted May 21, 2019 Share Posted May 21, 2019 (edited) Hi all. When I reboot my server all four of my drives come up with disabled write cache. They're the WD RE 2TB ones. Running hdparm -W 1 /dev/sd<value> fixes the problem but only until the next reboot. Do I just set those lines in the go file? Won't the values change across reboots? How do I get them to enable every time I start up the server? Thanks. derrickserver-diagnostics-20190521-1151.zip Edited May 23, 2019 by Guest Quote Link to comment
Guest Posted May 21, 2019 Share Posted May 21, 2019 16 minutes ago, BRiT said: Look into User Scripts plugin, create a new one, and set it to start at Array Startup. What about the changing values for /dev/sda, /dev/sdb...? Quote Link to comment
itimpi Posted May 21, 2019 Share Posted May 21, 2019 15 minutes ago, ideaman924 said: What about the changing values for /dev/sda, /dev/sdb...? Instead of using the /dev/sdX way to specify the drive you could instead use the /dev/disk/by-id method as that never changes across boots.. Opening a terminal window and doing ls /dev/disk/by-id/ would allow you to see all the id's - you should be able to identify the one you want by the serial number. 1 Quote Link to comment
Guest Posted May 23, 2019 Share Posted May 23, 2019 On 5/21/2019 at 8:30 PM, itimpi said: Instead of using the /dev/sdX way to specify the drive you could instead use the /dev/disk/by-id method as that never changes across boots.. Opening a terminal window and doing ls /dev/disk/by-id/ would allow you to see all the id's - you should be able to identify the one you want by the serial number. Thank you for the tip! Script works like a charm. Quote Link to comment
Guest Posted May 23, 2019 Share Posted May 23, 2019 For anyone who needs the script here it is: #!/bin/bash # Drives declare -a StringArray=("ata-WDC_WD2003FYYS-70W080_WJUN0123456" "DRIVE2" "DRIVE3" "DRIVE4") # Show status echo "Current drive status: " for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done # Enable write caching for drive in ${StringArray[@]}; do hdparm -W 1 /dev/disk/by-id/$drive done # Show status again echo "Finished running, check if the write cache was enabled!" for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done Replace the serial codes in the StringArray and you should be good to go! Pop it in User Scripts. Quote Link to comment
raidserver Posted July 14, 2019 Share Posted July 14, 2019 On 5/23/2019 at 1:58 AM, ideaman924 said: For anyone who needs the script here it is: #!/bin/bash # Drives declare -a StringArray=("ata-WDC_WD2003FYYS-70W080_WJUN0123456" "DRIVE2" "DRIVE3" "DRIVE4") # Show status echo "Current drive status: " for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done # Enable write caching for drive in ${StringArray[@]}; do hdparm -W 1 /dev/disk/by-id/$drive done # Show status again echo "Finished running, check if the write cache was enabled!" for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done Replace the serial codes in the StringArray and you should be good to go! Pop it in User Scripts. Thanks Enabling write cache manually worked but the changes were not persistent through reboots on AMD server. Working perfectly now. Quote Link to comment
DaMAN Posted August 24, 2019 Share Posted August 24, 2019 Gutted didnt work for me, still showing as disabled when I run it!, crazy thing is, copying between the same drives outside of the array speeds hit max, within...40mb :(:(:( Quote Link to comment
DaMAN Posted August 25, 2019 Share Posted August 25, 2019 Ok, googlefu...changed the NCQ of the array drives from 1 to 31 and speed has increased dramatically, doing a clear on 2 drives, gone from 38mb/s to 130mb/s as soon as I made the change, I am a happy camper!, I was about to hit the go button on another HBA controller! Command to change your NCQ level is echo 31 > /sys/block/sdX/device/queue_depth sdX is your device, echo XX is the level you want to change to Quote Link to comment
scubieman Posted April 6, 2020 Share Posted April 6, 2020 On 5/22/2019 at 7:58 PM, ideaman924 said: For anyone who needs the script here it is: #!/bin/bash # Drives declare -a StringArray=("ata-WDC_WD2003FYYS-70W080_WJUN0123456" "DRIVE2" "DRIVE3" "DRIVE4") # Show status echo "Current drive status: " for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done # Enable write caching for drive in ${StringArray[@]}; do hdparm -W 1 /dev/disk/by-id/$drive done # Show status again echo "Finished running, check if the write cache was enabled!" for drive in ${StringArray[@]}; do hdparm -W /dev/disk/by-id/$drive done Replace the serial codes in the StringArray and you should be good to go! Pop it in User Scripts. This still valid? Quote Link to comment
Synthez542 Posted April 6, 2020 Share Posted April 6, 2020 Hey All, I'm having the same issue as others that i have 8 total drives - 3 Are new drives with write caching enabled, 5 are previously used in a windows adaptec controller environment that wont enable write caching. I've tried numerous hdparm ways and the script that was provided above, but i'm still unable to get it to set to be enabled at all. Just keeps showing setting drive write-caching to 1 (on) write-caching = 0 (off) Then i hdparm -W on the drive and shows write-caching = 0 (off) I've also contacted WD Support as these are WD Red/White drives and they're unable to assist as they only support Windows/MacOS, so not entirely sure as to what to do/try now. Any assistance would be greatly appreciated on this. Quote Link to comment
Guest Posted April 7, 2020 Share Posted April 7, 2020 22 hours ago, scubieman said: This still valid? Yes, I'm still using it on my server and it works perfectly :) 19 hours ago, Synthez542 said: Hey All, I'm having the same issue as others that i have 8 total drives - 3 Are new drives with write caching enabled, 5 are previously used in a windows adaptec controller environment that wont enable write caching. I've tried numerous hdparm ways and the script that was provided above, but i'm still unable to get it to set to be enabled at all. Just keeps showing setting drive write-caching to 1 (on) write-caching = 0 (off) Then i hdparm -W on the drive and shows write-caching = 0 (off) I've also contacted WD Support as these are WD Red/White drives and they're unable to assist as they only support Windows/MacOS, so not entirely sure as to what to do/try now. Any assistance would be greatly appreciated on this. Maybe the drives do not support write caching under Linux? Wild guess Quote Link to comment
Tigerherz Posted August 16, 2020 Share Posted August 16, 2020 My settings in user scripts: #!/bin/bash # Show status echo "Current drive status: " hdparm -W /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] # Enable write caching hdparm -W 1 /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] # Show status again echo "Finished running, check if the write cache was enabled!" hdparm -W /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] The letter for hdd. Hdd's : WD red and white in a netapp disk shelf Work for me Greets Quote Link to comment
Guest Posted August 17, 2020 Share Posted August 17, 2020 7 hours ago, Tigerherz said: My settings in user scripts: #!/bin/bash # Show status echo "Current drive status: " hdparm -W /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] # Enable write caching hdparm -W 1 /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] # Show status again echo "Finished running, check if the write cache was enabled!" hdparm -W /dev/sd[b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q] The letter for hdd. Hdd's : WD red and white in a netapp disk shelf Work for me Greets I don't recommend this because drive mappings could change across reboots. It's best to use the serial identifier of the drive to set the write cache bit. Quote Link to comment
Tigerherz Posted August 17, 2020 Share Posted August 17, 2020 @ideaman924 you're right, if you have 2 or 3 or more hdd's which lose the write cache it's better with serial identifer. In my server all hdd lost write cache at the new start. i'm not a scripter but declare -a StringArray=("ata-WDC_WD2003FYYS-70W080_WJUN0123456" "DRIVE2" "DRIVE3" "DRIVE4") will not work. I am new in linux. Must ata before each serial id? I've tried it but it doesn't work. Greets from Germany Quote Link to comment
Guest Posted August 18, 2020 Share Posted August 18, 2020 9 hours ago, Tigerherz said: ... declare -a StringArray=("ata-WDC_WD2003FYYS-70W080_WJUN0123456" "DRIVE2" "DRIVE3" "DRIVE4") will not work. ... Sorry, the identifiers I put here are placeholders because I didn't want to post my drive serial #s. So it would look something like this declare -a StringArray=("serial#1" "serial#2" "serial#3" "serial#4") To get your own drive serial #s you run the following command: On 5/21/2019 at 9:30 PM, itimpi said: Instead of using the /dev/sdX way to specify the drive you could instead use the /dev/disk/by-id method as that never changes across boots.. Opening a terminal window and doing ls /dev/disk/by-id/ would allow you to see all the id's - you should be able to identify the one you want by the serial number. This should show you all the drives attached to your server. Find the ones you want to enable the write cache for and them replace them in the line above. Hope this helps. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.