NFS FHs, what are they (how are they made?)

2000-04-10 Thread David E. Cross

I was previously under the impression that a NFS FH was basically a
concatenation of a device # and an inode #.  This was shot down earlier today.
The problem was that a disk had failed and we where doing a replacement (the
new disk was not identical to the old, it was substantially larger).  I
proceeded to format it so that the old fstab entry would work with the new
drive (that is the NFS exported partition would be called /dev/wd1s1h --
same device number, no?)  I then used dump/restore to ensure that the 
inode numbers would remain the same.  Making to further changes I shut down
the machine, swapped in the new drive and brought the system back up.  The
new drive was mounted faithfully by the old fstab.  Yet I now see 
"Stale NFS Handle"s on my clients.  What did I do wrong?

--
David Cross   | email: [EMAIL PROTECTED] 
Lab Director  | Rm: 308 Lally Hall
Rensselaer Polytechnic Institute, | Ph: 518.276.2860
Department of Computer Science| Fax: 518.276.4033
I speak only for myself.  | WinNT:Linux::Linux:FreeBSD


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-10 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, "David E. Cross" writes:

>I then used dump/restore to ensure that the 
>inode numbers would remain the same. 

I don't think restore can preserve inode numbers.

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-10 Thread Matthew Dillon

:I was previously under the impression that a NFS FH was basically a
:concatenation of a device # and an inode #.  This was shot down earlier today.
:The problem was that a disk had failed and we where doing a replacement (the
:new disk was not identical to the old, it was substantially larger).  I
:proceeded to format it so that the old fstab entry would work with the new
:drive (that is the NFS exported partition would be called /dev/wd1s1h --
:same device number, no?)  I then used dump/restore to ensure that the 
:inode numbers would remain the same.  Making to further changes I shut down
:the machine, swapped in the new drive and brought the system back up.  The
:new drive was mounted faithfully by the old fstab.  Yet I now see 
:"Stale NFS Handle"s on my clients.  What did I do wrong?
:
:--
:David Cross   | email: [EMAIL PROTECTED] 

It's probably the file iteration number, which the NFS server uses
to detect when a file is destroyed (inode is freed), and then the inode
is reused for something else.

I think this case after dump/restore was written, so restore has no clue
about it.

/usr/include/ufs/ufs/dinode.h, I think it's the 'di_gen' field.

When you newfs a filesystem it's supposed to populate this field with
a random number also.

So short of doing a disk-to-disk image copy, there is no way you would 
be able to maintain disk consistency from NFS's point of view.

-Matt
Matthew Dillon 
<[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-10 Thread Matthew Dillon

:In message <[EMAIL PROTECTED]>, "David E. Cross" writes:
:
:>I then used dump/restore to ensure that the 
:>inode numbers would remain the same. 
:
:I don't think restore can preserve inode numbers.
:
:--
:Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
:[EMAIL PROTECTED] | TCP/IP since RFC 956

Yup, that too.  The manual page even talks about it in the 
second-to-last paragraph.

-Matt
Matthew Dillon 
<[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-10 Thread David E. Cross

D'oh.  My bad.  I think I am remembering this behaviour from SunOS days
past.

Oh Well.

--
David Cross   | email: [EMAIL PROTECTED] 
Lab Director  | Rm: 308 Lally Hall
Rensselaer Polytechnic Institute, | Ph: 518.276.2860
Department of Computer Science| Fax: 518.276.4033
I speak only for myself.  | WinNT:Linux::Linux:FreeBSD


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-10 Thread Mark Newton

On Mon, Apr 10, 2000 at 04:39:28PM -0400, David E. Cross wrote:

 > The new drive was mounted faithfully by the old fstab.  Yet I now see 
 > "Stale NFS Handle"s on my clients.  What did I do wrong?

restore(8) doesn't preserve inode allocations:

 A level zero dump must be done after a full restore.  Because restore
 runs in user code, it has no control over inode allocation; thus a full
 dump must be done to get a new set of directories reflecting the new in-
 ode numbering, even though the contents of the files is unchanged.

I believe FH numbering is a bit more complicated than dev/inode concatenation
anyway, but the lack of inode number preservation is probably what bit you
this time.

- mark

-- 
Mark Newton   Email:  [EMAIL PROTECTED] (W)
Network Engineer  Email:  [EMAIL PROTECTED]  (H)
Internode Systems Pty Ltd Desk:   +61-8-82232999
"Network Man" - Anagram of "Mark Newton"  Mobile: +61-416-202-223


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: NFS FHs, what are they (how are they made?)

2000-04-11 Thread Sheldon Hearn



On Mon, 10 Apr 2000 13:46:15 MST, Matthew Dillon wrote:

> When you newfs a filesystem it's supposed to populate this field with
> a random number also.

The 4.4BSD book says that the value of this field (and thus of the FH's
filehandle) is time-based.  Is this different in FreeBSD?

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message