Menu

#6 mkdir overwrites if not previously accessed

open
nobody
None
5
2008-05-02
2008-05-02
No

When using aufs with NFS, if you perform a mkdir on a directory that already exists, but which has not been accessed, the local directory will overwrite the directory.

This is in contrast to the behavior if you access the directory first (e.g., do an ls) and then perform the mkdir. In this second situation, the directory is not overwritten.

For example, suppose that the following directories exist, each with a file inside called "FOO":

/var/dir_one/FOO
/var/dir_two/FOO

On a client system which has AUFS combining an NFS mount with the above directories and a tmpfs, you can do the following:

$ mkdir /var/dir_two
$ ls /var/dir_two
$ ls /var/dir_one
FOO
$ mkdir /var/dir_one
$ ls /var/dir_one
FOO

As you can see, the initial mkdir of dir_two has overwritten it and the ls has shown that dir_two is empty. But since dir_one was accessed before the "mkdir /var/dir_one" command, its contents are preserved - even after the attempted mkdir.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I replied to the ML. Please read the mail.

     
  • Nobody/Anonymous

    Logged In: NO

    > I replied to the ML. Please read the mail.
    I mis-edited this comment, sorry.

     

Log in to post a comment.