LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2006, 09:25 PM   #1
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Rep: Reputation: 15
mounting /mnt/windows over nfs fails: permissions


Hey,

I have a client running gentoo 2005.1 and a server dual booting Mandrake 10.0 and WinXP. I want to access the windows partition that is mounted on the server through the client via nfs

When I try to run (as root):

Code:
mount -t nfs x.x.0.3:/mnt/windows /mnt/netwin
The output says that the mount failed, reason given by server: permission denied.

I know this is a problem with the windows partition because I set up a different folder to be shared successfully.

On the server, /etc/fstab contains the line:

Code:
/dev/hda2 /mnt/windows ntfs umask=0,user,nis=iso8859-1,ro 0 0
As far as I know that's all the relevant information,
thanks in advance,

Steve
 
Old 07-21-2006, 09:25 AM   #2
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
Make sure you have ntfs module installed in your kernel that can read ntfs partition. Look for it online if you dont have it ... it can be found in rpm form I know because Iv used it but dont remember the link it was long time ago. After you install it find out which partition you want to mount to use the following command to find out what your disk partitions contain as root:

# fdisk -l

Determine your windows partition name. Create on your linux box in /mnt/windows_C directory and just mount that directory to whatever you see in your fdisk output. Something like:

# mount -t ntfs /dev/hda2 /mnt/windows_C

where /dev/hda2 is assumed as your C: drive. You should recognize the partitions just from looking at them to see which is your C: or D: drive. Space can also be a key element in determining that information.

See if that works. Also keep in mind once youll connect you will only be able to read it not write to it. Thats the limitation of NTFS partition in regards to being access from unix filesystem.
 
Old 07-21-2006, 11:43 AM   #3
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
Hmm, I have ntfs support on both computers.

The instructions you gave help with getting /mnt/windows to work on the server.

The problem I have is getting /mnt/windows to work over the network on the client. The server doesn't want to let the client have access for some reason.

Thanks,

Steve
 
Old 07-21-2006, 01:38 PM   #4
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
If its over the network then you need samba configured. I thought you had a dual boot between unix and windows running on one machine... at least thats the method you use to access windows partition from unix when you dual boot. But as far as accessing windows partition from unix over the network then you definitely need samba configured. Also try to ping the windows machine from your unix machine if you cant ping it that means your xp windows machine has a default firewall setup which drops all icmp packets. Disable the firewall, ping it, if its pingable, configure samba, then try to connect. Dont worry about disabling xp firewall you generally dont even need it if your already behind a firewall. Besides you can use zonealarm which is a free firewall and far better then xp in my opinion. Good luck!
 
Old 07-21-2006, 03:03 PM   #5
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
i don't think you need samba if you're just trying to mount an (inactive) partition that happens to be fat or ntfs. check these points from the nfs troubleshooting guide, see if any of them help:

Quote:
There are two common errors that mount produces when it is unable to mount a volume. These are:

1. failed, reason given by server: Permission denied

This means that the server does not recognize that you have access to the volume.

* Check your /etc/exports file and make sure that the volume is exported and that your client has the right kind of access to it. For example, if a client only has read access then you have to mount the volume with the ro option rather than the rw option.

* Make sure that you have told NFS to register any changes you made to /etc/exports since starting nfsd by running the exportfs command. Be sure to type exportfs -ra to be extra certain that the exports are being re-read.

* Check the file /proc/fs/nfs/exports and make sure the volume and client are listed correctly. (You can also look at the file /var/lib/nfs/xtab for an unabridged list of how all the active export options are set.) If they are not, then you have not re-exported properly. If they are listed, make sure the server recognizes your client as being the machine you think it is. For example, you may have an old listing for the client in /etc/hosts that is throwing off the server, or you may not have listed the client's complete address and it may be resolving to a machine in a different domain. One trick is login to the server from the client via ssh or telnet; if you then type who, one of the listings should be your login session and the name of your client machine as the server sees it. Try using this machine name in your /etc/exports entry. Finally, try to ping the client from the server, and try to ping the server from the client. If this doesn't work, or if there is packet loss, you may have lower-level network problems.

* It is not possible to export both a directory and its child (for example both /usr and /usr/local). You should export the parent directory with the necessary permissions, and all of its subdirectories can then be mounted with those same permissions.
 
Old 07-25-2006, 08:56 PM   #6
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
Ok, so I've found the problem. Or rather, I've further narrowed down the problem:

Quote:
* Check the file /proc/fs/nfs/exports and make sure the volume and client are listed correctly.
They're absent for this export. Which is strange since I can use the same syntax for any other folders not in that partition and it works fine. I ran $man exports; and found a couple things that might be the problem, but so far been able to turn them into anything that fixes the problem. I think the problem is related to the fact it's a filesystem mounted another filesystem or something to that effect.

Below are some of the lines I've tried including in /etc/exports:

Code:
/mnt/windows/ x.x.0.3(ro)
/mnt/windows/ x.x.0.3(ro,no_root_squash,nohide)
/mnt/windows/ x.x.0.3(ro,nohide,mp)
/dev/hda2 x.x.0.3(ro,nohide,mp=/mnt/windows)
/mnt/windows/ x.x.03(ro,nohide,mp=/mnt/windows)
Any help is appreciated,

Steve

Edit: I think I should point out that the contents of /var/lib/nfs/xtab show /mnt/windows as being exported. Somehow exportfs -ra updates /var/lib/nfs/xtab but not /proc/fs/nfs/exports

Last edited by 43r05p4c3; 07-26-2006 at 09:25 PM.
 
Old 07-31-2006, 11:49 AM   #7
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
Ok, so I've determined that NFS doesn't want to export filesystems that are mounted on another filesystem for some reason. Does anyone know why/how to make it do so?

If not, the other solution would be to make it use /var/lib/nfs/xtab instead of /proc/fs/nfs/exports. But again, does anyone know how to make it do so?
This is because it does write the appropriate line in /var/lib/nfs/xtab, but refuses to write that line into the kernel for some reason.

Hopefully someone can help me, otherwise it's going to be a pain to transfer anything large onto my laptop

Thanks in advance,

Steve

Last edited by 43r05p4c3; 07-31-2006 at 11:51 AM.
 
Old 07-31-2006, 02:05 PM   #8
ckin2001
LQ Newbie
 
Registered: Jul 2006
Location: Chambana
Distribution: debian
Posts: 17

Rep: Reputation: 0
Under debian I already had a directory exported with NFS from one pc to the other using
/directory ipaddy
and mount -t nfs serverip:/directory /mountpoint with no problems. I just did the same thing in reverse, with an NTFS partition being exported NFS - no problems. Unsure what would be causing your problem, the basic stuff would be make sure to restart NFS daemon. If you have already setup an NFS connection in the past between client and server, thats about all I can guess. If not, is portmapper / etc/hosts.allow setup correctly? rpcinfo -p hostname can let you know if anything isn't right.

Everything I have, I haven't listed everything I did to get it correct in the first place

/etc/fstab (server)
/dev/hdb5 /windows ntfs user 0 0

/etc/exports (server)
/windows clientip(ro)

client shell
# mount -t nfs serverhostname:/windows /clientmountpoint
 
Old 07-31-2006, 03:18 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,974
Blog Entries: 46

Rep: Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202Reputation: 3202
Quote:
Originally Posted by 43r05p4c3
Ok, so I've determined that NFS doesn't want to export filesystems that are mounted on another filesystem for some reason. Does anyone know why/how to make it do so?

If not, the other solution would be to make it use /var/lib/nfs/xtab instead of /proc/fs/nfs/exports. But again, does anyone know how to make it do so?
This is because it does write the appropriate line in /var/lib/nfs/xtab, but refuses to write that line into the kernel for some reason.

Hopefully someone can help me, otherwise it's going to be a pain to transfer anything large onto my laptop

Thanks in advance,

Steve
Hi,

I would suggest that you 'man nfs' to use multiple nfs servers on your server. That is if your server is capable.

I also refer you to Linux NFS Overview, FAQ and HOWTO Documents on sourceforge.

I would suggest that you 'man mount'. The command;
Code:
mount -a -F -t nfs Server:/mmnt/nfs_share /mnt/nfs_share
This should fork and allow simultaneous use.
 
Old 08-03-2006, 08:55 PM   #10
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
ckin2001: I have set up NFS connections in the past, and can for anything in the root filesystem. rpcinfo -p shows nothing suspicious, and restarting nfsd hasn't helped. Thanks anyways.

gwsandvik: I've looked through 'man nfs' and the only mention of multiple servers on a server is here:

Code:
       mountprog=n    Use an alternate RPC program number to contact the mount
		      daemon  on  the  remote host.  This option is useful for
		      hosts that can run multiple NFS  servers.	  The  default
		      value  is	 100005 which is the standard RPC mount daemon
		      program number.

       mountvers=n    Use an alternate RPC version number to contact the mount
		      daemon  on  the  remote host.  This option is useful for
		      hosts that can run multiple NFS  servers.	  The  default
		      value is version 1.

       nfsprog=n      Use  an  alternate RPC program number to contact the NFS
		      daemon on the remote host.  This option  is  useful  for
		      hosts  that  can	run multiple NFS servers.  The default
		      value is 100003 which is the  standard  RPC  NFS	daemon
		      program number.

       nfsvers=n      Use  an  alternate RPC version number to contact the NFS
		      daemon on the remote host.  This option  is  useful  for
		      hosts  that  can	run multiple NFS servers.  The default
		      value is version 2.
This also could be taken as multiple servers maybe?
Code:
       noac	      Disable  all  forms of attribute caching entirely.  This
		      extracts a server performance penalty but it allows  two
		      different	 NFS  clients  to  get reasonable good results
		      when  both  clients  are	actively  writing  to	common
		      filesystem on the server.
Either way, neither seems especially helpful in my case. (But then I'm still not clear what multiple servers does, so it could be exactly what I need :S )

Google wasn't especially helpful beyond confirming that it is an actual possibility. If anyone has an explanation or link to an explanation of how to use multiple servers on my server. (or simply point out what I completely overlooked in man nfs if that's the case )

The NFS overview, FAQ... has told me two things:
1. sharing ntfs should be possible, although it's not guaranteed
2. (I've already mentioned this but since it seems to be the core of the problem, I'll mention it again)
exportfs -ra isn't properly writing to /proc/fs/nfs/exports
I can't think why, but 'man exports' shows:

Code:
       nohide This option is based on the option of the same name provided  in
	      IRIX  NFS.  Normally, if a server exports two filesystems one of
	      which is mounted on the other, then  the	client	will  have  to
	      mount  both filesystems explicitly to get access to them.	 If it
	      just mounts the parent, it will see an empty  directory  at  the
	      place where the other filesystem is mounted.  That filesystem is
	      "hidden".

	      Setting the nohide option on a filesystem causes it  not	to  be
	      hidden,  and  an appropriately authorised client will be able to
	      move from the parent to that  filesystem	without	 noticing  the
	      change.

	      However,	some  NFS clients do not cope well with this situation
	      as, for instance, it is then possible for two files in  the  one
	      apparent filesystem to have the same inode number.

	      The  nohide  option  is  currently only effective on single host
	      exports.	It does not work reliably with	netgroup,  subnet,  or
	      wildcard exports.

	      This option can be very useful in some situations, but it should
	      be used with due care, and only after confirming that the client
	      system copes with the situation effectively.

	      The option can be explicitly disabled with hide.
This at least sounds like it describes my situation, but using the nohide option hasn't made /proc/fs/nfs/exports accept the line.

I tried forking the mount, but that didn't seem to do anything. Possibly cause it expects to be used in conjunction with the multiple servers on the server? As it is, I'm not sure what I'd be forking it with.

All: As I've stated, I need to write a line to /proc/fs/nfs/exports. If anyone has suggestions how to do this, that would be greatly appreciated.
The other thing I've wondered, is if /proc/fs/nfs/exports can be manually written? As I understand it, I probably can't, but there are supposed to be some files in /proc that can be manually written.

As always, thanks,

Steve
 
Old 08-04-2006, 08:25 AM   #11
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
i don't think you need multiple servers. i have multiple clients accessing the same mounted filesystem on a single server. for example, a partition on server hdb is mounted on hda, and then that mount is in turn exported to several clients. that's the nature of nfs, to share a filesystem with many clients. i think the problem is the windows filesystem (ntfs, i think you said it was?). permissions on those things always suck big time, but i'd guess that's what's wrong, or is part of it. maybe you could list the permissions of the mounted partitions that you're trying to export. you might need to create a similar user/group on the clients, or something like that.

i don't know if this will help, but i had a problem mounting once before because either the server or the client thought the volume was still mounted. i had to manually umount the partitions on the client (even though they didn't even show as being mounted!), and then they mounted again. even restarting nfs didn't help. if you've rebooted the machines since starting the thread, it's probably a moot point, but if not, i guess you could give that a try as an extreme longshot.

i don't know if you can write to /proc manually, but even if you can it doesn't sound like a good idea. the root of the problem is somewhere else, and when you solve that, it will write to /proc automatically, like it should.

if it were me, i'd dump the windows filesystem and reformat it as an ext3. that would be guaranteed to solve your problems. otherwise, post the permissions information so we can take a look.

Last edited by slackhack; 08-04-2006 at 08:26 AM.
 
Old 08-07-2006, 07:22 PM   #12
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
Ok, the permissions on /mnt/windows:

dr-xr-xr-x root root

I've rebooted both machines numerous times, so it's not a problem of thinking the volume's still mounted. (I did try anyways, but no luck). The permissions result from the line in /etc/fstab:

Code:
/dev/hda2  /mnt/windows  ntfs  umask=0,user,nls=iso8859-1,ro  0  0
I tried a few things, and it seems the floppy (specifically tested on a vfat disk, which is worrysome) ALSO doesn't want to export, but the cd does, so I've also included their fstab lines too just for comparison:

Code:
/dev/hdb  /mnt/cdrom  auto mask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec  0  0
none /mnt/floppy  supermount  dev=/dev/fd0,fs=ext2:vfat,--,umask,iocharset=iso8859-1,sync,codepage=850  0  0
Oh, and /mnt/floppy/: drwxrwxrwx root root; #won't export (haven't tested an ext2 disc at all)
/mnt/cdrom/: drwxr-xr-x root root; #will export
/home/steven/: drwxr-wr-x steven steven; #will export

as far as dumping windows and reformatting as ext3... I'm tempted, but unfortunately windows has its uses... occasionally

Steve
 
Old 08-23-2006, 12:19 PM   #13
43r05p4c3
Member
 
Registered: Mar 2005
Location: Ontario, Canada
Distribution: Mandrake 10.0/XP Dual Boot Desktop & Gentoo 2005.1 Laptop
Posts: 79

Original Poster
Rep: Reputation: 15
Sorry guys, I'll only do this once:

*Bump*

If no one can help, I can workably get around it, but it's a pain to copy large files to one partition just so I can copy them from the network. (I'll may just get a new distro after a while to work with and hope that fixes it)

Steve
 
Old 08-23-2006, 01:12 PM   #14
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
Probably a silly question but scanning all this I had to wonder, on the system your doing the export from, if you do a df does the file system that you want to export show up? I think it has to be mounted by your local system before you are able to export it.
 
Old 08-23-2006, 02:07 PM   #15
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
Quote:
Originally Posted by 43r05p4c3
Sorry guys, I'll only do this once:

*Bump*

If no one can help, I can workably get around it, but it's a pain to copy large files to one partition just so I can copy them from the network. (I'll may just get a new distro after a while to work with and hope that fixes it)

Steve
you might need a write in the owner's permissions at least:

dr-xr-xr-x root root
to:
drwxr-xr-x root root

play around with the umask options. man mount and man umask have good info on that. man fstab might be worth checking out, too.

Last edited by slackhack; 08-23-2006 at 02:09 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting windows xp file system, creates mnt point, however, cant read files in share cmd0a0 Linux - Networking 10 04-16-2005 12:28 AM
Mounting NFS Filesystems at startup, always fails.. stellarmarine1 Linux - Networking 7 02-03-2005 12:40 PM
Problem of permissions /mnt/windows rosariowong Slackware 1 08-17-2004 06:39 AM
Can't change permissions for mnt/windows(XP) webwolf70 Linux - General 2 08-13-2004 01:35 PM
Does anyone know why mounting NFS shares causes the directory permissions to change? gkneller Linux - Networking 4 01-29-2004 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration