On 20/04/2016:10:15:54 AM, Dave Young wrote:
On 04/18/16 at 03:23pm, Pratyush Anand wrote:
> kdump also passes persistent device mapping as --mount or --device argument
> of dracut. However this persistent id (UUID) is changed if dump target is
> re-formated.
> kdumpctl must have a mechanism to recognise this modification, so that its
> service restart is able to rebuild initramfs.
>
> Testing:
> a) Attach an IDE device, lets say it is /dev/sdb1
> b) Format it as ext4
> # mkfs.ext4 /dev/sdb1
> # blkid /dev/sdb1
> /dev/sdb1: UUID="21c7baff-e35d-49c7-aa08-0fba4513f5bf"
TYPE="ext4"
> c) Mount it into /mnt and create a var/crash directory in it.
> # mount /dev/sdb1 /mnt;mkdir /mnt/var;mkdir /mnt/var/crash
> d) Add following line in /etc/kdump.conf
> ext4 /dev/sdb1
> e) Restart kdumpctl
> # kdumpctl restart
> f) crash
> # echo c > /proc/sysrq-trigger
> g) Here you will be able save vmcore with or without this patch.
> h) repeat step (b), (c), (e) and (f)
> i) Now you will be able to save vmcore only when you have this patch in
> your kexec-tools. Your initramfs will be rebuilt when you repeat step (e)
> after reformatting.
>
> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
> ---
> kdumpctl | 39 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/kdumpctl b/kdumpctl
> index 8ef11501342b..5b8b8c82be4d 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -359,6 +359,39 @@ is_files_modified()
> return 0
> }
>
> +is_dump_target_modified()
Nitpick: how about change the function name to is_fs_uuid_changed so that
it is more straiforward, we can have other case in the future for dump target
modification..
OK.
~Pratyush