Filtered out "noauto" options in 2nd kernel fstab

Customer found when specify "noauto" option in fstab for nfs mount,
dump failed.

The reason is if "noauto" option is specified in fstab, the mount entry
in fstab related to dump target will passed to dracut and stored in
kdump initrd. Then during kdump kernel boots this entry containing
"noauto" will be ignored by mount service. This cause dump failing.
In fact with "noauto" not only nfs dump will fail, non-root disk dump
will fail too. root disk dump can dump successfully since root disk can
always be mounted by systemd.

So now "noauto" need be filtered out when the fstab entry corresponding
to dump target contains "noauto".

Changelog:
v4 -> v5
code comment is not clear enough. supplement it.

Signed-off-by: Qiao Zhao <qzhao@redhat.com>
Acked-by: Minfei Huang <mhuang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
Qiao Zhao 2015-05-14 16:48:58 +08:00 committed by Baoquan He
parent 0a9851e2fc
commit e4a99f7523
1 changed files with 3 additions and 0 deletions

View File

@ -117,6 +117,9 @@ to_mount() {
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
_options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
# kernel, filter it out here.
_options=$(echo $_options | sed 's/noauto//')
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
# "x-initrd.mount" mount failure will trigger isolate emergency service
# W/o this, systemd won't isolate, thus we won't get to emergency.