From 7f2717aa0ad98c01a32a59735f0579498fee84ec Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Thu, 24 Jul 2014 13:43:48 -0400 Subject: [PATCH] dracut-kdump.sh: Issue a sync after saving vmcore-dmesg.txt Recently somebody reported an issue where vmcore-dmesg.txt was saved successfully but later saving vmcore failed to due to lack of space on disk. System rebooted but after reboot there was nothing on disk. Not even vmcore-dmesg.txt. Issue a sync after saving vmcore-dmesg.txt to solve this issue. I think this is happening because we are doing "reboot -f" instead of going through systemd reboot path. Anyway, doing a sync now should take care of this. Signed-off-by: Vivek Goyal Acked-by: WANG Chao --- dracut-kdump.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dracut-kdump.sh b/dracut-kdump.sh index 9958317..e6faf9c 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -179,6 +179,11 @@ save_vmcore_dmesg_fs() { _exitcode=$? if [ $_exitcode -eq 0 ]; then mv ${_path}/vmcore-dmesg-incomplete.txt ${_path}/vmcore-dmesg.txt + + # Make sure file is on disk. There have been instances where later + # saving vmcore failed and system rebooted without sync and there + # was no vmcore-dmesg.txt available. + sync echo "kdump: saving vmcore-dmesg.txt complete" else echo "kdump: saving vmcore-dmesg.txt failed"