Skip to contentSkip to conversation

Problems Migrating from NFSv3 to NFSv4

DISCUSSION Christopher Metter 3 participants 6 messages Nov 16, 2009 – Nov 20, 2009 3 messages not in the archive

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

Hi there folks!

Im trying to migrate from NFSv3 to NFSv4. I've read diverse Articles and Howtos, but i cant find a solution to my problem.

For better understanding: My NFSv4 Root is /srv/data/, a Folder that existed before and has diverse Subfolders in it. These Folders are really there and are not mounted by "mount --bind".

The Servers IP: 192.168.0.10
Client1: 192.168.0.1
Client2: 192.168.0.2

Setup with NFSv3:
2 Folders (scratch and software) were shared for 2 Clients. In Scratch both clients had full RW-access and on software only Client2 had rw, Client1 had RO. Config:
/srv/data/scratch-all *(rw,async,no_root_squash,nohide,no_subtree_check)
/srv/data/software 10.0.12.4(ro,sync,no_root_squash,nohide,no_subtree_check) 10.0.12.5(rw,sync,no_root_squash,nohide,no_subtree_check)

My NFSv4 Config (from Server/etc/exports)
|/srv/data/ 192.168.0.2(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) 192.168.0.1(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check)
/srv/data/scratch *(rw,async,no_root_squash,no_subtree_check)
/srv/data/software 192.168.0.1(ro,sync,no_root_squash,no_subtree_check) 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)
|
After that i mounted from Client1 and Client2 the Sharefolders directrly (e.g. software: mount -t nfs4 -o intr,hard,rw 192.168.0.10:/software /targetfolder), everything works perfect, every Client has its specific rights and so on.

But if im mounting Servers Root (mount -t nfs4 -o intr,hard,rw 192.168.0.10:/ /targetfolder) from Client1 I do have complete RW Access to the full "Data" folder, even with RW for Software (which i set for RO). I also do see folders I didnot specificly share (e.g. there is a folder 'lost+found' in /srv/data which should not be shared).

My Question is:
What do i have to do, that even if im mounting Servers root, I only can see and access the specificly for this client configurated exports? (Also with correct access, of course) Is it possible that way or do i have to make a complete new folder, set it as new root, mount --bind the needed folders in there and then share them?

I tried setting Roots Parameters for Client1 to RO, but after that i even didnt have RW to /scratch per direct mount.

What am I doing wrong? Im looking forward to any feedback.

Greetings,
Christopher

A message that is not in the archive (sent off-list or not yet received): 4B01A0B5.80501-jNDFPZUTrfSeRcrpBB1ZFQkon6kHRKkiG9Ur7JDdleE@public.gmane.org

#2 lore raw
Quoted 42 lines · Christopher Metter

Hi there folks!

Im trying to migrate from NFSv3 to NFSv4. I've read diverse Articles and Howtos, but i cant find a solution to my problem.

For better understanding: My NFSv4 Root is /srv/data/, a Folder that existed before and has diverse Subfolders in it. These Folders are really there and are not mounted by "mount --bind".

The Servers IP: 192.168.0.10
Client1: 192.168.0.1
Client2: 192.168.0.2

Setup with NFSv3:
2 Folders (scratch and software) were shared for 2 Clients. In Scratch both clients had full RW-access and on software only Client2 had rw, Client1 had RO.
Config:
/srv/data/scratch-all *(rw,async,no_root_squash,nohide,no_subtree_check)
/srv/data/software 10.0.12.4(ro,sync,no_root_squash,nohide,no_subtree_check) 10.0.12.5(rw,sync,no_root_squash,nohide,no_subtree_check)

My NFSv4 Config (from Server/etc/exports)
|/srv/data/ 192.168.0.2(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) 192.168.0.1(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) /srv/data/scratch *(rw,async,no_root_squash,no_subtree_check) /srv/data/software 192.168.0.1(ro,sync,no_root_squash,no_subtree_check) 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)
|
After that i mounted from Client1 and Client2 the Sharefolders directrly (e.g. software: mount -t nfs4 -o intr,hard,rw 192.168.0.10:/software /targetfolder), everything works perfect, every Client has its specific rights and so on.

But if im mounting Servers Root (mount -t nfs4 -o intr,hard,rw 192.168.0.10:/ /targetfolder) from Client1 I do have complete RW Access to the full "Data" folder, even with RW for Software (which i set for RO). I also do see folders I didnot specificly share (e.g. there is a folder 'lost+found' in /srv/data which should not be shared).

