any suggestions?
On Wed, Aug 15, 2018 at 6:44 PM, Kenneth Dsouza <kdsouza(a)redhat.com> wrote:
> From: Kenneth D'souza <kdsouza(a)redhat.com>
>
> Changes since v1: Added warning instead of error.
>
> Currently the kdumpctl script doesn't check if the raw device is
> formatted which might destroy existing data at the time of dump
> capture.
>
> This patch addresses this issue, by ensuring kdumpctl prints
> a warning in case it finds the raw device to be formatted.
>
> Signed-off-by: Kenneth D'souza <kdsouza(a)redhat.com>
> ---
> kdumpctl | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kdumpctl b/kdumpctl
> index 6a01c13..201586c 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -779,6 +779,11 @@ save_raw()
> echo "raw partition $raw_target not found"
> return 1
> }
> + check_fs=$(lsblk --nodeps -npo FSTYPE $raw_target)
> + if [[ $(echo $check_fs | wc -w) -ne 0 ]]; then
> + echo "Warning: Detected '$check_fs' signature on
$raw_target, data loss is expected."
> + return 0
> + fi
> kdump_dir=`grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2-`
> if [ -z "${kdump_dir}" ]; then
> coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
> --
> 2.14.3
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...