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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
11-23-2008, 11:52 PM
|
#1
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Rep:
|
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 )
|
|
|
11-24-2008, 03:11 AM
|
#2
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657
Rep:
|
You could try and add the verbose option, maybe that will tell us something.
And what does "showmount -e" tell you?
|
|
|
11-24-2008, 03:54 AM
|
#3
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
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 :-)
|
|
|
11-24-2008, 03:59 AM
|
#4
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657
Rep:
|
Hmmm...what kind of filesystem are you trying to mount? Could you add that explicitly to the mount command?
|
|
|
11-24-2008, 04:03 AM
|
#5
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
fs_image is an ext2 filesystem. I added the "-t ext2" to that mount command. It didn't help :-(
|
|
|
11-24-2008, 04:16 AM
|
#6
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
Can you mount one level higher (ie /opt/nfs)
If so, what happens if you navigate down to dir1?
|
|
|
11-24-2008, 05:12 AM
|
#7
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
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.
|
|
|
11-24-2008, 05:26 AM
|
#8
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
Try restarting NFS on the server after you mount the iso
|
|
|
11-24-2008, 05:51 AM
|
#9
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657
Rep:
|
And maybe mount with the "soft" option set, so that you'll get an error message instead of hanging.
|
|
|
11-25-2008, 12:56 AM
|
#10
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
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 :-(
|
|
|
11-25-2008, 01:21 AM
|
#11
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
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?
|
|
|
11-25-2008, 01:35 AM
|
#12
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
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 01:38 AM.
|
|
|
11-25-2008, 01:54 AM
|
#13
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
Will do, but tied up for a while
|
|
|
11-25-2008, 02:07 AM
|
#14
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
No, it doesn't work if I take /mnt/iso out of exports.
|
|
|
11-25-2008, 02:10 AM
|
#15
|
LQ Newbie
Registered: Jul 2008
Posts: 12
Original Poster
Rep:
|
Thanks a bunch for checking! BTW, do you get the same "permission denied" error?
|
|
|
All times are GMT -5. The time now is 01:33 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|