Bug 620461

Summary: halt error with bind-mount fstab entries
Product: Red Hat Enterprise Linux 6 Reporter: Philip Rowlands <phr>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: azelinka, jscotka, notting, plautrba
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: initscripts-9.03.18-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:51:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 695373    
Bug Blocks:    

Description Philip Rowlands 2010-08-02 15:20:20 UTC
My /etc/fstab file has a line:

/    /mnt/rootbind     auto    defaults,bind   0 0

which confuses /etc/init.d/halt; specifically in the "Remounting remaining filesystems readonly" section.

This is because, when using its "device | dir" syntax, mount appears to prefer devices over directories.

When halt executes:
  fstab-decode mount -n -o ro,remount /

the error message I see is:
  mount: /mnt/rootbind not mounted already, or bad option

and that the / filesystem is not remounted read-only. Note that at this point /mnt/rootbind has already been successfully unmounted, and that mount is matching the "/" argument to fstab's fs_spec column, then trying to remount the corresponding fs_file.

The suggested fix is to prevent mount from reading /etc/fstab by passing both device and directory args, e.g.:

mount | awk '{ print $1,$3 }' | while read dev dir; do
    fstab-decode mount -n -o ro,remount $dev $dir
done

Comment 2 RHEL Program Management 2010-08-02 15:47:39 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 Philip Rowlands 2010-08-02 21:37:52 UTC
Thanks for the quick response. I think it'll need

-mount | awk '{ print $1,$3 }' | while read $dev $dir; do
+mount | awk '{ print $1,$3 }' | while read dev dir; do

Comment 5 Bill Nottingham 2010-08-02 21:47:43 UTC
Gah, you're right. Fixed.

Comment 14 errata-xmlrpc 2011-05-19 13:51:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0647.html