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'm just wondering if I need to restart my server after editing fstab and mtab. I changed something in this file manually due to problem with awstats report.

I am using ISPConfig 3 with the help of the tutorial from howtoforge. But due to removing/deleting of some account, the configuration of fstab and mtab messed up.

I also ask this question at howtoforge forum but until now no one has answered. If you'd like to read my question please visit it here.

I tried very hard to fix the problem w/o luck.

Update:

Here's what happen to my fstab:

Before the value was (I omitted the other):

/var/log/ispconfig/httpd/mydomain.com /var/www/clients/client1/web1/log    none    bind,nobootwait    0 0
/var/log/ispconfig/httpd/example.com /var/www/clients/client1/web2/log    none    bind,nobootwait    0 0

So I changed it to the correct path:

/var/log/ispconfig/httpd/mydomain.com /var/www/clients/client1/web2/log    none    bind,nobootwait    0 0
/var/log/ispconfig/httpd/example.com /var/www/clients/client1/web3/log    none    bind,nobootwait    0 0

I also found mtab to have the same value as above that's why I edited it manually.

from:

/var/log/ispconfig/httpd/mydomain.com /var/www/clients/client1/web1/log none rw,bind 0 0
/var/log/ispconfig/httpd/example.com /var/www/clients/client1/web2/log none rw,bind 0 0

to:

/var/log/ispconfig/httpd/mydomain.com /var/www/clients/client1/web2/log none rw,bind 0 0
/var/log/ispconfig/httpd/example.com /var/www/clients/client1/web3/log none rw,bind 0 0

I edited those value because the correct path of mydomain.com and example.com should be under web2 and web3 folder respectively.

As of now the log of example.com is pointed to:

/var/www/clients/client1/web2/log

when it should be:

/var/www/clients/client1/web3/log

So I am thinking that this is because of fstab and mtab.

Please guide me how to point the log correctly to it's default directory.

I explain the scenario one by one at this link.

to dawud:

Based on your example mount -o remount,noexec /var, should I run mount -o remount,noexec /var/log/ispconfig/httpd/example.com?

share|improve this question

3 Answers 3

You don't edit /etc/mtab manually.

You can, though, change your /etc/fstab to add or remove persistent mount points, i.e. the ones that will be mounted on startup. Also, the /etc/fstab file is used by the mount(8) command to refer to mount points.

You can safely define new mount points, or delete existing ones in /etc/fstab without altering the current state of the OS. You can manually mount(8) and umount(8) filesystems that reflect those changes; and you can also remount already mounted filesystems with dfferent options, e.g.:

mount -o remount,noexec /var

The question here is, why do you think you need bind mount points at all and what do you think you are going to achieve by using them? But I disgress.

When dealing with bind mount points, the steps to reconfigure your filesystems layout without restarting should be:

  1. Don't edit /etc/mtab manually
  2. stop the applications and services that use the filesystems you are going to modify. This is not always possible, but your use case seems to involve only filesystems dedicated to host log files under /var.
  3. umount all bind mount points.
  4. rewrite /etc/fstab to match your needs.
  5. manually mount the filesystems.
share|improve this answer
    
Hi, I update my post above. Please read the scenario. –  jaypabs Jun 27 '13 at 10:15
    
Actually I don't know why there is a bind mount points. I'm using the tutorial from link and I did not add it myself... –  jaypabs Jun 27 '13 at 12:01

File /etc/mtab is maintained by the operating system. Don't edit it.

File /etc/fstab defines what should be mounted. It is read at system start.

When I add an extra disk to a system that should be mounted at system start I add it to /etc/fstab.

To check the correctness of the updated /etc/fstab I use the command mount -a. That reads /etc/fstab as system start, it mounts filesytems that aren'nt yet mounted.

It gives an error when the mountpoint is missing or the device is missing.

To answer the question on rebooting: No, there is no need to reboot after editing /etc/fstab. You can testdrive with mount -a

share|improve this answer

mtab lists currently mounted filesystems, so it is written by the system and its content will change after, say, a reboot, an umount or a new mount. fstab lists available filesystems and is persistent, i.e. it will survive a reboot.

You should not edit mtab directly.

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.