Marc Chamberlin said the following on 02/09/2011 07:00 PM:
What do you mean by
"the device is BELOW the mount point"? It has become clear that I cannot mount anything "ABOVE" the mount point, like / and then expect to be able to access /media/MyPassport, because of an NFS restriction. Correct.
OK, but I am exporting what appears to me as THE mount point and that should be sufficient for NFS since I am giving my blessing to NFS to export THE mount point. What do you mean by "BELOW"? That just does not make any kind of sense! If you read the NFS man page it is quite clear. You need to export the directory and mount point.
So I've exported Server:/home/anton but there is another fs mounted on server:/home/anton/PDF so I have to export that AS WELL
Not one or the other. BOTH
And, again, read the manual: you need to tell the server that you don't want the second FS to be hidden. Its there in the manual.
So you need something like
/media \ 192.168.x.0/255.255.255.0(rw,async,no_root_squash,crossmnt) /media/sdb1 \ 192.168.x.0/255.255.255.0(rw,async,no_root_squash,crossmnt,nohide)
RTFM I think Anton, that YOU need to RTFM on the man pages for NFS before you make assumptions/claims that I have not done so. NOWHERE, in the man
As for permission, it clear that you are mounting the USB with the wrong permissions.
Example
1 clear out the mount 2 chown marc.users /media/sdb1 That sets the ownership of the mount point 3 insert the usb and let the kernel mount it PLEASE DO NO USE THE AUTOMOUNTER MAPS THEY JUST CONFUSE THE MATTER 4 verify its mounted $ mount ... /dev/sdb1 on /media/sdb1 type vfat (rw,noexec,nosuid,nodev....) .... OR WHATEVER 5 now check ownership of the mount point ls -l /media/sdb1
If I'm right, that's no lover "marc.users" so all the files on the mounted VFAT aren't either
Both Tajas and myself have suggested you experiment with manually mounting. I don't think you understood. The word experiment means try variations.
You point out in mail to Tajas that you tried
mount -t auto /dev/sdc1 /mnt/usbdrive -o rw,nodev,noexec
BUT YOU DIDN"T SAY WHAT UID YOU EXECUTED that as. Of course if you did that as 'uid=marc' than the mount is owned by 'marc'. If you do it as root then its owned by root. HUMP! I have NO IDEA what you are trying to say Anton. I CANNOT execute a mount command EXCEPT as ROOT! Trying to execute a mount command as me, user marc, is NOT allowed. I get told promptly that the mount command is ONLY allowed by ROOT if I try. Therefore, since there was no uid
On 2/9/2011 7:12 PM, Anton Aylward wrote: page for NFS does it say anything like what you are claiming it does. I HAVE read it, several times, top to bottom. NOWHERE. There is not one word saying that NFS by default, will not allow a client to traverse past a mount point that is below an exported mount point. There is not one word that says if you are going to export a mount point that you must also export the parent directory and that the client has to import both. There is NOT a single shred of documentation regarding why these particular limitations are in place. In fact, there is very little description of the model(s) behind NFS and I get the feeling that what is documented is just a few bits and pieces. Do a man nfs and READ IT YOURSELF. It comes up as nfs(5). And you wonder why I despise external documentation so much, and people who yell at me to RTFM first. Rarely is the documentation referred to in sync with the tools it describes, is complete, well organized, or up to date. These man pages on NFS are a mess, and as I said before, using/maintaining external documentation is a BROKEN process. Tools should present a self documenting interface to users, that is the ONLY way I know of to reliably keep documentation in sync with the tool. Command line interfaces can be designed to be self documenting if they are interactive, most are not. GUI's make the job even easier. Maybe the NFS subsystem is "mature" and has been around for awhile. Maybe a lot of Linux gurus have gotten information via the grapevine also on how to use it. Doesn't change the fact that NFS IS broken, one way or the other. Without proper documentation, a user cannot learn how to use a tool on his/her own, therefore must seek help, and DOES NOT NEED SOME "EXPERT" YELLING AT HIM TO RTFM with bad documentation. So I dug deeper, and took a hard look at the man page for exports. In particular at the nohide and crossmnt parameters. And there, buried, is a couple of offhand remarks about these limitations and what has to be done to get around it. How in the world is a user suppose to grasp what has gone wrong, when the NFS system is failing him, with no descriptions of underlying models, and be able to recognize that one, or the other, or both, of these parameters is needed? A user unfamiliar with NFS does not even have a clue where to begin diagnoses! Now if ONLY I could be so lucky as to be able to even get to the point where I can even use these parameters. Read on sir, before you reply. Even with using these parameters I cannot get NFS to work properly... parameter supplied in the command I gave, the uid of the mount point will be ROOT, that is the default behavior of the mount command, and I showed you exactly what I executed. So what in the world are you saying here?
Guess what the kernel event driven mechanisms out of HAL operates as?
$ ps -ef |grep sdb root 1680 1405 0 18:27 ? 00:00:00 hald-addon-storage: polling /dev/sdb (every 16 sec)
Right - ROOT !!
So it gets mounted as root.
Now as root you can FORCE a different UID
mount -t auto /dev/sdc1 /mnt/usbdrive \ -o rw,nodev,noexec,uid=<marc>,gid=<users>,umask=007
Now you want to substitute in there the numeric values. I think you said that marc=10001 "users" ... look it up /etc/groups. Its should be 100 So you have
-o rw,nodev,noexec,uid=1001,gid=100,umask=007
Do that mount command as root, just as HAL would, and see what you get.
Personally I'd use
umask=007,fmask=0117,dmask=0007
but then I believe in not fighting Linux access permissions. Let me try this again, even changing the uid and gid does not make any difference. Exporting the mount points. BOTH of em, or even all THREE still fails on me. Follow the dots..
So you need to make sure that the USB is always mounted like that. So put those values in /etc/fstab.
None of this is weird; this is how Linux works and its all documented. If you'd backed off and experimented and read the MAN pages you'd have found this. ITS ALL DOCUMENTED. Maybe.. maybe I don't have all the document packages installed or something.. What I have is certainly NOT clear and easy to understand. Maybe there are other obscure locations in the man pages that describe what is going on. But just because the documentation mentions these sort of details, somewhere within it, does NOT mean the documentation has been written in a clear concise, complete, well formatted manner. It is
But you seem intent on hammering at the same-old-same-old and making disparaging remarks about Linux and the way it works. Its odd how those of us who are more relaxed and believe that the people who made the design decisions did so for sensible reasons, and that mature products like NFS have been worked over by many minds, minds smarter than you or me, can get these things to work. Its sort of like Ju-Jitsu, don't resist, use the opponents strength .... go with the flow.
You derogatory attitude towards Linux and its facilities does not encourage people to help you. You keep getting me wrong about how I feel toward Linux. I feel it could stand a lot of improvement, if that is being derogatory towards Linux,
First, I ensured KDE's handling of removable storage media was disabled
(Configure Desktop > Advance > Removable Devices > Enable automatic
mounting of removable media) and got it completely out of the picture,
(as well as the device notifier). I believe this is what actually will
cause the auto mount of a plugged in device to take place, if enabled,
but it was initially turned off on my system. And without it being
active, despite what you say, NOTHING would appear under /media until I
click on the button to "turn on", "mount" whatever you want to call it,
for the identified device in the popup menu from the device notifier.
Once I click on it, THEN AND ONLY THEN do I get /media/My Passport and
I presume that a mount process has then occurred, but maybe there is
some other term for it. IF KDE is configured to automatically mount
removable storage media, then I do NOT have to click on anything in the
Device Notifier and the drive is mounted at /media/My Passport. Anywise,
I disabled both the device notifier AND KDE's configuration to
automatically handle removable storage media.
Now I plug in my USB drive... and nothing obvious happens any more. No
mounts under /media nor under /mnt. The USB drive, for all intents and
purposes, remain inaccessable to me, until I perform the mount manually.
Second, as root, I created the mount point directory as root -
cd /mnt
mkdir "My Passport"
and executed the following -
mount -t auto /dev/sdc1 /mnt/My\040Passport -o
rw,nodev,exec,uid=1000,gid=100,umask=000,fmask=0000,dmask=0000
And yes it is mounted with the owner being me... No problems so far, can
access it, do whatever... I even tried it with your flavor of umask,
fmask, and dmask, no difference in behavior with regards to the failure
that is occurring when I try to export it...
Third, I edited exports in /etc as follows
/
192.168.2.0/255.255.255.0(fsid=0,crossmnt,rw,no_root_squash,sync,no_subtree_check)
/home 192.168.2.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check)
/tmp 192.168.2.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check)
/mnt
192.168.2.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check,crossmnt)
/mnt/My\040Passport
192.168.2.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check,crossmnt,nohide)
I also tried this with and without the space in the name - My Passport.
I went back to using the space since that is what KDE/Device
Notifier/Hal was doing, and I ultimately would like to be able to do
this without having to manually mount the device. But for now will play
along with manually doing things..
and finally I restart the nfsserver
rcnfsserver restart
Shutting down kernel based NFS server: nfsd statd mountd
idmapd
done
Starting kernel based NFS server: idmapdexportfs: Warning: /mnt/My
Passport does not support NFS export.
mountd statd nfsd
sm-notify
done
and I get a warning. If I ignore the warning, (since it is not saying it
is an error...) and restart the autofs daemon on another system, with
the following map file -
slash -rw,soft,intr,timeo=50 marcslaptop:/
homes -rw,soft,intr,timeo=50 marcslaptop:/home
temp -rw,soft,intr,timeo=50 marcslaptop:/tmp
mnt -rw,soft,intr,timeo=50 marcslaptop:/mnt
MyPassport -rw,soft,intr,timeo=50 marcslaptop:/mnt/My\040Passport
then if I try to access ANY of the exported/mounted directories, the
system hangs and waits for a timeout... Nothing reported in log files
under /var/log. Removing the import of MyPassport, and rebooting will
restore the ability to access the other directories.
like looking for a needle in a haystack. As for the documentation
itself, I cannot find anything obvious that I missed, but then I am not
a Linux guru who knows what and where everything is stored in all those
update repositories either.
then that is YOUR opinion. Google around on the internet for awhile, you
will find LOTs of people struggling with things like NFS. Hint - that is
a clue it needs to be improved.