When user only provided a "path" value in kdump.conf without explicitly specify a dump target, covering all cases with "path" config value is complex.
"path" could be a mount point, a dir insidse a mount point, or nested mount, bind mount etc. kdump need to detect the real dump target based on the "path" value, so user have to be carefull with it and in charge of creating it.
But for user specified dump target (dump target explicitly specified with nfs/ext4/xfs/...), the "path" config have only one sole meaning: the absolute dump path on a dump target. In this case it's safe for kdump to create it automatically.
Signed-off-by: Kairui Song kasong@redhat.com --- mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index cc37ae18..0dc4459e 100644 --- a/mkdumprd +++ b/mkdumprd @@ -242,7 +242,8 @@ check_user_configured_target()
# For user configured target, use $SAVE_PATH as the dump path within the target if [[ ! -d "$_mnt/$SAVE_PATH" ]]; then - perror_exit "Dump path "$_mnt/$SAVE_PATH" does not exist in dump target "$_target"" + dwarn "Dump path "$SAVE_PATH" does not exist on dump target "$_target", kdump will create this path automatically." + mkdir -p "$_mnt/$SAVE_PATH" || perror_exit "Failed to create dump path "$SAVE_PATH" on dump target." fi
check_size fs "$_target"
On Fri, 27 Aug 2021 16:37:36 +0800 Kairui Song kasong@redhat.com wrote:
When user only provided a "path" value in kdump.conf without explicitly specify a dump target, covering all cases with "path" config value is complex.
"path" could be a mount point, a dir insidse a mount point, or nested mount, bind mount etc. kdump need to detect the real dump target based on the "path" value, so user have to be carefull with it and in charge of creating it.
But for user specified dump target (dump target explicitly specified with nfs/ext4/xfs/...), the "path" config have only one sole meaning: the absolute dump path on a dump target. In this case it's safe for kdump to create it automatically.
Signed-off-by: Kairui Song kasong@redhat.com
Acked-by: Philipp Rudo prudo@redhat.com
mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index cc37ae18..0dc4459e 100644 --- a/mkdumprd +++ b/mkdumprd @@ -242,7 +242,8 @@ check_user_configured_target()
# For user configured target, use $SAVE_PATH as the dump path within the target if [[ ! -d "$_mnt/$SAVE_PATH" ]]; then
perror_exit "Dump path \"$_mnt/$SAVE_PATH\" does not exist in dump target \"$_target\""
dwarn "Dump path \"$SAVE_PATH\" does not exist on dump target \"$_target\", kdump will create this path automatically."
mkdir -p "$_mnt/$SAVE_PATH" || perror_exit "Failed to create dump path \"$SAVE_PATH\" on dump target."
fi
check_size fs "$_target"