Skip to contentSkip to conversation

dracut does not mount iscsi targets specified using --mount option

DISCUSSION Vivek Goyal 4 participants 27 messages Apr 18, 2012 – Apr 30, 2012 19 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

Note there is a multipath target over iscsi devices and that target is mounted on /mnt/common. Hence specified using "--mount /dev/mapper/mpatha /mnt/common"

Following is list of modules being included by dracut (printed on standard output due to -M option).

rpmversion
dm
kernel-modules
lvm
multipath
fstab-sys
rootfs-block
udev-rules
base
fs-lib
kdumpbase
shutdown

I thought that once you specify a mount using "--mount" option, dracut will traverse through the full device stack, figure out all the dependencies, include all the modules and bring up the full stack in the kernel and mount the top level device. Is that not the case?

BTW, I have done testing with multipath targets (without iscsi) and it works. So multipath is not the issue. But iscsi is.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 31 lines · Vivek Goyal

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

Note there is a multipath target over iscsi devices and that target is mounted on /mnt/common. Hence specified using "--mount /dev/mapper/mpatha /mnt/common"

Following is list of modules being included by dracut (printed on standard output due to -M option).

rpmversion
dm
kernel-modules
lvm
multipath
fstab-sys
rootfs-block
udev-rules
base
fs-lib
kdumpbase
shutdown

Quoted 7 lines

I thought that once you specify a mount using "--mount" option, dracut will traverse through the full device stack, figure out all the dependencies, include all the modules and bring up the full stack in the kernel and mount the top level device. Is that not the case?

BTW, I have done testing with multipath targets (without iscsi) and it works. So multipath is not the issue. But iscsi is.

I think this is a bug, dracut fails to detect iscsi thus doesn't include the iscsi module.

Vivek, can you try to add 'set -x' in the check() function in module-setup.sh of iscsi module to get some debugging info? Especially is_iscsi().

Thanks for testing!

#3 lore raw
In reply to a message not in the archive

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 10 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 8 lines · Harald Hoyer

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 7 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Quoted 6 lines
Quoted 3 lines

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Interesting, multipath and lvm etc. modules are added by dracut when it is needed by --mount, so why iscsi is special here?

Quoted 2 lines

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I thought "--add" is plus for "-m", so the initial module has to be added via "-m" in cmdline? Seems I was wrong, but could this be the reason that causes iscsi module not loaded?

Thanks!

#6 lore raw

Am 20.04.2012 08:45, schrieb Cong Wang:

Quoted 20 lines · Harald Hoyer
Quoted 8 lines

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 7 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Quoted 6 lines
Quoted 3 lines

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Interesting, multipath and lvm etc. modules are added by dracut when it is needed by --mount, so why iscsi is special here?

Quoted 1 line
Quoted 8 lines
Quoted 1 line

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I thought "--add" is plus for "-m", so the initial module has to be added via "-m" in cmdline? Seems I was wrong, but could this be the reason that causes iscsi module not loaded?

Thanks!

You can send me the output of dracut with the "--debug" option added to inspect it further.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 17 lines · Vivek Goyal

On Fri, Apr 20, 2012 at 10:42:34AM +0200, Harald Hoyer wrote:

[..]

Quoted 11 lines
Quoted 8 lines
Quoted 1 line

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I thought "--add" is plus for "-m", so the initial module has to be added via "-m" in cmdline? Seems I was wrong, but could this be the reason that causes iscsi module not loaded?

Thanks!

You can send me the output of dracut with the "--debug" option added to inspect it further.

Hi Harald,

Quoted 8 lines

I ran dracut from command line (could not figure out how to capture the output of service to a file with systemd) and captured the output of --debug with "-m kdumpbase" and "--add kdumpbase".

For some reason it was complaining that module kdumpbase not found but I see that it is present in /lib/dracut/modules.d. Anyway, I am attaching both the outputs for you to have a look. Files are gzipped as they were big.

Just fyi, that is because kdump module checks an env variable at start, so you can use 'kdumpctl start' to run it manually instead of using dracut directly. :)

#10 lore raw
In reply to a message not in the archive
Quoted 8 lines · Harald Hoyer

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 7 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Quoted 8 lines
Quoted 3 lines

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I don't know why -m is being used instead of --add. I tried changing it to --add and uncompressed initramfs size changed from 36MB to 72MB.

To me 32MB size itself is big. IIRc, in RHEL6 using our own mkinitrd, we had uncomressed initrd size close to 25MB.

