Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2002 08:45:18 -0600
From:      "Mike Meyer" <mwm-dated-1015253118.107808@mired.org>
To:        abhijit vaidya <sherlockabhi@yahoo.com>
Cc:        questions@freebsd.org
Subject:   Re: SCSI sharing
Message-ID:  <15484.61694.274652.593888@guru.mired.org>
In-Reply-To: <34343174@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
abhijit vaidya <sherlockabhi@yahoo.com> types:
> --0-268752901-1014793754=:11089
> Content-Type: text/plain; charset=us-ascii

First, please don't send HTML messages to this list, as many people
ignore them. I'm also less likely to answer such questions.


>    I have 1 SCSI and 2 adapters that support sharing of SCSI. I have shared the disk among 2 computers. The disk has two partitions which are accessed as /dev/da0s1e and /dev/da0s2e. When I mount /dev/da0s1e on one of the machines and write some data onto it, it writes the data onto it. Even ls -l shows correct size of file written. But when the same partition is mounted on other machine, even after doing fsck it doesn't show any data in the same file. It shows size of fie to be 0 bytes. Please tell me some way of doing this so that file written by one machine onto partition /dev/da0s1e is available in consistent manner to the other machine.

The above single line violates the RFCs for electronic mail, being
over the 998 character limit specified in section 2.2.1 of RFC
2822. That same paragraph recommends that each line be no longer than
78 characters, not counting the CRLF that terminates the line.

To avoid this in the future, please put real newlines in your mail
every 65 or so characters.

Now, to deal with your problem. You're getting bitten by the buffer
cache on the two machines. Let's call them W and R - the writer and
reader.

First, what you see when you do an ls -l on W may not be what's on the
disk, but only what's waiting to be written to the disk. You can solve
this problem by mounting the file system with the "sync" option
enabled. If you have softupdates turned on on this file system, turn
it off, as it may disable the sync flag. From what the mount man page
says, doing this on both systems may solve the problem. Let's assume
it doesn't.

In this case, the problem is the buffer cache on R.  What you're being
shown may not be what's on the disk, but what was on the disk the last
time the machine read the blocks in question.  To make changes made
from machine W visible on machine R, you must at least unmount the
file system on machine R, and then remount it. Since FreeBSD marks
what was last in "free" pages, even that may not be sufficient, and
you may need to reboot machine R.

Note that mounting a file system writable on both machines is
hazardous to the health of the file system. I hope you have two
partitions because one is for communicating from W to R, and the other
from R to W.

Final help: if you don't get a working solution here, ask on
-hackers. Someone there may be able to help. If that fails, try -scsi,
but not before -hackers has failed. The people on -scsi collectively
know more about scsi, but collectively less about the system.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15484.61694.274652.593888>