1

I have two CentOS boxes, essentially a QA and a production box, and I want to use nfs to mirror over the entire directory structure of my prod box to QA, however, I want to exclude a certain nested directory, and instead have that be a directory located local to the QA box. For example:

**Prod box**
/
  local/
    libs/
    repos/
  bin/
  etc/

**QA** (<> means nfs'ed from prod)
</
  local/
    libs/>
    repos/
  <bin/
  etc/>

So basically, how can I have repos be a directory local to the QA box, while having the rest of the filestructure as nfs?

4
  • 1
    It appears you would like the root / filesystem and /etc/ directory to be "nfs'ed from prod" which is going to cause problems. Were you leaving out intermediate paths? Also, you open the possibility of QA activities to affect prod, which is not a good idea. You should use proper system and software management techniques; NFS isn't one. Nov 28, 2011 at 19:12
  • Would there be a way of making the nfs ready only on the QA side to prevent that? or is nfs not capable of such a thing? Also, it would be a intermediary path such that I can have some local directories; this was just a (crappy) example. Nov 28, 2011 at 19:24
  • NFS (like any other filesystem) can be mounted read-only, but this may create other problems (when /tmp and /var/tmp aren't writable, for instance) -- IMHO You're better off using a deployment system and deploying the production configuration to your dev environment to make sure they match up...
    – voretaq7
    Nov 28, 2011 at 19:36
  • the environment in terms of packages/os configuration is synced by a system, however, there are third party libraries and some data that I want to mirror through to QA. /tmp and /var/tmp/ will stay local. I guess my example is bad; I'm not trying to nfs my root directory. Nov 28, 2011 at 19:41

2 Answers 2

4

Look into mount --bind for the QA box. Be sure to use the appropriate flags to make sure it will behave appropriately if it should become unmounted.

1

Though slightly different, the process mentioned here works for what you're looking to do.

Access files located on the underlying filesystem of an NFS mountpoint

1
  • bear with me, because I'm just a lowly developer and not a sysadmin: so in this case would you do the nfs mount -first- on the entire filestructure, then do "mount --bind /local/repos /somelocaldir"? Nov 28, 2011 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .