[7819] in linux-scsi channel archive
Re: SCSI Sync Problem.
daemon@ATHENA.MIT.EDU (Kurt Garloff)
Thu Jan 13 00:48:11 2000
Date: Wed, 12 Jan 2000 21:45:09 +0100
From: Kurt Garloff <garloff@suse.de>
To: Krishna Sreehasam <skrishna@wipro.wipsys.soft.net>
Cc: "Linux SCSI list" <linux-scsi@vger.rutgers.edu>
Message-ID: <20000112214509.A15990@mobil.natlab.research.philips.com>
Mail-Followup-To: Krishna Sreehasam <skrishna@wipro.wipsys.soft.net>,
"Linux SCSI list" <linux-scsi@vger.rutgers.edu>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-md5;
protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu"
In-Reply-To: <Pine.PTX.3.96.1000111093228.11763B-100000@wipro.wipsys.sequent.com>
--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
On Tue, Jan 11, 2000 at 09:48:16AM +0530, Krishna Sreehasam wrote:
> hi,
> I have a problem with syncing of data on to the SCSi disk. I have a
> SCSI disk pack connected to two machines acting as a shared disk. The
> problem is if I write data from one machine and then try to read it from
> the other, the data is not visible. I mounted the partition on machine1
> and then tried to write some data. It was visible then. Then, I unmounted
> it and mounted the same partition from the machine2. The data which
> I wrote was not visible there. I think it is a syncing problem. Any
> ideas,explanations,suggestionsans solutions are extremely welcome. please
> do mail me if you need any extra information.
A setup with two hosts sharing a disk is possible, but be aware of the fact,
that both kernels buffer the data, which they read from disk or which they
want to write to the disk. One kernel can not know, that the other changed
a file.
This is no problem, if you don't have the same partition mounted on both
computers.
If you want to do that, you can mount it ro on both boxes. That won't give
any problems, as one can not change the data behind the other one's back.
If you want to write to a shared partition, things get really complicated.
You can mount a partition rw on one box and ro on another one. The box,
which has the partition mounted ro might crash, but you won't corrupt your
filesystem, at least. This will most possibly happen, if you mount rw on
more than one host.
About the ro/rw setup: For the rw mounting host, everything is fine. What he
can read from disk, is what he expects, because he's the only one changing
data on it. But the other host won't get a consistent view of the
filesystem. He has some data in its cache and reads some more from disk,
while the filesystem was changed in between. Inconsistent data will in the
best case result in wrong data being read and in the worst case, after a lot
of ext2-fs warnings, you might crash your kernel, because not every
inconsistency was being checked against.
Even if it did not cache the data, the data on disk is not guaranteed to be
consistent, unless the other host did flush its buffers (by sync, flushb or
umount) and write everything back to disk. After doing this, the ro host
should tell your ro kernel to forget about his buffers by using flushb.
To conclude: Better only mount it rw at one box an not at all from the
other; then umount it and mount it on the other. This is safe, if you use
flushb before mounting. Or mount it ro twice.
Or: Use the network facilities to share the FS, like NFS or NBD.
Regards,
--
Kurt Garloff <kurt@garloff.de> [Eindhoven, NL]
Physics: Plasma simulations <k.garloff@phys.tue.nl> [TU Eindhoven, NL]
Linux: SCSI, Security <garloff@suse.de> [SuSE Nuernberg, FRG]
(See mail header or public servers for PGP2[RSA] and GPG[DSA] public keys.)
--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE4fOfVxmLh6hyYd04RAaOMAJ9pzcZ/C6Giz+ijdrrccspBokDYmACfampx
5MF9AaRL2kQmpgskL0Y9Fbk=
=ykHw
-----END PGP SIGNATURE-----
--sdtB3X0nJg68CQEu--
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu