1832986 Members
2649 Online
110048 Solutions
New Discussion

NFS

 
friki
Advisor

NFS

Hi,

I must export fs by NFS /opt/dir1/fich1
but in /etc/exports already is exported /opt/dir1.

Is possible a /etc/exports with this:
/opt/dir1
/opt/dir1/fich1
How can i do it??

Thanks and regards.-
10 REPLIES 10
MarkSyder
Honored Contributor

Re: NFS

It's possible, but unnecessary: when you run it it will tell you that the parent directory is already exported. Because you've exported the parent, fich1 is already available.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Stuart Urquhart
Frequent Advisor

Re: NFS

It's not possible to export a subdirectory of an already exported directory.
You could export /opt/dir1 to include the host you want to mount on and only mount /opt/dir1/fich1.
Or unexport /opt/dir1 (exportfs -uv /opt/dir1) and then export /opt/dir1/fich1. Of course any hosts that had /opt/dir1 mounted would then lose access.
Muthukumar_5
Honored Contributor

Re: NFS

You don't need to export sub directories with exportfs command.

man exportfs says,

You cannot export a directory that resides within the same file system
and is either a parent or sub-directory of a directory that is
currently exported. For example, /usr and /usr/local cannot both be
exported if they reside in the same disk partition.

hth.
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: NFS

Whenever you export a directory through NFS, all sub direcortories will also be exported and available.. So, its not necessary to do so.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
friki
Advisor

Re: NFS

thank you,
Could i then mount /opt/dir1/fich1 in server node and mount it in server client without problems?
Thanks and sorry because my questions..


MarkSyder
Honored Contributor

Re: NFS

If you've exported the parent directory you should only have to cd on the client.

Mark
The triumph of evil requires only that good men do nothing
Muthukumar_5
Honored Contributor

Re: NFS

Yes surely.

Example:

# exportfs -iv /opt/dir1

will not consider /etc/exports file.

# mkdir /tmp/trydir
# mount /opt/dir1/fich1 /tmp/trydir
# ls -l /tmp/trydir /opt/dir1/fich1

will be same.

### Revert procedure ####
# umount /tmp/trydir
# rm -rf /tmp/trydir
(will revert to old stage ;) )
########################

hth.
Easy to suggest when don't know about the problem!
friki
Advisor

Re: NFS

Hi,
I had do it and i have a problem:

I make a fs in node1 /opt/dir1/fich1

but when i try mount it in node2 i cant do it.

Thanks
MarkSyder
Honored Contributor

Re: NFS

1. Check what /opt/dir1 is exported as

2. log in to node 2 and type:

cd /vol//fich1

where is the result of test 1.

Mark
The triumph of evil requires only that good men do nothing
friki
Advisor

Re: NFS


Hi,

I do it:

1- exportfs -iv /opt/dir1/fich1

# mkdir /tmp/trydir
# mount /opt/dir1/fich1 /tmp/trydir

now i can mount it thanks.

I mistake another time. Thanks to all people.

Regards