Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


/srv/www/  /home/user/ 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?

share|improve this question
up vote 5 down vote accepted

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

mount --bind /src/www/ /home/user/

If you want to add it to the /etc/fstab file, it would look like:

/srv/www/  /home/user/ bind defaults,bind 0 0

However, I'd carefully consider why a symbolic link isn't sufficient before dealing with bind mounts.

share|improve this answer
It's because I chroot them to the home. – Doug Feb 27 '12 at 0:24
That's a valid reason to use a bind mount in my book :-) – Kyle Smith Feb 27 '12 at 0:28
Take great care when removing a chroot tree. rm -rf will descend into a bind mount. – Simon Richter Feb 27 '12 at 7:54

What you want to do is a symbolic link:

ln -s /srv/www/  /home/user/ 

See man ls.

share|improve this answer
I cannot make changes to a mount? – Doug Feb 26 '12 at 23:46
You cannot mount a directory, just a complete file system, so the whole line in /etc/fstab doesn't make any sense. ln is the way to do what you want. Just try it. – Sven Feb 26 '12 at 23:53

Your Answer


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.