In kdump environment we work in very restricted memory conditions. Currently we reserve 128MB and there are calls to reduce it further. This 128MB should load kernel, initramfs and run all the tools in initramfs to actually save the vmcore to the target.

So we need to figure out how can we reduce the size of initramfs for kdump case. In the next mail I will add the output of --debug both for -m kdumpbase and --add kdumpbase.

From kdump perspective, we only need to mount targets as specified by --mount option. We might not want to mount even root and it depends on kdump.conf. If root is needed, we will pass that too on command line using --mount. So this is little different from -H option.

Can we modify dracut in such a way so that it packs only those modules need to mount targets as specified --mount options?

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw
Quoted 33 lines · Vivek Goyal
Quoted 8 lines · Harald Hoyer

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 7 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Quoted 8 lines
Quoted 3 lines

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I don't know why -m is being used instead of --add. I tried changing it to --add and uncompressed initramfs size changed from 36MB to 72MB.

To me 32MB size itself is big. IIRc, in RHEL6 using our own mkinitrd, we had uncomressed initrd size close to 25MB.

In kdump environment we work in very restricted memory conditions. Currently we reserve 128MB and there are calls to reduce it further. This 128MB should load kernel, initramfs and run all the tools in initramfs to actually save the vmcore to the target.

So we need to figure out how can we reduce the size of initramfs for kdump case. In the next mail I will add the output of --debug both for -m kdumpbase and --add kdumpbase.

Quoted 7 lines

From kdump perspective, we only need to mount targets as specified by --mount option. We might not want to mount even root and it depends on kdump.conf. If root is needed, we will pass that too on command line using --mount. So this is little different from -H option.

Can we modify dracut in such a way so that it packs only those modules need to mount targets as specified --mount options?

Yeah, I noticed this too, I think this is due to the dracut module "kernel-modules" includes more than enough kernel modules into initramfs, thus the size increased so much.

Harald, if you have any idea to improve this? We need to find a way to tell "kernel-modules" module to only include the ones we want.

Thanks.

#13 lore raw

Am 23.04.2012 06:11, schrieb Cong Wang:

Quoted 42 lines · Vivek Goyal
Quoted 33 lines · Harald Hoyer
Quoted 8 lines

Am 19.04.2012 00:28, schrieb Vivek Goyal:

Quoted 7 lines

Hi,

I am trying to dump kernel vmcore to an software iscsi target (kdump). kdump specifies the dump destination using "--mount" option. But dracut does not even include the "iscsi" module and associated device is not mounted in second kernel.

Quoted 8 lines
Quoted 3 lines

Following is the dracut command line as called by /sbin/mkdumprd.

dracut -m kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpatha /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,stripe=16,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

"-m kdumpbase" - This tells dracut to only use the kdumpbase dracut module So, because the iscsi dracut module is not added, dracut does not even check() it.

Why is it "-m kdumpbase" and not "--add kdumpbase" ???

I don't know why -m is being used instead of --add. I tried changing it to --add and uncompressed initramfs size changed from 36MB to 72MB.

To me 32MB size itself is big. IIRc, in RHEL6 using our own mkinitrd, we had uncomressed initrd size close to 25MB.

In kdump environment we work in very restricted memory conditions. Currently we reserve 128MB and there are calls to reduce it further. This 128MB should load kernel, initramfs and run all the tools in initramfs to actually save the vmcore to the target.

So we need to figure out how can we reduce the size of initramfs for kdump case. In the next mail I will add the output of --debug both for -m kdumpbase and --add kdumpbase.

Quoted 7 lines

From kdump perspective, we only need to mount targets as specified by --mount option. We might not want to mount even root and it depends on kdump.conf. If root is needed, we will pass that too on command line using --mount. So this is little different from -H option.

Can we modify dracut in such a way so that it packs only those modules need to mount targets as specified --mount options?

Quoted 6 lines

Yeah, I noticed this too, I think this is due to the dracut module "kernel-modules" includes more than enough kernel modules into initramfs, thus the size increased so much.

Harald, if you have any idea to improve this? We need to find a way to tell "kernel-modules" module to only include the ones we want.

Just activate the host-only mode "--hostonly" or "-H"

Quoted 3 lines

Thanks.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw
Quoted 3 lines · Harald Hoyer

Just activate the host-only mode "--hostonly" or "-H"

Well, -H will set host-only mode for all dracut modules, but here we want to activate host-only mode _only_ for kernel-modules module.

For other dracut modules, we use --add to only specify those we need, as you can see from Vivek's output.

#16 lore raw

Am 23.04.2012 09:53, schrieb Cong Wang:

Quoted 12 lines · Harald Hoyer
Quoted 3 lines

Just activate the host-only mode "--hostonly" or "-H"

Well, -H will set host-only mode for all dracut modules, but here we want to activate host-only mode _only_ for kernel-modules module.

For other dracut modules, we use --add to only specify those we need, as you can see from Vivek's output.

Why don't you want host-only mode for the other kernel modules?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw
Quoted 9 lines · Harald Hoyer

Am 23.04.2012 09:53, schrieb Cong Wang:

Quoted 8 lines · Harald Hoyer
Quoted 3 lines

Just activate the host-only mode "--hostonly" or "-H"

Well, -H will set host-only mode for all dracut modules, but here we want to activate host-only mode _only_ for kernel-modules module.

Quoted 6 lines
Quoted 4 lines

For other dracut modules, we use --add to only specify those we need, as you can see from Vivek's output.

Why don't you want host-only mode for the other kernel modules?

I think host-only should be reasonable but there should be scope for further optimization. IIUC, host-only will try to include all the modules which are needed to mount root and boot the machine. But in kdump, we might not want to mount root at all. We just might want to dump vmcore over NFS and reboot.

So the assumption that we will necessarily mount root is not valid in kdump context. I am not sure how much memory saving this extra optimization will lead to, but I will try passing -H and do some testing and see how size is varying.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw
Quoted 15 lines · Vivek Goyal
Quoted 14 lines · Harald Hoyer

Am 23.04.2012 09:53, schrieb Cong Wang:

Quoted 12 lines · Harald Hoyer
Quoted 3 lines

Just activate the host-only mode "--hostonly" or "-H"

Well, -H will set host-only mode for all dracut modules, but here we want to activate host-only mode _only_ for kernel-modules module.

For other dracut modules, we use --add to only specify those we need, as you can see from Vivek's output.

Quoted 7 lines
Quoted 1 line

Why don't you want host-only mode for the other kernel modules?

I think host-only should be reasonable but there should be scope for further optimization. IIUC, host-only will try to include all the modules which are needed to mount root and boot the machine. But in kdump, we might not want to mount root at all. We just might want to dump vmcore over NFS and reboot.

Yes, exactly. The last time I tried host-only, it included more dracut modules than what we need, thus increased the initrd size.

(The other reason is, as you replied in another email, host-only doesn't respect --mount, this also means "network" module will not be included when I dump to NFS but my rootfs is not NFS.)

Quoted 5 lines

So the assumption that we will necessarily mount root is not valid in kdump context. I am not sure how much memory saving this extra optimization will lead to, but I will try passing -H and do some testing and see how size is varying.

Before this, we have to fix -H to work with --mount. ;-)

#21 lore raw

On Tue, Apr 24, 2012 at 11:18:09AM +0800, Cong Wang wrote:

[..]

Quoted 10 lines
Quoted 7 lines
Quoted 1 line

Why don't you want host-only mode for the other kernel modules?

I think host-only should be reasonable but there should be scope for further optimization. IIUC, host-only will try to include all the modules which are needed to mount root and boot the machine. But in kdump, we might not want to mount root at all. We just might want to dump vmcore over NFS and reboot.

Yes, exactly. The last time I tried host-only, it included more dracut modules than what we need, thus increased the initrd size.

For me using --hostonly seems to be producing smaller initramfs then what is produced by default in kdump today in F17.

I tried "-m kdumpbase" and my uncompressed initramfs size is around 36MB.

I tried "--add kdumpbase" and my uncompressed initramfs size is 72MB.

With "-add kdumpbase --host-only" uncompressed initramfs size is 18MB.

So with --hostonly size has come down. So why do you say that using hostonlly increased the size of initramfs.

Quoted 4 lines

(The other reason is, as you replied in another email, host-only doesn't respect --mount, this also means "network" module will not be included when I dump to NFS but my rootfs is not NFS.)

I did not say that --hostonly does not respect --mount in all the cases. Looks like it does not respect in case of multipath and iscsi as of today. I see code where --mount devices and fs is pushed into host_fs_types[]. I guess it is just a matter of parsing host_fs_types in multipath and things should work.

Quoted 7 lines
Quoted 5 lines

So the assumption that we will necessarily mount root is not valid in kdump context. I am not sure how much memory saving this extra optimization will lead to, but I will try passing -H and do some testing and see how size is varying.

Before this, we have to fix -H to work with --mount. ;-)

Following is a small patch which seems to fix the issue of dumping to multipath device for me. Is it this simple. Harald?

---
 lib/dracut/modules.d/90multipath/module-setup.sh |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
lib/dracut/modules.d/90multipath/module-setup.sh +8 -5
Index: /lib/dracut/modules.d/90multipath/module-setup.sh
===================================================================
@@ -17,11 +17,14 @@ check() {
     }
 
     if [[ $hostonly ]]; then
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            check_block_and_slaves is_mpath "$_rootdev" && return 0
-        fi
-        return 1
+	local _found
+	local _dev
+	for fs in ${host_fs_types[@]}; do
+		_dev=$(echo $fs | awk -F '|' '{print $1}')
+		is_mpath $(get_maj_min $_dev) && _found="1"
+	done
+	[[ $_found ]] || return 1
+	unset _found
     fi
 
     return 0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw

Am 24.04.2012 23:02, schrieb Vivek Goyal:

Quoted 33 lines

Following is a small patch which seems to fix the issue of dumping to multipath device for me. Is it this simple. Harald?

---
 lib/dracut/modules.d/90multipath/module-setup.sh |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Index: /lib/dracut/modules.d/90multipath/module-setup.sh
===================================================================

lib/dracut/modules.d/90multipath/module-setup.sh +8 -6
@@ -17,11 +17,14 @@ check() {
     }
 
     if [[ $hostonly ]]; then
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            check_block_and_slaves is_mpath "$_rootdev" && return 0
-        fi
-        return 1
+	local _found
+	local _dev
+	for fs in ${host_fs_types[@]}; do
+		_dev=$(echo $fs | awk -F '|' '{print $1}')
+		is_mpath $(get_maj_min $_dev) && _found="1"
+	done
+	[[ $_found ]] || return 1
+	unset _found
     fi
 
     return 0
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

it can be even simpler:

(quoted diff) +0 -0

b/modules.d/90multipath/module-setup.sh
index 2bc1b41..ae9ec59 100755

modules.d/90multipath/module-setup.sh +7 -9
@@ -11,18 +11,16 @@ check() {
     [[ $debug ]] && set -x
 
     is_mpath() {
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
     }
 
-    if [[ $hostonly ]]; then
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            check_block_and_slaves is_mpath "$_rootdev" && return 0
-        fi
-        return 1
-    fi
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        for_each_host_dev_fs is_mpath || return 1
+    }
 
     return 0
 }
modules.d/95iscsi/module-setup.sh +6 -10
index 2f343ee..34e101c 100755
@@ -15,8 +15,11 @@ check() {
     [[ $debug ]] && set -x
 
     is_iscsi() (
-        [[ -L /sys/dev/block/$1 ]] || return
-        cd "$(readlink -f /sys/dev/block/$1)"
+        local _dev
+        _dev=${1##/dev/}
+
+        [[ -L /sys/dev/block/$_dev ]] || return
+        cd "$(readlink -f /sys/dev/block/$_dev)"
         until [[ -d sys || -d iscsi_session ]]; do
             cd ..
         done
@@ -24,14 +27,7 @@ check() {
     )
 
     [[ $hostonly ]] || [[ $mount_needs ]] && {
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            # root lives on a block device, so we can be more precise about
-            # hostonly checking
-            check_block_and_slaves is_iscsi "$_rootdev" || return 1
-        else
-            return 1
-        fi
+        for_each_host_dev_fs is_iscsi || return 1
     }
     return 0
 }

A message that is not in the archive (sent off-list or not yet received): [email protected]

#25 lore raw

On Wed, Apr 25, 2012 at 11:26:15AM +0200, Harald Hoyer wrote:

Hi Harald,

[..]

modules.d/90multipath/module-setup.sh check() { · line 17

Quoted 7 lines
     is_mpath() {
modules.d/90multipath/module-setup.sh +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#27 lore raw

Am 25.04.2012 15:46, schrieb Vivek Goyal:

Quoted 13 lines · Harald Hoyer

Hi Harald,

[..]

Review

Quoted 7 lines
     is_mpath() {
(quoted diff) +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
Quoted 6 lines

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

oh.. you are right:

(quoted diff) +0 -0

b/modules.d/90multipath/module-setup.sh
index ae9ec59..2af112a 100755

modules.d/90multipath/module-setup.sh +1 -1
@@ -12,7 +12,7 @@ check() {
 
     is_mpath() {
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
         [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
         [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
modules.d/95iscsi/module-setup.sh +1 -1
index 34e101c..bfd9d73 100755
@@ -16,7 +16,7 @@ check() {
 
     is_iscsi() (
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
 
         [[ -L /sys/dev/block/$_dev ]] || return
         cd "$(readlink -f /sys/dev/block/$_dev)"

A message that is not in the archive (sent off-list or not yet received): [email protected]

#29 lore raw
Quoted 42 lines · Harald Hoyer

Am 25.04.2012 15:46, schrieb Vivek Goyal:

Quoted 13 lines · Harald Hoyer

Hi Harald,

[..]

Review

Quoted 7 lines
     is_mpath() {
(quoted diff) +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
Quoted 6 lines

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

oh.. you are right:

modules.d/90multipath/module-setup.sh +1 -1
index ae9ec59..2af112a 100755
@@ -12,7 +12,7 @@ check() {
 
     is_mpath() {
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
         [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
         [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
modules.d/95iscsi/module-setup.sh +0 -0
index 34e101c..bfd9d73 100755

modules.d/95iscsi/module-setup.sh check() { · line 22

Quoted 8 lines
modules.d/95iscsi/module-setup.sh +1 -1
@@ -16,7 +16,7 @@ check() {
 
     is_iscsi() (
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
 
         [[ -L /sys/dev/block/$_dev ]] || return
         cd "$(readlink -f /sys/dev/block/$_dev)"

Thanks Harald.

This fixes the issue for multipath.

For iscsi, I see that after this change iscsi module is included but iscsi target bring up still does not happen so iscsi luns don't show up in second kernel.

I think iscsi code might be assuing that we will pass some iscsi parameters on command line but we don't have any information and we don't pass anything. So iscsi module need save some files/state in initramfs during build and bring up iscsi targets accordingly.

In RHEL6, during the block device stack traversal, I had saved the target information in a file and packed that file in initramfs. And then invoked code in initramfs to specifically bring up those luns.

I need to read up some code and also see if network modules are being included or not and if networking is coming up or not before iscsi can come up.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#31 lore raw

Am 25.04.2012 16:14, schrieb Vivek Goyal:

Quoted 69 lines · Harald Hoyer
Quoted 42 lines

Am 25.04.2012 15:46, schrieb Vivek Goyal:

Quoted 13 lines · Harald Hoyer

Hi Harald,

[..]

Review

Quoted 7 lines
     is_mpath() {
(quoted diff) +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
Quoted 6 lines

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

oh.. you are right:

modules.d/90multipath/module-setup.sh +1 -1
index ae9ec59..2af112a 100755
@@ -12,7 +12,7 @@ check() {
 
     is_mpath() {
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
         [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
         [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
modules.d/95iscsi/module-setup.sh +0 -0
index 34e101c..bfd9d73 100755

modules.d/95iscsi/module-setup.sh check() { · line 22

Quoted 8 lines
modules.d/95iscsi/module-setup.sh +1 -1
@@ -16,7 +16,7 @@ check() {
 
     is_iscsi() (
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
 
         [[ -L /sys/dev/block/$_dev ]] || return
         cd "$(readlink -f /sys/dev/block/$_dev)"

Thanks Harald.

This fixes the issue for multipath.

For iscsi, I see that after this change iscsi module is included but iscsi target bring up still does not happen so iscsi luns don't show up in second kernel.

I think iscsi code might be assuing that we will pass some iscsi parameters on command line but we don't have any information and we don't pass anything. So iscsi module need save some files/state in initramfs during build and bring up iscsi targets accordingly.

In RHEL6, during the block device stack traversal, I had saved the target information in a file and packed that file in initramfs. And then invoked code in initramfs to specifically bring up those luns.

Quoted 6 lines

I need to read up some code and also see if network modules are being included or not and if networking is coming up or not before iscsi can come up.

Thanks
Vivek

Just drop a iscsi.conf file in the initramfs /etc/cmdline.d either via your module-setup.sh or:

echo 'netroot=iscsi:[<username>:<password>[:<reverse>:<password>]@][<servername>]:[<protocol>]:[<port>][:[<iscsi_iface_name>]:[<netdev_name>]]:[<LUN>]:<targetname>'

Quoted 1 line

iscsi.conf

dracut -i iscsi.conf /etc/cmdline.d/iscsi.conf ....

A message that is not in the archive (sent off-list or not yet received): [email protected]

#33 lore raw
Quoted 77 lines · Harald Hoyer

Am 25.04.2012 16:14, schrieb Vivek Goyal:

Quoted 69 lines · Harald Hoyer
Quoted 42 lines

Am 25.04.2012 15:46, schrieb Vivek Goyal:

Quoted 13 lines · Harald Hoyer

Hi Harald,

[..]

Review

Quoted 7 lines
     is_mpath() {
(quoted diff) +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
Quoted 6 lines

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

oh.. you are right:

modules.d/90multipath/module-setup.sh +1 -1
index ae9ec59..2af112a 100755
@@ -12,7 +12,7 @@ check() {
 
     is_mpath() {
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
         [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
         [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
modules.d/95iscsi/module-setup.sh +0 -0
index 34e101c..bfd9d73 100755

modules.d/95iscsi/module-setup.sh check() { · line 22

Quoted 8 lines
modules.d/95iscsi/module-setup.sh +1 -1
@@ -16,7 +16,7 @@ check() {
 
     is_iscsi() (
         local _dev
-        _dev=${1##/dev/}
+        _dev=$(get_maj_min $1)
 
         [[ -L /sys/dev/block/$_dev ]] || return
         cd "$(readlink -f /sys/dev/block/$_dev)"

Thanks Harald.

This fixes the issue for multipath.

For iscsi, I see that after this change iscsi module is included but iscsi target bring up still does not happen so iscsi luns don't show up in second kernel.

I think iscsi code might be assuing that we will pass some iscsi parameters on command line but we don't have any information and we don't pass anything. So iscsi module need save some files/state in initramfs during build and bring up iscsi targets accordingly.

In RHEL6, during the block device stack traversal, I had saved the target information in a file and packed that file in initramfs. And then invoked code in initramfs to specifically bring up those luns.

Quoted 6 lines

I need to read up some code and also see if network modules are being included or not and if networking is coming up or not before iscsi can come up.

Thanks
Vivek

Quoted 8 lines

Just drop a iscsi.conf file in the initramfs /etc/cmdline.d either via your module-setup.sh or:

echo 'netroot=iscsi:[<username>:<password>[:<reverse>:<password>]@][<servername>]:[<protocol>]:[<port>][:[<iscsi_iface_name>]:[<netdev_name>]]:[<LUN>]:<targetname>'

Quoted 1 line

iscsi.conf

dracut -i iscsi.conf /etc/cmdline.d/iscsi.conf ....

Problem is that I don't know all the details in kdump. Only thing user has told kdump is top level mount point. We don't even know that this mount point is on top of multipath + iscsi + underlying network.

I was hoping that iscsi dracut module will store all the relevant information when it finds a device is iscsi device and bring that device up in second kernel. That includes storing information about network card and bringing it up.

We have device traversal code in rhel6 mkdumprd but I end up duplicating all the code in rhel7 kdump, then it just increases the complexity in kdump module.

I was hoping that generic iscsi dracut-module will take care of storing all the info itself once it knows it has said "yes" to an iscsi device in check() function.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

#35 lore raw

Am 25.04.2012 17:02, schrieb Vivek Goyal:

Quoted 13 lines

Problem is that I don't know all the details in kdump. Only thing user has told kdump is top level mount point. We don't even know that this mount point is on top of multipath + iscsi + underlying network.

I was hoping that iscsi dracut module will store all the relevant information when it finds a device is iscsi device and bring that device up in second kernel. That includes storing information about network card and bringing it up.

We have device traversal code in rhel6 mkdumprd but I end up duplicating all the code in rhel7 kdump, then it just increases the complexity in kdump module.

Quoted 6 lines

I was hoping that generic iscsi dracut-module will take care of storing all the info itself once it knows it has said "yes" to an iscsi device in check() function.

Thanks
Vivek

Ok, here I could use some help from you guys.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#37 lore raw
Quoted 14 lines · Harald Hoyer

Am 25.04.2012 17:02, schrieb Vivek Goyal:

Quoted 13 lines

Problem is that I don't know all the details in kdump. Only thing user has told kdump is top level mount point. We don't even know that this mount point is on top of multipath + iscsi + underlying network.

I was hoping that iscsi dracut module will store all the relevant information when it finds a device is iscsi device and bring that device up in second kernel. That includes storing information about network card and bringing it up.

We have device traversal code in rhel6 mkdumprd but I end up duplicating all the code in rhel7 kdump, then it just increases the complexity in kdump module.

Quoted 8 lines
Quoted 6 lines

I was hoping that generic iscsi dracut-module will take care of storing all the info itself once it knows it has said "yes" to an iscsi device in check() function.

Thanks
Vivek

Ok, here I could use some help from you guys.

Sure I will look into it.

Thanks
Vivek

#38 lore raw
In reply to a message not in the archive
Quoted 14 lines · Harald Hoyer

Am 25.04.2012 15:46, schrieb Vivek Goyal:

Quoted 13 lines · Harald Hoyer

Hi Harald,

[..]

Quoted 7 lines
     is_mpath() {
(quoted diff) +4 -2
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=${1##/dev/}
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
Quoted 8 lines
Quoted 6 lines

Will this work? _dev is device name (sda) and /sys/dev/block/ has links based on device "maj:min". I applied this patch and ran dracut and I see that multipath module did not get included.

Thanks
Vivek

oh.. you are right:

Harald, I saw these patches committed in master branch of fedora tree. Are you planning to commit them for F17 too? They are not very intrusive so it might not be a bad idea? From my perspective, multipath kdump support gets enabled in F17 and my future testing becomes easier.

Thanks
Vivek

#40 lore raw
In reply to a message not in the archive
Quoted 9 lines · Harald Hoyer

Am 23.04.2012 09:53, schrieb Cong Wang:

Quoted 8 lines · Harald Hoyer
Quoted 3 lines

Just activate the host-only mode "--hostonly" or "-H"

Well, -H will set host-only mode for all dracut modules, but here we want to activate host-only mode _only_ for kernel-modules module.

Quoted 6 lines
Quoted 4 lines

For other dracut modules, we use --add to only specify those we need, as you can see from Vivek's output.

Why don't you want host-only mode for the other kernel modules?

						    ^^^^^^^^^^

You meant "dracut modules" probably? I have the same question that -H should make sense for other dracut modules too.

Thanks
Vivek

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#43 lore raw

Am 23.04.2012 17:17, schrieb Vivek Goyal:

Quoted 45 lines · Harald Hoyer

[..]

Quoted 1 line

Just activate the host-only mode "--hostonly" or "-H"

I tried -H but then it looks like it does not include modules required to mount disks passed using "--mount" option. For example, I want to mount a multipath target in initramfs but I don't see multipath module being included.

Following is dracut command line.

dracut --add kdumpbase --add dash --add fstab-sys --add kernel-modules -c /dev/null -I /sbin/makedumpfile --hostonly --mount '/dev/mapper/vg-lv_root / ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' --mount '/dev/mapper/mpathb /mnt/common ext4 rw,seclabel,relatime,user_xattr,barrier=1,data=ordered' -M -f /boot/initramfs-3.3.2-1.fc17.x86_64kdump.img 3.3.2-1.fc17.x86_64

Notice, /dev/mapper/mpathb is the multipath device.

Following is the list of modules included by dracut.

-----------------
i18n
rpmversion
plymouth
dm
kernel-modules
lvm
fstab-sys
resume
rootfs-block
terminfo
udev-rules
biosdevname
usrmount
base
fs-lib
kdumpbase
shutdown
-------------------

Notice it did not inclde "multipath" module.

I passed the --debug option to dracut and attaching the resulting output. I personally think that a new dracut option "--mount-only" might make sense where only those modules are included which somehow contribute to mounting of targets specified by "--mount".

Quoted 5 lines

BTW, using --hostonly gave a nice redcution in initramfs size and my uncomressed initramfs is around 18MB which sounds just right.

Thanks
Vivek

oh.. multipath detection is not yet implemented for host-only... everything else should work, though

A message that is not in the archive (sent off-list or not yet received): [email protected]

#45 lore raw

On Mon, Apr 23, 2012 at 06:11:54PM +0200, Harald Hoyer wrote:

[..]

Quoted 2 lines

oh.. multipath detection is not yet implemented for host-only... everything else should work, though

iscsi does not work either. Just gave it a try and iscsi does not show up in list of included modules.

Thanks
Vivek