From owner-freebsd-scsi@FreeBSD.ORG Tue Sep 16 14:09:10 2014 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7975E496 for ; Tue, 16 Sep 2014 14:09:10 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BF9827C for ; Tue, 16 Sep 2014 14:09:10 +0000 (UTC) Received: from delphij-macbook.local (unknown [1.202.68.57]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 6DC6D1571A; Tue, 16 Sep 2014 07:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1410876550; x=1410890950; bh=nCnOE5kQyoqDo6HjsuKxFQCj2+yuBikw7zmP8Ym7FgE=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=SllfeERpeUIyJRlY2472OnGTk1rAMECnXhykqgmfF9Ql1+8dEYjdGqEUsEc6hJBgM NNEiUdun7O/yiiASQ5k3LK1GY7FfacpkIrFyAgb74jOJ7cQLHAJohIwrHmzLdkYGgu Gtib/lm6Xgq1Ipztrt2nepkPu/ry0BbU7+Men6kc= Message-ID: <54184484.1070304@delphij.net> Date: Tue, 16 Sep 2014 22:09:08 +0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Xu Zhe , freebsd-scsi@freebsd.org Subject: Re: How to disable hard disk write cache? References: <541804B0.7070407@gmail.com> In-Reply-To: <541804B0.7070407@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 14:09:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 9/16/14 5:36 PM, Xu Zhe wrote: > Hi, all, > > Does anyone knows how to disable write cache of hard disk? > > I have found some hints here at Freebsd website: > > https://www.freebsd.org/doc/handbook/configtuning-disk.html > > However, this seems only work for ATA devices, what about SAS/NLSAS > devices (Meanwhile, it seems that there is no such sysctl in latest > Freebsd release, which is 10.0)? > > Any hints are welcomed! Why do you want to disable write cache in the first place? It's not needed for most configurations nowadays. Modern SATA/SAS/SCSI devices usually comes with the capability of tagged commands, allowing the OS to know when a write buffer is on stable storage. With this, file systems can easily implement the right semantics and recover from e.g. a power outage, etc. Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUGESDAAoJEJW2GBstM+ns2R4QAKKL2+TKfTaFQOWk4/jOKzdD 6yANm2ZYI3reChuUmbYjjchfce6nGcxz7EPjTOfBLj37p8bZFaW91e/ayviY9pNL QktP0hgTZp4EFLJSlPfqjx6f8aU2gJ640b/cKbIQkaxHWRLoHea8GJ2XhyVS9JfK o8aM+VPyxRrTRH0e2BQ8t0DMJohCrVNZ0fYSAKToDqI2RpcmOumYA4yChXb0hgvc Rz3PGZth19E4rxdNtOM0Ap/l4PL3+lInIlU8kPdwUaqvT11mxjUM+6zkF904VtqL 5xoURW/j9MAbFl6ozJJKnkfd20lCT3TfyQUC7weDOT8Jz78/8Sx2qy6ilkQCe0ZI AWV0hpoQPk2bzFxwB7wr9MiVbXJcpAHfHFcKTbLWY4NzY/8RknDt5dNsqsntlDww dSb1xRLdPQFBh7NrZA1GAfxXdfK8GNBONF+cRKutvFAlIzq0kywaa5baN1ZwLdU2 Kz3LJ0SLQMNEFioES+9j94fSeiW9LY9OJlI9EAjf2gys4WFeLkTgOgdBhvY935Mi j6FHk4xZmgKOS2s0c7UOYMjj6OgU1or4t2awMF/ObQwd8cmCT5abeGUdtrDGdCZu am/9nbCfR6FHhm5k90t+yCzl/hPf7dqVoz41bnP6+dD5q5zwxOhOc/SEiCJKCH3L iQoPiJfxH7JGZdCw/Vz+ =QSHo -----END PGP SIGNATURE-----