PDA

View Full Version : [all variants] Some folders not showing in NFS share



w00ly
September 1st, 2009, 09:32 PM
Ok I've got NFS setup and my share mounts without giving any errors. When I go to the mount directory I can see the files in / that I've shared but I cant see any folders on an externally mounted or anything in the home directory. Anybody know why? I set chmod 777 to the external HD's directory but that didnt help:
/etc/exports:

/ 192.168.2.0/24(rw,no_root_squash,async,no_subtree_check)

client:

root@woolybox:/mnt# mount 192.168.2.100:/ /mnt/nfstest
root@woolybox:/mnt# cd nfstest/media/NewHD/
root@woolybox:/mnt/nfstest/media/NewHD# ls
root@woolybox:/mnt/nfstest/media/NewHD#
root@woolybox:/mnt/nfstest/media/NewHD# cd ../../home/
root@woolybox:/mnt/nfstest/home# ls
root@woolybox:/mnt/nfstest/home#
How do I fix this? Thanks in advance!!

scorp123
September 1st, 2009, 10:13 PM
/etc/exports:

/ 192.168.2.0/24(rw,no_root_squash,async,no_subtree_check) That is extremely unsafe ... are you sure you know what you're doing?


but I cant see any folders on an externally mounted or anything in the home directory. NFS doesn't cross filesystem boundaries. You shared "/" (extremely unsafe in my opinion!!) and that's where the export stays.

If you want access to other file systems too, you'd have to create separate exports for them as well.

But may I ask what it is that you're trying to achieve?? The way you're using NFS is begging for trouble to happen ...

w00ly
September 1st, 2009, 10:20 PM
There's media that i'm sharing both on an external hard drive and in the home directory. I also want to share devices such as dvd burners and seamless integration within the OS so that my devices appear as they're local on either system

Thanks for answering my question though! Since the external drive is VFAT I wont be using NFS. Am I stuck with samba? What about SSHFS? Is it faster than samba?

scorp123
September 2nd, 2009, 12:47 AM
Since the external drive is VFAT I wont be using NFS. Am I stuck with samba? What about SSHFS? Is it faster than samba? I fail to see the correlation between NFS (network layer) and whatever filesystem is on that harddisk ??? If you can mount it you can export it via NFS. To the other end of the network it's NFS. And just that.

But I highly recommend NOT doing what you're doing. One accidental drag & drop in the wrong places, one glitch, one small crash, and your installation is hosed.

I fail to see any sane reason why anyone would ever need to export "/" with that "no_root_squash" option turned on??? ](*,)

But hey, it's your system ... Just don't come crying, OK? :D

As for SSHFS: I'd clearly recommend that one over NFS or SAMBA. It's secure, it's safe, it's encrypted and you can easily operate it from your "Gnome" desktop if you so wish (remote SSHFS locations appear as folder icons on your desktop). And it's far less complicated to configure. All you need is a valid system user account + password on the remote end (SAMBA requires a lot more and has its own password back-end which for the average user usually has more disadvantages than advantages ... it's confusing to most).

w00ly
September 2nd, 2009, 03:39 AM
I fail to see the correlation between NFS (network layer) and whatever filesystem is on that harddisk ??? If you can mount it you can export it via NFS. To the other end of the network it's NFS. And just that.
lol I misinterpreted what you said about nfs not being able to cross file system boundaries..most of this is over my head.. :oops:


But I highly recommend NOT doing what you're doing. One accidental drag & drop in the wrong places, one glitch, one small crash, and your installation is hosed.

I fail to see any sane reason why anyone would ever need to export "/" with that "no_root_squash" option turned on??? ](*,)

But hey, it's your system ... Just don't come crying, OK? :D

I dont know what no_root_squash does...it was just in there because it was in the guide I was reading. The only reason I used / is because I wanted to be able to access the whole system remotely



As for SSHFS: I'd clearly recommend that one over NFS or SAMBA. It's secure, it's safe, it's encrypted and you can easily operate it from your "Gnome" desktop if you so wish (remote SSHFS locations appear as folder icons on your desktop). And it's far less complicated to configure. All you need is a valid system user account + password on the remote end (SAMBA requires a lot more and has its own password back-end which for the average user usually has more disadvantages than advantages ... it's confusing to most).
Yea it definitely seemed much easier to configure...what about speed, is it faster than samba? Thanks for the recommendation :D

Warren Watts
September 2nd, 2009, 04:45 AM
lol I misinterpreted what you said about nfs not being able to cross file system boundaries..most of this is over my head.. :oops:


Here's a link to an explanation of how path names are evaluated with NFS.


Using symbolic links with NFS (http://ou800doc.caldera.com/en/SDK_sysprog/_Using_Symbolic_Links_with_NFS.html)

Perhaps that will explain it a little better for you

scorp123
September 2nd, 2009, 10:10 AM
I dont know what no_root_squash does... Why did you configure it then that way???

Always know what you're doing and why!! Don't follow guides blindly!! THINK.



Read the explanation regarding "no_root_squash" here please:
http://ubuntuforums.org/showpost.php?p=4184680&postcount=122


"no_root_squash" may make sense if you are operating a server that has home directories stored on it .... But you definitely never ever export "/" with that option turned on!!

Anyone posing as super-user "root" on the network could now easily gain full control over that system and manipulate it in whichever way he wishes.

If you want to be able to easily and safely browse your remote computer, why not simply use SSH from within your file browser?

Open Nautilus (the file manager) (Places > Home Folder), click that "Pencil" icon in the upper left corner, underneath the "File" menu. Now you should see the "Location" text field and you should be able to type in adresses ... So now, simply type a SSH URL into this, e.g.

ssh://youruser@remote-server

Taddaaaaa .... Your browser will display the contents of the remote machine.

Just don't do this as "root" (same problem as above: one accidental click in the wrong places and strange things happen).

The advantage of this method:

It's easy. Nothing to export, nothing to configure. Just install "openssh-server", that's it
It just works
It's easy to use
It's safe for as long as you don't do this with the "root" account