/etc/fstab
/srv/www/test.com /home/user/test.com auto nouser,auto,rw,sync 0 0
I am getting the following error: mount: you must specify the filesystem type
. Could someone please give me some insight? I am trying to mount a directoryA into directoryB and allow any changes (add new files, edit files). Also, if I make changes to a file in the mount, it would automatically change the original right?
mount
attaches a device node (physical disk, remote nfs mount, etc.) to a directory. What you're trying to do is map one directory to another directory. There are a few ways to handle this.The most common is called a symbolic link. It essentially creates a filesystem entry that redirects to another location within the filesystem. If you simply want user to be able to access the document root of test.com from inside his home directory, this is the most simple approach.
Alternatively, you can use the
bind
mount type. You must be sure that the target directory exists before you use this type, or you won't get the results you're expecting. This can be done at the commandline with:If you want to add it to the
/etc/fstab
file, it would look like:However, I'd carefully consider why a symbolic link isn't sufficient before dealing with
bind
mounts.What you want to do is a symbolic link:
See
man ls
.