coreylane Posted December 11, 2021 Share Posted December 11, 2021 (edited) I recently swapped out old Marvell 88SE9215 SATA controllers and replaced with Supermicro AOC-S3008L-L8E SAS3 (based on Broadcom/LSI SAS 9300-8i / SAS 3008). I'm seeing much better IO performance overall with the new controller and everything is working, but I have noticed one change in behavior since swapping. I can't seem to get the write cache setting to persist reboots on disks connected to the new controller. I use the hdparm command to make the change successfully, but after a reboot it just goes back to being disabled. Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on disk1 Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on disk2 Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on disk3 Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on disk4 Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on disk5 Dec 10 20:16:10 darktower root: Fix Common Problems: Warning: Write Cache is disabled on cache2 Should I add the hdparm commands as a startup script? Seems a bit hacky... Do I need to upgrade my controller firmware? I haven't bothered since everything has been working fine. root@darktower:~# hdparm -W 1 /dev/sdb /dev/sdb: setting drive write-caching to 1 (on) write-caching = 1 (on) Thanks! Edited December 11, 2021 by ceddybu Quote Link to comment
Squid Posted December 11, 2021 Share Posted December 11, 2021 Just apply it via a user script. Some drives won't "stick" that setting. 1 Quote Link to comment
Vinster411 Posted February 12, 2022 Share Posted February 12, 2022 I'm having this exact same issue. but for me (and assume everyone) the device allocation is always changing. Sometime the drive is sdc and then on the next reboot it's sdm. Is there a way to check if the drive has it disabled before enabling it? I only have this issue on mechanical drives, the ssd/nvme's don't have the issue. I just don't want to have the script blindly running for devices that don't exist or on ssd/nvme's Vin Quote Link to comment
brucejobs Posted July 23, 2023 Share Posted July 23, 2023 (edited) On 2/13/2022 at 12:18 AM, Vinster411 said: I'm having this exact same issue. but for me (and assume everyone) the device allocation is always changing. Sometime the drive is sdc and then on the next reboot it's sdm. Is there a way to check if the drive has it disabled before enabling it? I only have this issue on mechanical drives, the ssd/nvme's don't have the issue. I just don't want to have the script blindly running for devices that don't exist or on ssd/nvme's Vin I also had same challenge. Solved it for me, but... !!! USE AT YOUR OWN RISK !!! It will check all disks in your system ignoring any USB disk which may happen to be your OS, enabling write-cache. Add to start up scripts as others have mentioned. #!/bin/bash # The list of devices to check and enable write cache on devices="/dev/sd[a-z]" for device in $devices do echo "Checking device $device" if [ -e $device ]; then is_removable=$(lsblk -d -no RM $device) if [ $is_removable -eq 1 ]; then echo "This is a USB device, possibly the UNRAID OS disk. It is not recommended to enable write cache." continue fi write_cache_status=$(hdparm -W $device | tr '\n' ' ' | awk -F'[()]' '{print $2}') echo "Write cache status: $write_cache_status" if [ "$write_cache_status" == "off" ]; then echo -n "Enabling write cache on $device... " hdparm -W1 $device if [ $? -ne 0 ]; then echo "Failed" else echo "Done" fi else echo "Write cache already enabled on $device" fi else echo "Device $device does not exist" fi echo "" # Add an empty line for formatting done No responsibility taken for lost data, crashed system etc. Output if ran manually Checking device /dev/sda This is a USB device, possibly the UNRAID OS disk. It is not recommended to enable write cache. Checking device /dev/sdb Write cache status: on Write cache already enabled on /dev/sdb Checking device /dev/sdc Write cache status: on Write cache already enabled on /dev/sdc Checking device /dev/sdd Write cache status: on Write cache already enabled on /dev/sdd Checking device /dev/sde Write cache status: on Write cache already enabled on /dev/sde Edited July 23, 2023 by brucejobs output display added 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.