Sata drives on one system are set with write cache off?

Status
Not open for further replies.

Arch Willingham

Dabbler
Joined
Feb 21, 2017
Messages
27
I've struggled to figure out why one system out of six Freenas setups is extremly slow. In comparignto outher systems, I finally noticed one thing.

If I issue the command "camcontrol identify ada4 -v", I get the info shown below. The one big difference between this and other systems is that it says the drive has its write cache turned off:

Feature Support Enabled Value Vendor
write cache yes no


Every other system has it turned on (I didn't have to do it...they just appeared that way).

Note the drives are set up in raidz2-0. The dives are all connected direct to teh motherboard's sata ports and are set to AHCI in the BIOS. The system is a Supermicro X8DTN.

How do I turn the write cache on? I've read some on running "camcontrol mode ada4 -m 0x08" to verify the cache but it always says "camcontrol: error sending mode sense command"


Thanks!





error = 0x00, sector_count = 0x0000, device = 0x40, status = 0x50
pass8: <WDC WD40EFRX-68WT0N0 80.00A80> ACS-2 ATA SATA 3.x device
pass8: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)

protocol ATA/ATAPI-9 SATA 3.x
device model WDC WD40EFRX-68WT0N0
firmware revision 80.00A80
serial number WD-WCC4E1391855
WWN 50014ee209f7bd3a
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 4096, offset 0
LBA supported 268435455 sectors
LBA48 supported 7814037168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6
media RPM 5400

Feature Support Enabled Value Vendor
read ahead yes yes
write cache yes no
flush cache yes yes
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
`camcontrol mode` works only for SCSI disks. For ATA/SATA disks you may set such loader tunable for OS to do it on boot: kern.cam.ada.write_cache=1.
 

Vito Reiter

Wise in the Ways of Science
Joined
Jan 18, 2017
Messages
232
Write cache should be enabled by default, @mav@ 's method will work, but even though unlikely I would double check AHCI settings on your board as well. Also, what FreeNAS build are you using? As that could affect it too.
 

Arch Willingham

Dabbler
Joined
Feb 21, 2017
Messages
27
Write cache should be enabled by default, @mav@ 's method will work, but even though unlikely I would double check AHCI settings on your board as well. Also, what FreeNAS build are you using? As that could affect it too.

I did what both you and @mav said and event I extended it:
I added the following :
kern.cam.ada.write_cache=1
kern.cam.ada.0.write_cache=1
kern.cam.ada.1.write_cache=1
kern.cam.ada.2.write_cache=1
kern.cam.ada.3.write_cache=1
kern.cam.ada.4.write_cache=1
kern.cam.ada.5.write_cache=1

When I run "sysctl -a | grep kern.cam.ada.4.write_cache" I get "kern.cam.ada.4.write_cache: 1"
When I run "sysctl -a | grep kern.cam.ada.write_cache" I get "kern.cam.ada.write_cache: 1"

Seems ok but if I run "camcontrol identify ada4 -v" it still says the cache is off.

I checked the BIOS and motherboard does not have any way to change it.

System Information
Hostname freenas
Build FreeNAS-11-MASTER-201705010408 (8f4a292)
Platform Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
Memory 49105MB
System Time Wed May 03 13:52:42 EDT 2017
Uptime 1:52PM up 9 mins, 1 users
Load Average 0.15, 0.48, 0.42


I don't have anyway of checking if this existed when it was 9.x but it was slow back then too.
 

Vito Reiter

Wise in the Ways of Science
Joined
Jan 18, 2017
Messages
232
I've got various desktop drives of all kinds and sizes and every single one is turned on. I assume you rebooted due to the fact you mentioned BIOS (Hopefully after you placed the tunables in)

kern.cam.ada.write_cache=1
kern.cam.ada.0.write_cache=1
kern.cam.ada.1.write_cache=1
kern.cam.ada.2.write_cache=1
kern.cam.ada.3.write_cache=1
kern.cam.ada.4.write_cache=1
kern.cam.ada.5.write_cache=1

Take those and try to edit /boot/loader.conf and add them to the end of that file. Make sure you back that file up first as I'm not sure if this can make it unbootable or not.

Edit: I have autotune enabled as well under System > Advanced
 

Arch Willingham

Dabbler
Joined
Feb 21, 2017
Messages
27
I've got various desktop drives of all kinds and sizes and every single one is turned on. I assume you rebooted due to the fact you mentioned BIOS (Hopefully after you placed the tunables in)



Take those and try to edit /boot/loader.conf and add them to the end of that file. Make sure you back that file up first as I'm not sure if this can make it unbootable or not.

Edit: I have autotune enabled as well under System > Advanced

That time I set the following in the /boot/loader.conf
kern.cam.ada.write_cache=1
kern.cam.ada.0.write_cache=1
kern.cam.ada.1.write_cache=1
kern.cam.ada.2.write_cache=1
kern.cam.ada.3.write_cache=1
kern.cam.ada.4.write_cache=1
kern.cam.ada.5.write_cache=1

I then enabled autotune under System > Advanced

I rebooted and the write cache is still off for the six drives.
 
Joined
Oct 19, 2016
Messages
5
That time I set the following in the /boot/loader.conf
kern.cam.ada.write_cache=1
kern.cam.ada.0.write_cache=1
kern.cam.ada.1.write_cache=1
kern.cam.ada.2.write_cache=1
kern.cam.ada.3.write_cache=1
kern.cam.ada.4.write_cache=1
kern.cam.ada.5.write_cache=1

I then enabled autotune under System > Advanced

I rebooted and the write cache is still off for the six drives.

Hey @Arch Willingham, have you managed to find a solution for this?
I also have a system with RAIDZ-2 pool but it has only one disk with write cache disabled so it's affecting the performance of the whole pool.
 
Status
Not open for further replies.
Top