2

So I've got two systems, lucyvanpelt and schroeder.

lucyvanpelt's /home is exported read-write to schroeder via NFS. Its location on schroeder is /mnt/home/lucyvanpelt

I want to union-mount it with schroeder's home, so I do as follows:

mount -t aufs -o br:/mnt/home/lucyvanpelt:/home none /home

It works just fine, except:

mount: block device none is write-protected, mounting read-only

And I'm not sure what to do about this. Like I said, the NFS export from lucyvanpelt is read-write (I have triple-checked this, though I don't know if it'd be relevant if it weren't).

chaos
  • 47,463
  • 11
  • 118
  • 144
Steely Dan
  • 121
  • 1

1 Answers1

2

In an aufs union-mount, a branch and the mountpoint cannot be the same. Use this:

mount -t aufs -o dirs=/mnt/home/lucyvanpelt=rw:/home/schroeder=ro none /path/to/mountpoint

Normally if you want to merge 2 directories, you have to specify what should happen if something is written on it. As you can see, you can specify each branch with rw (readwrite) or ro (readonly).

In the example above, when you write something in /path/to/mountpoint, that will be written on the branch /mnt/home/lucyvanpelt, which is readwrite. This directory is overlays the other one.

chaos
  • 47,463
  • 11
  • 118
  • 144