odd linux question - can you mount a disk on another machine?

Discussion in 'Site & Server Administration' started by disgust, Dec 13, 2005.

  1. #1
    in other words, if I have /directory/ on server1, could I somehow set up a networked drive with server2 and have it show up as /directory/ there as well?

    I'm asking because I need to split some things up on a current site between two servers, but I need to be able to use directory/file functions with php for some of the scripts

    how would I go about this?
     
    disgust, Dec 13, 2005 IP
  2. daredashi

    daredashi Well-Known Member

    Messages:
    667
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #2
    This is one of way you can do it.
    have NFS on both linux boxes and then use following command

    replace server1 with hostname of "server1"
     
    daredashi, Dec 13, 2005 IP
    disgust likes this.
  3. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks, that was exactly what I was looking for :)
     
    disgust, Dec 13, 2005 IP
  4. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #4
    Yeah I would have suggested the same thing, but it does take a while to set up and pretty complicated....

    My boss made me do it once and it took me around 2 days....
     
    sixty6, Dec 13, 2005 IP
  5. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    2 days? Does that include 1.9 days sleeping?

    Edit /etc/exports to read something similar to the following:

    /directory 10.0.0.1(rw,no_root_squash)

    and then run /etc/init.d/nfs reload

    On the other machine just type mount -t nfs 10.0.0.1:/directory /directory

    Simple as.

    Note that this example will give root users with root on 10.0.0.1 root-level access to the files.
     
    forkqueue, Dec 13, 2005 IP