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 <vgoyal@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
This commit is contained in:
Vivek Goyal 2014-07-24 13:43:48 -04:00 committed by WANG Chao
parent 072fa3a65a
commit 7f2717aa0a
1 changed files with 5 additions and 0 deletions

View File

@ -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"