Skip to contentSkip to conversation

fsid syntax

DISCUSSION Bernd Schubert 6 participants 11 messages Aug 7, 2002 – Aug 8, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

probably on Friday I need to make use of setting the fsid in the /etc/exports.

Since I can't find the syntax in the exports manpage (manpage was last time changed on Januar, while the fsid-feature seems to be become added to cvs on February).

So I'd like to know the exact sytanx, is for example:

/testdir testnode(fsid=/dev/sdb)

correct to make 'testnode' believing that sdb is exported?

Thanks in advance,

Bernd

Signature · 15 lines
Bernd Schubert
Physikalisch Chemisches Institut
Abt. Theoretische Chemie
INF 229, 69120 Heidelberg
Tel.: 06221/54-5210
e-mail: 	bernd (dot) schubert (at) pci (dot) uni-heidelberg (dot) de 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Bernd Schubert <[email protected]> writes:

> Hi, probably on Friday I need to make use of setting the fsid > in the /etc/exports.

> Since I can't find the syntax in the exports manpage (manpage > was last time changed on Januar, while the fsid-feature seems > to be become added to cvs on February).

> So I'd like to know the exact sytanx, is for example:

> /testdir testnode(fsid=/dev/sdb)

The fsid is a number, not a device. In principle you can set it to any number you like as long as you keep it consistent over reboots.

