Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two physical disks mounted as such:

sda1 -> /mnt/storage

sdb1 -> /mnt/storage/homes

I've exported /mnt/storage as an NFS share. The client sees all of the contents of /mnt/storage, but it does not show the contents of sdb1 when browsing the /mnt/storage/homes folder. It does display any contents within /mnt/storage/homes before sdb1 is mounted there. Is this a limitation of NFS or are there mount parameters that can be used to follow the other mount as I was expecting?

share|improve this question

1 Answer 1

The client sees all of the contents of /mnt/storage, but it does not show the contents of sdb1 when browsing the /mnt/storage/homes folder. It does display any contents within /mnt/storage/homes before sdb1 is mounted there.

This doesn't make sense. There shouldn't be any contents of /mnt/storage/homes before sdb1 is mounted there, right?

Let's ignore the NFS client for a minute and just focus on the server.

  1. # Stop your NFS server, how to do this depends on your linux distribution
  2. umount /mnt/storage/homes
  3. umount /mnt/storage
  4. ls /mnt/storage
  5. mount /dev/sda1 /mnt/storage
  6. ls /mnt/storage
  7. ls /mnt/storage/homes
  8. mount /dev/sdb1 /mnt/storage/homes
  9. ls /mnt/storage/homes

When you list the directory contents in step 4 and step 7, there should be nothing displayed. The files and folders you expect to be in each mountpoint should appear in step 6 and step 9.

The answer to your question is that you have to export both /mnt/storage and /mnt/storage/homes. If you only have a single client, you can use the nohide option on /mnt/storage/homes to avoid needing to explicitly mount it on the client. See the exports man page for more details. That said, I'd recommend avoiding nohide and mounting both filesystems for clarity.

share|improve this answer
    
all the ls commands show what I'd expect on the server. Because the client always showed /mnt/storage/homes as empty, I unmounted it, put an empty file in /mnt/storage/homes/test and remounted /mnt/storage/homes. Running "ls /mnt/storage/homes" on the server shows the contents of sdb1. Running "ls /mnt/storage/homes" on the client displays the "test" file as the only contents. I tested this on two CentOS servers and both have the same behavior. –  dw.emplod Dec 5 '11 at 21:40
    
Okay, I thought you might have just been doing that as a test but I wanted to be sure. –  sciurus Dec 5 '11 at 21:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.