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 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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
Thanks, I'm going to check this out. If it works I'll check it :-) –  bvl Apr 19 '13 at 13:38

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.

share|improve this answer

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.