Share directory

Posted on 2006-04-26
Last Modified: 2013-12-16
How can i share file system between to linux box (permanent).
Question by:Aida2
    LVL 43

    Expert Comment

    You mean share between multiple machine (linux/other OS boxes)?
    Yes use NFS to export the filesystem branch to network.
    Yes use samba(windows share) to export the filesystem branch to network.
    LVL 1

    Author Comment

    No i mean share between to linux box exactly i looking for export command (maybe in one write a permition and name for another machine in /etc/exports and from another box just mount it) or something like that
    LVL 43

    Expert Comment

    Install nfs-server on the box where the directrory exists permanently, then export with /etc/exports and start nfs-server
    on the other box: mount -t nfs /local/path
    LVL 16

    Accepted Solution

    so you want NFS...
    /etc/exports would be something like this:


    this means that anyone in the 192.168.5.* network can mount it read-only, and there is read-write access just to (you can use hostnames too)

    If you operate as root, you may want to use the no_root_squash option as well, since this means that you can mount it as root and still act as root on the nfs server

    don't put a space between the host/network in the permissions (ro) or (rw) or else you'll negate the permissions

    you can then mount if from the other PC with the command:
    mount -t nfs <nfs server>:/apps /mnt/apps

    this will mount 'apps' from the machine 'nfs server' as '/mnt/apps' on the local system. You can make it permanent by modifying /etc/fstab

    LVL 1

    Author Comment

    Thank you jammy i was look for this
    i my nfs server i have
    /apps     *(rw,mp,async,no_root_squash)
    in my /etc/exports

    And from another box i try:

    mount -t nfs new:/apps /mnt/apps
    i get :
    mount: new:/apps failed, reason given by server: permission denied

    but apps have 777
    LVL 1

    Author Comment

    nfsstat for both server are
    calls    badcalls    badauth     badclnt   xdrcall
    0            0              0               0          0

    LVL 1

    Author Comment

    Sorry i forgat to restar service ntfs. now is ok thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now