Quoted 4 lines

My Question is:
What do i have to do, that even if im mounting Servers root, I only can see and access the specificly for this client configurated exports? (Also with correct access, of course)

I'm not sure I understand your question... Are you asking is there a way for clients to only see particular directories on a the server's root?

steved.

Quoted 16 lines

Is it possible that way or do i have to make a complete new folder, set it as new root, mount --bind the needed folders in there and then share them?

I tried setting Roots Parameters for Client1 to RO, but after that i even didnt have RW to /scratch per direct mount.

What am I doing wrong? Im looking forward to any feedback.

Greetings,
Christopher

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 10 lines · Steve Dickson
Quoted 5 lines

My Question is:
What do i have to do, that even if im mounting Servers root, I only can see and access the specificly for this client configurated exports? (Also with correct access, of course)

I'm not sure I understand your question... Are you asking is there a way for clients to only see particular directories on a the server's root?

steved.

Hi Steve,

thats what im talking about. Clients should only see(+write) particular directories on the server, after I've set the permission for this.

Example:

/srv/data is NFSv4Root and includes:
/srv/data/folder1
/srv/data/folder2
/srv/data/folder3

Now I set permission for Client1 to readonly folder1 and readwrite folder2 and no permissions for folder3.

After mounting servers root, I only see folder1 and only can write in folder2. And the Client doesnt know anything about folder3

#5 lore raw
In reply to a message not in the archive
Quoted 36 lines · Christopher Metter

Hi there folks!

Im trying to migrate from NFSv3 to NFSv4. I've read diverse Articles and Howtos, but i cant find a solution to my problem.

For better understanding: My NFSv4 Root is /srv/data/, a Folder that existed before and has diverse Subfolders in it. These Folders are really there and are not mounted by "mount --bind".

The Servers IP: 192.168.0.10
Client1: 192.168.0.1
Client2: 192.168.0.2

Setup with NFSv3:
2 Folders (scratch and software) were shared for 2 Clients. In Scratch both clients had full RW-access and on software only Client2 had rw, Client1 had RO.
Config:
/srv/data/scratch-all *(rw,async,no_root_squash,nohide,no_subtree_check)
/srv/data/software 10.0.12.4(ro,sync,no_root_squash,nohide,no_subtree_check) 10.0.12.5(rw,sync,no_root_squash,nohide,no_subtree_check)

My NFSv4 Config (from Server/etc/exports)
|/srv/data/ 192.168.0.2(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) 192.168.0.1(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) /srv/data/scratch *(rw,async,no_root_squash,no_subtree_check) /srv/data/software 192.168.0.1(ro,sync,no_root_squash,no_subtree_check) 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)
|
After that i mounted from Client1 and Client2 the Sharefolders directrly (e.g. software: mount -t nfs4 -o intr,hard,rw 192.168.0.10:/software /targetfolder), everything works perfect, every Client has its specific rights and so on.

Quoted 4 lines

But if im mounting Servers Root (mount -t nfs4 -o intr,hard,rw 192.168.0.10:/ /targetfolder) from Client1 I do have complete RW Access to the full "Data" folder, even with RW for Software (which i set for RO).

Exports don't operate on "folders", only on filesystems: if you export /srv/data/ read-write, and if /srv/data/software is on the same filesystem as /srv/data, then /srv/data will also be exported, and also writeable.

--b.

Quoted 23 lines

I also do see folders I didnot specificly share (e.g. there is a folder 'lost+found' in /srv/data which should not be shared).

My Question is:
What do i have to do, that even if im mounting Servers root, I only can see and access the specificly for this client configurated exports? (Also with correct access, of course)
Is it possible that way or do i have to make a complete new folder, set it as new root, mount --bind the needed folders in there and then share them?

I tried setting Roots Parameters for Client1 to RO, but after that i even didnt have RW to /scratch per direct mount.

What am I doing wrong? Im looking forward to any feedback.

Greetings,
Christopher
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 28 lines · J. Bruce Fields
Quoted 16 lines · Christopher Metter

Hi there folks!

Im trying to migrate from NFSv3 to NFSv4. I've read diverse Articles and Howtos, but i cant find a solution to my problem.

For better understanding: My NFSv4 Root is /srv/data/, a Folder that existed before and has diverse Subfolders in it. These Folders are really there and are not mounted by "mount --bind".

The Servers IP: 192.168.0.10
Client1: 192.168.0.1
Client2: 192.168.0.2

Setup with NFSv3:
2 Folders (scratch and software) were shared for 2 Clients. In Scratch both clients had full RW-access and on software only Client2 had rw, Client1 had RO. Config:
/srv/data/scratch-all *(rw,async,no_root_squash,nohide,no_subtree_check)
/srv/data/software 10.0.12.4(ro,sync,no_root_squash,nohide,no_subtree_check) 10.0.12.5(rw,sync,no_root_squash,nohide,no_subtree_check)

Quoted 9 lines

My NFSv4 Config (from Server/etc/exports)
|/srv/data/ 192.168.0.2(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) 192.168.0.1(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check)
/srv/data/scratch *(rw,async,no_root_squash,no_subtree_check)
/srv/data/software 192.168.0.1(ro,sync,no_root_squash,no_subtree_check) 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)
|
After that i mounted from Client1 and Client2 the Sharefolders directrly (e.g. software: mount -t nfs4 -o intr,hard,rw 192.168.0.10:/software /targetfolder), everything works perfect, every Client has its specific rights and so on.

But if im mounting Servers Root (mount -t nfs4 -o intr,hard,rw 192.168.0.10:/ /targetfolder) from Client1 I do have complete RW Access to the full "Data" folder, even with RW for Software (which i set for RO).

Quoted 6 lines

Exports don't operate on "folders", only on filesystems: if you export /srv/data/ read-write, and if /srv/data/software is on the same filesystem as /srv/data, then /srv/data will also be exported, and also writeable.

--b

Is there a workaround to this behavior? Or a trick to get an NFSv4 Setup corresponding to the NFSv3 Setup?

Christopher

__________ Information from ESET Smart Security, version of virus signature database 4539 (20091024) __________

The message was checked by ESET Smart Security.

http://www.eset.com

A message that is not in the archive (sent off-list or not yet received): 4B054EF8.7000102-jNDFPZUTrfSeRcrpBB1ZFQkon6kHRKkiG9Ur7JDdleE@public.gmane.org

#8 lore raw
Quoted 46 lines · Christopher Metter
Quoted 45 lines · J. Bruce Fields
Quoted 42 lines · Christopher Metter

Hi there folks!

Im trying to migrate from NFSv3 to NFSv4. I've read diverse Articles and Howtos, but i cant find a solution to my problem.

For better understanding: My NFSv4 Root is /srv/data/, a Folder that existed before and has diverse Subfolders in it. These Folders are really there and are not mounted by "mount --bind".

The Servers IP: 192.168.0.10
Client1: 192.168.0.1
Client2: 192.168.0.2

Setup with NFSv3:
2 Folders (scratch and software) were shared for 2 Clients. In Scratch both clients had full RW-access and on software only Client2 had rw, Client1 had RO.
Config:
/srv/data/scratch-all *(rw,async,no_root_squash,nohide,no_subtree_check)
/srv/data/software 10.0.12.4(ro,sync,no_root_squash,nohide,no_subtree_check) 10.0.12.5(rw,sync,no_root_squash,nohide,no_subtree_check)

My NFSv4 Config (from Server/etc/exports)
|/srv/data/ 192.168.0.2(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) 192.168.0.1(rw,sync,fsid=0,insecure,no_root_squash,no_subtree_check) /srv/data/scratch *(rw,async,no_root_squash,no_subtree_check) /srv/data/software 192.168.0.1(ro,sync,no_root_squash,no_subtree_check) 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)
|
After that i mounted from Client1 and Client2 the Sharefolders directrly (e.g. software: mount -t nfs4 -o intr,hard,rw 192.168.0.10:/software /targetfolder), everything works perfect, every Client has its specific rights and so on.

But if im mounting Servers Root (mount -t nfs4 -o intr,hard,rw 192.168.0.10:/ /targetfolder) from Client1 I do have complete RW Access to the full "Data" folder, even with RW for Software (which i set for RO).

Quoted 8 lines
Quoted 6 lines

Exports don't operate on "folders", only on filesystems: if you export /srv/data/ read-write, and if /srv/data/software is on the same filesystem as /srv/data, then /srv/data will also be exported, and also writeable.

--b

Is there a workaround to this behavior? Or a trick to get an NFSv4 Setup corresponding to the NFSv3 Setup?

If you add a trivial mountpoint there with:

	"mount --bind /srv/data/software /srv/data/software"

I think that will do the job.

Note this isn't really secure--this will prevent users on 192.168.0.1 from accidentally modifying software/, but won't do anything against someone malicious with access to the network.

--b.