<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 11 Mar 2015, at 00:58, Jeremy Laidman <<a href="mailto:jlaidman@rebel-it.com.au" class="">jlaidman@rebel-it.com.au</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On 11 March 2015 at 00:44, Thomas Eckert <span dir="ltr" class=""><<a href="mailto:thomas.eckert@it-eckert.de" target="_blank" class="">thomas.eckert@it-eckert.de</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Just for future reference as you already found your solution:</div><div class=""><br class=""></div>From looking at the util-linux package I understand that _if_ the /proc-filesystem is mounted the information is used from there.</div></blockquote><div class=""><br class=""></div><div class="">I don't think this is the case.  Running "strace" on the "mount" command shows that it first looks at /etc/mtab, and if that exists, it doesn't look at /proc/mounts.  Only if /etc/mtab doesn't exist, does mount look at /proc/mounts.</div></div></div></div></div></blockquote><div><br class=""></div><div>Strange, I did also check with strace and did not see `/etc/mtab` used. This is on Debian 7.x, Debian kernel 3.2.0-4-amd64 and util-linux 2.20.1-5.3</div><div><br class=""></div><div><div><span class="Apple-tab-span" style="white-space:pre">      </span>root@bb:~# strace -e trace=open mount 2>&1 | egrep 'mtab|proc'</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>open("/proc/filesystems", O_RDONLY)     = 3</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>open("/proc/self/mountinfo", O_RDONLY)  = 3</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)</div></div><div><br class=""></div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">So in a situation where the filesystem containing /etc is having problems and goes read-only, /etc/mtab won't get updated because it's now read-only.</div></div></div></div>
</blockquote></div><div><br class=""></div><div>Agreed.</div><div>So re-using the `mount`-info for the r/o-check is at least highly dependent on the individual environment and versions.</div><div><br class=""></div><div>Cheers</div><div>Thomas</div><div><br class=""></div><br class=""></body></html>