4

I'm running QNX Neutrino.

I've got some files in /mountpoint:

# ls /mountpoint
/mountpoint/a
/mountpoint/b

And after mounting my NAS using fs-cifs like so,

# fs-cifs //hostname:hostipaddress:/sharename /mountpoint login password &

I see the remote files (c, d) as well as my local files (a, b)

# ls /mountpoint
/mountpoint/a
/mountpoint/b
/mountpoint/c
/mountpoint/d

  • Is this the expected behaviour? I thought mount usually hid the local files (as per Where do the files go if you mount a drive to a folder that already contains files?)

  • Is there an easy way of determining whether the files listed are stored locally or on the NAS?

  • Is there an easier method of moving local files in /mountpoint to the NAS than unmount, move local files to tmp, remount, move files from tmp to /mountpoint?

Alex L
  • 163

1 Answers1

3

QNX Neutrino allows and even defaults to union mounts: if you mount two different filesystems on the same location, the files in both are present, except that files in the second filesystem shadow files with the same names in the first filesystem.

This is different from typical unix behavior, where mounting a filesystem shadows everything below the mount point. Many unix variants have some way of performing a union mount nowadays (e.g. UnionFS, or FreeBSD's mount -o union), but it is not a traditional feature.

On normal unix systems, df /path/to/file tells you what filesystem a file is on. I expect it to apply to QNX union mounts as well, but I don't know for sure.

Unless you want to perform a union mount, which you apparently don't, always mount a filesystem to an empty directory.

mkdir /mountpoint2
fs-cifs //hostname:hostipaddress:/sharename /mountpoint2 login password &