Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com --- mkdumprd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..6ade88a 100644 --- a/mkdumprd +++ b/mkdumprd @@ -102,7 +102,13 @@ to_mount() { _source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev) # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit - _target="/sysroot$_target" + + if [ $_target = "/" ];then + _target="/sysroot" + else + _target="/kdumproot/$_target" + fi + _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev) @@ -368,6 +374,7 @@ handle_default_dump_target() fi }
+ get_default_action_target() { local _target
On 12/30/14 at 04:14pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..6ade88a 100644 --- a/mkdumprd +++ b/mkdumprd @@ -102,7 +102,13 @@ to_mount() { _source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev) # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
Hey, you missed the above comment. If the mount point moved under /kdumproot/, we should umount /kdumproot/xxx in addtion to /sysroot/.
- _target="/sysroot$_target"
- if [ $_target = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
@@ -368,6 +374,7 @@ handle_default_dump_target() fi }
Superfluous newline?
Thanks WANG Chao
get_default_action_target() { local _target -- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/30/14 at 05:25pm, WANG Chao wrote:
On 12/30/14 at 04:14pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..6ade88a 100644 --- a/mkdumprd +++ b/mkdumprd @@ -102,7 +102,13 @@ to_mount() { _source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev) # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
Hey, you missed the above comment. If the mount point moved under /kdumproot/, we should umount /kdumproot/xxx in addtion to /sysroot/.
Yes, will change this and below extra line. Thanks Chao.
- _target="/sysroot$_target"
- if [ $_target = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
@@ -368,6 +374,7 @@ handle_default_dump_target() fi }
Superfluous newline?
Thanks WANG Chao
get_default_action_target() { local _target -- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com --- mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..ad2159b 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev) - # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit - _target="/sysroot$_target" + # mount under /sysroot if dump to root disk or mount under + #/kdumproot/$_target in other cases in 2nd kernel, and we + #umount -R /sysroot or /kdumproot/$_target before exit + + if [ $_target = "/" ];then + _target="/sysroot" + else + _target="/kdumproot/$_target" + fi + _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
On 01/04/15 at 01:16pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..ad2159b 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel, and we
- #umount -R /sysroot or /kdumproot/$_target before exit
Sorry I didn't remember correctly at the first place so I probally gave a wrong comment previously.
Actually above comment is incorrect. We don't unmount any fs manually right now. We let systemd take care of unmounting. Check out the following commit:
commit 5a77531 Author: WANG Chao chaowang@redhat.com Date: Tue Aug 5 13:18:35 2014 +0800
Let systemd handle unmount
I think we can remove the comment or change it, say "systemd will take care of unmounting" or something like that.
Thanks WANG Chao
- if [ $_target = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
On 01/04/15 at 01:33pm, WANG Chao wrote:
On 01/04/15 at 01:16pm, Baoquan He wrote: @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel, and we
- #umount -R /sysroot or /kdumproot/$_target before exit
Sorry I didn't remember correctly at the first place so I probally gave a wrong comment previously.
Actually above comment is incorrect. We don't unmount any fs manually right now. We let systemd take care of unmounting. Check out the following commit:
commit 5a77531 Author: WANG Chao chaowang@redhat.com Date: Tue Aug 5 13:18:35 2014 +0800
Let systemd handle unmount
I think we can remove the comment or change it, say "systemd will take care of unmounting" or something like that.
Saying something is better, I will change it to systemd being in charge.
Thanks WANG Chao
- if [ $_target = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
On 01/04/15 at 01:16pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..ad2159b 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel, and we
- #umount -R /sysroot or /kdumproot/$_target before exit
- if [ $_target = "/" ];then
quote $_target should be better, not sure if it can be nul string, it it guranteed at least a slash here?
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 01/04/15 at 01:34pm, Dave Young wrote:
On 01/04/15 at 01:16pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..ad2159b 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel, and we
- #umount -R /sysroot or /kdumproot/$_target before exit
- if [ $_target = "/" ];then
quote $_target should be better, not sure if it can be nul string, it it guranteed at least a slash here?
It's the least that it's a slash. But add a quote is better. Will do.
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com --- mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..4d251ba 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev) - # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit - _target="/sysroot$_target" + # mount under /sysroot if dump to root disk or mount under + #/kdumproot/$_target in other cases in 2nd kernel. systemd + #will be in charge to umount it. + + if [ "$_target" = "/" ];then + _target="/sysroot" + else + _target="/kdumproot/$_target" + fi + _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
On Sun, Jan 04, 2015 at 01:49:43PM +0800, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..4d251ba 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel. systemd
- #will be in charge to umount it.
- if [ "$_target" = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 01/08/15 at 07:00pm, Jerry Hoemann wrote:
On Sun, Jan 04, 2015 at 01:49:43PM +0800, Baoquan He wrote: diff --git a/mkdumprd b/mkdumprd
index a30d9ca..4d251ba 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel. systemd
- #will be in charge to umount it.
- if [ "$_target" = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
--
With path == "/var/crash" I tested kdump with partitions
/ /var /var/crash / /var / / /var/crash
All dumped successfully.
Thanks for your quick response, Jerry.
Tested-by: Jerry Hoemann jerry.hoemann@hp.com
Jerry Hoemann Software Engineer Hewlett-Packard
3404 E Harmony Rd. MS 36 phone: (970) 898-1022 Ft. Collins, CO 80528 FAX: (970) 898-0707 email: jerry.hoemann@hp.com
On 01/04/15 at 01:49pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..4d251ba 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel. systemd
- #will be in charge to umount it.
- if [ "$_target" = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Acked-by: Dave Young <ruyang@redhat.com
Thanks Dave
On 01/04/15 at 01:49pm, Baoquan He wrote:
Jerry Hoemann reported a bug that a mount will fail when he installed a system with separate "/" "/var" and "/var/crash". That means root disk /dev/a mounted on /, and another disk /dev/b is mounted on /var, then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail since mount will fail.
This is because the mount information will be written into /$mntimage/etc/fstab like below. And the dump target is /dev/c. However /dev/b is not related in kdump, its mount info is not necessary and not saved. So when go into kdump kernel, it will find there's not a crash dir under /sysroot/var. And in current implementation, if not a root disk dump, sysroot is a read-only mount, no dir can be created in this situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump target is a root disk, mount point is /sysroot. If dump target is not root, just mount it to /kdumproot/$_target. Now it works.
ACK
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd index a30d9ca..4d251ba 100644 --- a/mkdumprd +++ b/mkdumprd @@ -101,8 +101,16 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev) _target=$(findmnt -k -f -n -r -o TARGET $_dev)
- # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
- # mount under /sysroot if dump to root disk or mount under
- #/kdumproot/$_target in other cases in 2nd kernel. systemd
- #will be in charge to umount it.
- if [ "$_target" = "/" ];then
_target="/sysroot"
- else
_target="/kdumproot/$_target"
- fi
- _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev) _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev) [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
-- 1.8.5.3