Why doesn’t mount respect the ro option

ext4mountreadonly

I have a server where a partition (/var) switched to read-only. So I try to reproduce this problem on another server with the following command.

mount -o remount,ro /var/ -f

When I check our application log on that same partition I remounted ro I see entries recently added.

tail -f /var/log/httpd/*

CentOS 6.7

Apache: 2.2.15

uname -r: 2.6.32-573.7.1.el6.x86_64

Best Answer

It is the correct behaviour.

You use the -f flag, which mean:

-f, --fake: Causes everything to be done except for the actual system call; if it's not obvious, this ``fakes'' mounting the filesystem. This option is useful in conjunction with the -v flag to determine what the mount command is trying to do. It can also be used to add entries for devices that were mounted earlier with the -n option. The -f option checks for an existing record in /etc/mtab and fails when the record already exists (with a regular non- fake mount, this check is done by the kernel).

See also Remount a busy disk to read-only mode.

Related Question