[PATCH v4] Filtered out "noauto" options in 2nd kernel fstab
by Qiao Zhao
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".
---
mkdumprd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..216354d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,8 @@ 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)
+ # "noauto" options will fail dump, remove "noauto" in 2nd kernel fstab.
+ _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.
--
1.9.3
8 years, 11 months
[PATCH] make kdump work when kernel crash after shutdown
by Chao Fan
Takeshi Nishimura fonud a bug, that vmcore is not created if panic occurs during shutdown.
We find when shutdown, the kdump will stopped by systemd and then kdump will not work if kernel crash.
In RHEL-6,kdump will not be stopped when shutdown, but it will be in RHEL-7.
I change the file of kdump.service and add "DefaultDependencies=no" to the
[Unit] of kdump.service to make kdump not stopped by systemd after shutdown
command.
The manpage of systemd.unit about the DefaultDependencies:Takes a boolean ar
gument. If true, (the default), a few default dependencies will implicitly b
e created for the unit. The actual dependencies created depend on the unit ty
pe. For example, for service units, these dependencies ensure that the ser
vice is started only after basic system initialization is completed and is pro
perly terminated on system shutdown. See the respective man pages for details
. Generally, only services involved with early boot or late shutdown should s
et this option to false. It is highly recommended to leave this option enabl
ed for the majority of common units. If set to false, this option does not d
isable all implicit dependencies, just non-essential ones.
The mail to the systemd:http://lists.freedesktop.org/archives/systemd-devel/2015-April/03...
And follow the suggestion of systemd, add "basic.target" to "After=" to mak
e kdump can run auto when power on.
Signed-off-by: Chao Fan <cfan(a)redhat.com>
---
kdump.service | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kdump.service b/kdump.service
index 24c1386..5144597 100644
--- a/kdump.service
+++ b/kdump.service
@@ -1,6 +1,7 @@
[Unit]
Description=Crash recovery kernel arming
-After=network.target network-online.target remote-fs.target
+After=network.target network-online.target remote-fs.target basic.target
+DefaultDependencies=no
[Service]
Type=oneshot
--
2.1.0
8 years, 11 months
[PATCH v3] Filtered out "noauto" options in 2nd kernel fstab
by Qiao Zhao
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".
---
mkdumprd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..f20b0c7 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,8 @@ 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)
+ # noauto options will fail nfs dump, remove "noauto" in 2nd kernel fstab.
+ _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.
--
1.9.3
8 years, 11 months
[PATCH V2] remove "noauto" options in 2nd kernel fstab.
by Qiao Zhao
Configure kdump.conf for nfs: "nfs 192.168.4.1:/mnt/remotenfs", and
use fs option "noauot" in fstab, i.e. "192.168.4.1:/mnt/remotenfs /mnt/nfs nfs noauto 0 0",
then mount the nfs report "mount /mnt/nfs".
Rebuild kdumpinitrd and trigger crash: "echo c > /proc/sysrq-tirgger", kdump fail.
In non-root disk dump, it has the same problem. Root dump is ok.
Because "noauot" option will fail kdump.
Check rebuild kdumpinitrd file:
"lsinitrd /boot/initramfs-$(uname -r)kdump.img /etc/fstab", and will
got "192.168.122.4.1:/mnt/remotenfs /kdumproot//mnt/nfs nfs4 noauto 0 2".
According to Baoquan He and Minfei Huang suggestions, remove "noauto"
option in 2nd kernel fstab. And I have test patch in my kvm guest, the patch works well.
Signed-off-by: Qiao Zhao <qzhao(a)dhcp-12-144.nay.redhat.com>
---
mkdumprd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..385998d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,8 @@ 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)
+ #noauto options will fail nfs dump, remove "noauto" in 2nd kernel fstab.
+ [[ $_options =~ "noauto" ]] && _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.
--
1.9.3
8 years, 11 months