One suggestion is to use the device major/minor number in the format minor + (major * 256). (That's what nfsd uses by default for block devices.)

Cheers,
Trond

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw
Quoted 15 lines · Trond Myklebust
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Bernd Schubert <[email protected]> writes:

> Hi, probably on Friday I need to make use of setting the fsid > in the /etc/exports.
>
> Since I can't find the syntax in the exports manpage (manpage > was last time changed on Januar, while the fsid-feature seems > to be become added to cvs on February).
>
> So I'd like to know the exact sytanx, is for example:
>
> /testdir testnode(fsid=/dev/sdb)

The fsid is a number, not a device. In principle you can set it to any number you like as long as you keep it consistent over reboots.

Quoted 8 lines

One suggestion is to use the device major/minor number in the format minor + (major * 256). (That's what nfsd uses by default for block devices.)

Cheers,
Trond

Uh, good that I asked for this, so I was completely wrong.

Is there a way to get the current fsid (after a reboot on Friday the fsid will change and I don't want to reboot our clients) ? Or is it simply the fsid of e.g. /dev/sdb, so that I can get it with statfs() ?

Thanks for your help,

Bernd

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#3 lore raw
Quoted 2 lines · Bernd Schubert

Is there a way to get the current fsid (after a reboot on Friday the fsid will change and I don't want to reboot our clients) ?

One of the first lines of the output from "dumpe2fs /dev/sdbx" provided that you use ext2/ext3 on that partition.

Signature · 16 lines
Bogdan Costescu

IWR - Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen
Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY
Telephone: +49 6221 54 8869, Telefax: +49 6221 54 8868
E-mail: [email protected]



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#4 lore raw
In reply to Bernd Schubert
Quoted 13 lines · On Wednesday August 7, [email protected] wrote:
Quoted 11 lines · Trond Myklebust

The fsid is a number, not a device. In principle you can set it to any number you like as long as you keep it consistent over reboots.

One suggestion is to use the device major/minor number in the format minor + (major * 256). (That's what nfsd uses by default for block devices.)

Cheers,
Trond

Quoted 7 lines

Uh, good that I asked for this, so I was completely wrong.

Is there a way to get the current fsid (after a reboot on Friday the fsid will change and I don't want to reboot our clients) ? Or is it simply the fsid of e.g. /dev/sdb, so that I can get it with statfs() ?

Thanks for your help,

Sorry, you cannot do that. The filehandles created with fsid=foo are different from any filehandle created without fsid=.

If you want to change the device on the server what you need to do is:

1/ well in advance, add an 'fsid=42'(*) export option.
Clients using old file handles will still work. Clients that subsequently mount will get new-style file handles.
2/ At your convenience, remount the filesystem on all clients, either
by umount/mount or reboot or whatever.
3/ When all, or enough, clients have remounted, you can safely change
the device number without affecting clients.

(*) I really don't think that basing the fsid on the device number is at all sensible. Afterall, that is what we are trying to avoid. Just pick a number, any number.
1 for the first filesystem, 2 for the second.
Your age for the filesystem storing you home directory.
42 for the filesystem storing the Great Question of Life, The Universe, and Everything.

NeilBrown

Quoted 11 lines

Bernd

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#5 lore raw
Quoted 7 lines · Neil Brown

(*) I really don't think that basing the fsid on the device number is at all sensible. Afterall, that is what we are trying to avoid. Just pick a number, any number.
1 for the first filesystem, 2 for the second.
Your age for the filesystem storing you home directory.
42 for the filesystem storing the Great Question of Life, The Universe, and Everything.

It would make sense for filesystems that have a GUID, like ext2/3, for it to be used as the fsid. Just a thought.

-ben

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#6 lore raw
Quoted 11 lines · On Wednesday August 7, [email protected] wrote:
Quoted 7 lines · Neil Brown

(*) I really don't think that basing the fsid on the device number is at all sensible. Afterall, that is what we are trying to avoid. Just pick a number, any number.
1 for the first filesystem, 2 for the second.
Your age for the filesystem storing you home directory.
42 for the filesystem storing the Great Question of Life, The Universe, and Everything.

It would make sense for filesystems that have a GUID, like ext2/3, for it to be used as the fsid. Just a thought.

Nice thought, but I don't really have enough bits. 32 is about all I can afford for NFSv2.

If we had a VFS interface that allowed generic access to a GUID, then an export option that says "use the GUID if present for NFSv3 or higher" might be OK...

NeilBrown

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#7 lore raw
In reply to Neil Brown
Quoted 21 lines

Sorry, you cannot do that. The filehandles created with fsid=foo are different from any filehandle created without fsid=.

If you want to change the device on the server what you need to do is:

1/ well in advance, add an 'fsid=42'(*) export option.
Clients using old file handles will still work. Clients that subsequently mount will get new-style file handles.
2/ At your convenience, remount the filesystem on all clients, either
by umount/mount or reboot or whatever.
3/ When all, or enough, clients have remounted, you can safely change
the device number without affecting clients.

(*) I really don't think that basing the fsid on the device number is at all sensible. Afterall, that is what we are trying to avoid. Just pick a number, any number.
1 for the first filesystem, 2 for the second.
Your age for the filesystem storing you home directory.
42 for the filesystem storing the Great Question of Life, The Universe, and Everything.

Quoted 2 lines

NeilBrown

Hello Neil,

thank you for telling me about this.

Bernd

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#8 lore raw
In reply to Neil Brown
Quoted 4 lines · Neil Brown

(*) I really don't think that basing the fsid on the device number is at all sensible. Afterall, that is what we are trying to avoid. Just pick a number, any number.

The number depends on the goal of specifying an fsid at all. Example:
Say you want to move the disk to a new system without affecting current mounts. It is possible to use IP numbers for fsids and to set multiple addresses on a NIC, for every exported filesystem. So when the disk or partition is moved to a different system, the IP addresses have to move to the NIC of the other system as well.

Actually I experimented with this some time ago (using a home brew fsid kind of patch).

Signature · 10 lines
Frank


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#9 lore raw
In reply to Trond Myklebust
Quoted 12 lines · Trond Myklebust
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Bernd Schubert <[email protected]> writes:

> Hi, probably on Friday I need to make use of setting the fsid > in the /etc/exports.
>
> Since I can't find the syntax in the exports manpage (manpage > was last time changed on Januar, while the fsid-feature seems > to be become added to cvs on February).
>
> So I'd like to know the exact sytanx, is for example:
>
> /testdir testnode(fsid=/dev/sdb)

Quoted 5 lines

The fsid is a number, not a device. In principle you can set it to any number you like as long as you keep it consistent over reboots.

One suggestion is to use the device major/minor number in the format minor + (major * 256). (That's what nfsd uses by default for block

------------------------- ----------------

Sorry for my last mail, I missed from your mail, that nfs uses minor + (major
* 256).

sdb6 would be: 16(scsi disk devices) + 6(partition number) + 8*256 = 2070, wouldn't it?

Thanks again for your help,

Bernd

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#10 lore raw
Quoted 3 lines

sdb6 would be: 16(scsi disk devices) + 6(partition number) + 8*256 = 2070, wouldn't it?

Sorry,

of course I meant: 16(sdb) + 6(partition number) + 8(scsi disk devices)*256

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs