LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-23-2008, 10:52 PM   #1
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Rep: Reputation: 0
A loop device mounted within an NFS share is not accessible via NFS?


Folks, I have a strange problem and I hope someone will be able to help me out :-)

There is a directory, say /opt/nfs, exported over NFS. Within /opt/nfs there are a bunch of subdirectories, say dir1, dir2 etc.

Now, if I try to NFS mount dir1 directly using a command like

Code:
mount -t nfs localhost:/opt/nfs/dir1 mountpoint
it works flawlessly.

Now, I have an ext2 filesystem image that I need to mount on dir1. So I mount it using a loop device like so

Code:
mount -o loop fs_image /opt/nfs/dir1
and it works. But now, I am unable to access dir1 over NFS! So now when I try the same command as before

Code:
mount -t nfs localhost:/opt/nfs/dir1 mountpoint
I get this error

Code:
mount: localhost:/opt/nfs/dir1 failed, reason given by server: Permission denied
Any idea why this might be happening?

BTW, I'm doing ALL of this as root. (This is just to avoid any minor permissions issues due to ownership of files )
 
Old 11-24-2008, 02:11 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
You could try and add the verbose option, maybe that will tell us something.

And what does "showmount -e" tell you?
 
Old 11-24-2008, 02:54 AM   #3
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
OK, adding the verbose option "-v" didn't give me any extra information. The man pages for mount tell me that verbose only prints messages when the mount succeeds.

showmount -e shows me that /opt/nfs is exported... The entry is, and I quote :-)
Code:
/opt/nfs                                                                                            *
 
Old 11-24-2008, 02:59 AM   #4
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
Hmmm...what kind of filesystem are you trying to mount? Could you add that explicitly to the mount command?
 
Old 11-24-2008, 03:03 AM   #5
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
fs_image is an ext2 filesystem. I added the "-t ext2" to that mount command. It didn't help :-(
 
Old 11-24-2008, 03:16 AM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you mount one level higher (ie /opt/nfs)

If so, what happens if you navigate down to dir1?
 
Old 11-24-2008, 04:12 AM   #7
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
I can mount one level up, but when I navigate down to dir1 and hit ls, it's empty...

In case it helps I also noticed that the first time I tried to enter dir1 after the NFS mount, it took ages (around 30s) to step into that directory.
 
Old 11-24-2008, 04:26 AM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try restarting NFS on the server after you mount the iso
 
Old 11-24-2008, 04:51 AM   #9
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
And maybe mount with the "soft" option set, so that you'll get an error message instead of hanging.
 
Old 11-24-2008, 11:56 PM   #10
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
billymayday: That didn't work either :-( I still get the same error.

kenneho: The mount isn't hanging so adding the soft option (to the NFS mount) didn't make any difference :-(
 
Old 11-25-2008, 12:21 AM   #11
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Problem for me is it works!

First I did it remotely, then realised you were trying it on localhost (I won't ask why).

What does your exports look like?

Here's the relevant line from mine

Code:
/mnt/iso        192.168.1.0/24(rw,sync) localhost(rw,sync)
What gete me is it mounts without the iso mounted.

What are the permissions of the iso?
 
Old 11-25-2008, 12:35 AM   #12
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
I think the difference between what you do and what I do is that I have "/mnt" exported (the top level directory). And within that I have mounted the loop device (in your case, i guess your ISO is mounted at /mnt/iso).

My /etc/exports file looks like this

Code:
/opt/nfs *(rw,no_root_squash,no_all_squash,sync)
If I export the /opt/nfs/dir1 directly, I am able to access it, but NOT when I try it this way.

I think I might be asking for too much, but can you try it by exporting the /mnt directory, mounting your ISO at /mnt/iso, then trying to NFS mount the /mnt/iso? If that works for you, then I'm definitely screwing up something :-)

Edit: I set the /etc/exports the same as yours, and restarted the NFS server. That didn't work. And BTW my fs_image file's permissions are set to 777.

Last edited by srikanthnv; 11-25-2008 at 12:38 AM.
 
Old 11-25-2008, 12:54 AM   #13
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Will do, but tied up for a while
 
Old 11-25-2008, 01:07 AM   #14
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
No, it doesn't work if I take /mnt/iso out of exports.
 
Old 11-25-2008, 01:10 AM   #15
srikanthnv
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks a bunch for checking! BTW, do you get the same "permission denied" error?
 
  


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
How can I mount a NFS share that have a SMB share mounted? perezyanez Linux - Networking 2 09-26-2008 09:03 AM
Troubles with NFS Share being Accessible via Apache and the Web djsting Linux - Newbie 3 06-29-2008 04:00 PM
NFS share is only mounted read-only? Poetics Linux - Networking 2 05-30-2007 12:58 PM
why nfs lose loop device ? jiawj Slackware 1 03-31-2005 01:45 PM
DocumentRoot on a nfs mounted share pdhami Red Hat 0 05-17-2004 02:17 PM


All times are GMT -5. The time now is 05:56 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration