DragonFly BSD
DragonFly users List (threaded) for 2005-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Mounting nfs in DFly versus linux


From: Oliver Fromme <check+ib8eb600rsu6u7te@xxxxxxxxxx>
Date: 01 Feb 2005 12:58:10 GMT

walt <wa1ter@xxxxxxxxxxxxx> wrote:
 > A little background first:  when I nfs-mount a read-only fs in linux,
 > 'mount' will wrongly list the mount as read-write unless I specifically
 > use the '-o ro' flag when doing the mount.  Userland then fails when
 > attempting inappropriate writes to that read-only fs.

There are two different things involved:  The export from
the NFS server, and the NFS mount on the client.  Both can
be specified to be read-only (independently from each other),
and if either one (or both) is read-only, then you cannot
write to the NFS filesystem.  You can only write to file
system if _both_ allow read-write.

1.  If an NFS server exports a file system read-only (i.e.
    "-ro" in /etc/exports), it doesn't matter whether you
    mount it read-only on the client.  The NFS server will
    always deny write requests.

2.  If you mount an NFS filesystem read-only ("mount -o ro"),
    it doesn't matter whether the server exports it read-only
    or not.  All write attempts will be denied locally on the
    client.

In both cases, write attempts will return the errno EROFS and
print "Read-only file system".

 > In DFly (I just noticed) 'mount' does not tell me whether a fs is
 > mounted rw or ro.

It does.  However, it does not tell you whether the FS is
exported read-only from the server.  (In fact, an NFS client
doesn't need to know that at all.)

 > My question is:  is the whole mechanism different between the two
 > OS's for determining the write status of a mounted fs?

I think it's not different.

 > And for nfs in particular, does the nfs server tell the client
 > system about read-write status at mount-time -- i.e. is there
 > any reason that the read-write status should ever be ambiguous?

No, AFAIK the NFS server doesn't tell at mount-time, and in
theory the server could export _some_ parts of the FS read-
only and other parts of it read+write (DF and FreeBSD don't
support that, though), so there is no simple way to tell
the client about the read/write status of the exported FS.

In practice, I recommend that read-only exports should also
be mounted read-only on the client, so you will see the
status in the output from mount(8) explicitely.

Best regards
   Oliver

-- 
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]