2010-01-13 22:14:51

by Erik Bryer

[permalink] [raw]
Subject: [NFS] how to display fsid on client?

I'm using (client and server) CentOS 5 (2.6.18). If I set the fsid to a small integer in the server's exports files (e.g. 1, 19 or 0x10, 0xffff and so on), then exportfs -arf, then unmount and mount on the client, I get the same device number from running ``stat'' on the mount point. It goes like this (client=10.10.99.102):
root@server# cat /etc/exports
/home 10.10.99.102(ro,sync,no_root_squash)
root@client# cat /etc/fstab | grep server
server:/home /n/server/home nfs hard,intr,bg,sync,ro 0 0
root@client# mount /n/server/home
root@client# stat /n/server/home
File: `/n/server/home'
Size: 4096 Blocks: 16 IO Block: 4096 directory
Device: 31h/49d Inode: 2 Links: 8
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 301/ users)
Access: 2010-01-08 14:15:43.000000000 -0500
Modify: 2009-03-09 18:42:01.000000000 -0400
Change: 2009-11-23 19:45:51.000000000 -0500
root@server# cat /etc/exports
/home 10.10.99.102(ro,sync,no_root_squash,sid=0x19)
root@server# exportfs -arf
root@client# umount /n/server/home
root@client# mount /n/server/home
root@client# stat /n/server/home
[ same information as above, specifically the same Device # ]

I've tried this many times, read the faq, and so on. Do I misunderstand? Is the st_dev, "ID of device containing file", as read on the client not going to be the same as what is forced by "fsid=n" in the exports file?




------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs



2010-01-13 23:47:24

by Wendy Cheng

[permalink] [raw]
Subject: Re: [NFS] how to display fsid on client?

Erik Bryer wrote:
>
> I've tried this many times, read the faq, and so on. Do I misunderstand? Is the st_dev, "ID of device containing file", as read on the client not going to be the same as what is forced by "fsid=n" in the exports file?
>
>
No, they are *different* IDs. The Linux NFS server's fsid is for export
purpose (used to construct NFS file handler). It has *nothing* to do
with "st_dev" obtained from "stat" system call (that is used by Linux
VFS layer).

To display the linux (nfs) server fsid on client, the easiest way (I
think) is probably using some network protocol analyzers that know how
to interpret Linux server's file handler (did you try "ethereal" yet ?).
If you decode the server's file handler, the fsid you're look for should
be there.

-- Wendy


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs