0

I would like to mount an external network disk to a folder, but I would like to keep the content of the folder (so in this case it would go to the network folder.)

For example: I have a folder: /var/mount_me/file.txt I would mount to: /var/mount_me and the content (in this case file.txt) would be transfered to the mounted network folder.

Is this possible?

2 Answers2

1

Install "aufs" or look into "mhddfs". You would do something like

mount -t aufs -o dirs=/var/mount_me:/home/yba none /new_mount_point

In mhddfs you would do something like

mhddfs /var/mount_me,/home/yba /new_mount_point

In /new_mount_point you will see the contents of both /var/mount_me and /home/yba.

If you are on an embedded system then you shoud use "unionfs". "aufs" gives finer control options that "mhddfs".

Be aware that there are performance issues with all of the pooling filesystems, especially so if you are re-exporting over NFS or similar.

In an case, read the Wikipedia article first.

0

Not automagically as far as I know.
You will have to temporarily mount the share someplace else.
Move the files to the share.
Then remount the share over the original folder.

Tonny
  • 6,332
  • 1
  • 18
  • 31