Disable read/write caching to disk?

Scott Long scottl at samsco.org
Thu May 26 11:05:35 PDT 2005


Eric Anderson wrote:

> Bjoern Koenig wrote:
> 
>> Bjoern Koenig wrote:
>>
>>> Eric Anderson wrote:
>>>
>>>> Is it possible to disable all read and write caching to a disk?
>>>
>>>
>>>
>>> You can disable write the cache by adding the line
>>>
>>>   hw.ata.wc="0"
>>
>>
>>
>> I assumed that you use ATA. If you use SCSI devices then read at least 
>> the manpages da(4) and camcontrol(8).
> 
> 
> Thanks.. I've just read (quickly) both man pages.  It seems as though 
> you are suggesting disabling the physical disk caching, which should not 
> make a difference in my case.  The disk would report whatever it needs 
> to report to either host, and those should be in sync.
> 
> When I mount the filesystem on host B ro, it shows me the filesystem as 
> of the time that I mounted it ro.  Any subsequent changes on host A 
> (which has it mounted rw) are not seem on host B unless I unmount and 
> mount again on host B.  This seems like a FreeBSD feature and not a 
> general scsi feature.
> 
> Eric
> 
> 
> 
> 

You simply cannot disable OS caching in FreeBSD.  It's a fundamental 
part of the block I/O and VM layers.  There are filesystems like GFS
that deal with the issue of directly connecting more than one computer
to a disk or set of disks, and there are distributed filesystems like
AFS and Coda that deal with making the storage on multiple computers
appear as a single network filesystem.  Unfortunately, no port of GFS
has been done yet, and I estimate that such a port would take 4-6 months.

Scott


More information about the freebsd-current mailing list