Ticket #681 (closed defect: fixed)

Opened 17 months ago

Last modified 16 months ago

mindi kernel fs detection is wrong

Reported by: vicgat Owned by: bruno
Priority: high Milestone: 3.0.4
Component: mindi Version: 3.0.3
Severity: normal Keywords: mindi file system detection initrd vmlinuz kernel panic Unable to mount root fs
Cc: vicgat, ddiaz

Description

kernel fs detection by mindi (grep -q gzip, then strings etc.) is wrong, the tests are made on vmlinuz, but it works only with initrd.

In /usr/sbin/mindi :

file $fname | grep -q gzip

I attached tests on RHEL 4 and SLES 11 SP1.

Also the tests are based on Linux kernel 2.*, but in newer GNU/LInux distribs are used Linux kernel 3.* (exemple Ubuntu 12.04, etc.)

Then at boot can occur : kernel panic : VFS : Unable to mount root fs

Attachments

RHEL 4.htm Download (5.4 KB) - added by vicgat 17 months ago.
RHEL 4 fs detection tests
SLES 11 SP1.htm Download (5.0 KB) - added by vicgat 17 months ago.
SLES 11 SP1 fs detection tests
diff-mindi2.1.3-mindi2.0.6.png Download (155.9 KB) - added by vicgat 17 months ago.
Diff between mindi 2.0.6 and mindi 2.1.3 concerning fs detection
test-results.2.htm Download (2.6 KB) - added by vicgat 17 months ago.
results of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11
test-results.zip Download (935 bytes) - added by vicgat 17 months ago.
results (html file compressed) of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11
test.sh Download (2.5 KB) - added by vicgat 17 months ago.
shell-script that use the old detection mode
test-results.htm Download (4.2 KB) - added by vicgat 17 months ago.
results of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11

Change History

Changed 17 months ago by vicgat

RHEL 4 fs detection tests

Changed 17 months ago by vicgat

SLES 11 SP1 fs detection tests

comment:1 Changed 17 months ago by vicgat

More precisely, in mindi 2.1.4 REV=3091

# grep -n "file $fname \| grep -q gzip" /usr/sbin/mindi
766:    file $lvKernelImage 2>&1 | grep -q gzip
2330:           file $fname | grep -q gzip
2373:           file $fname | grep -q gzip

comment:2 Changed 17 months ago by vicgat

I recommend the following solution :

In order to find the fs, the same tests (grep -q gzip on current vmlinuz) should be done on current initrd before this (Line 771):

	else
		# In that case, we are after 2.6.30 and use the supported initramfs 
		lvUseFilesystem="initramfs"

comment:3 Changed 17 months ago by vicgat

On a RHEL 4 server I compared the logs of an old mindi version which detected well the kernel and fs (mindi 2.0.6-r2151 ok) with the last mindi which fails to detect it (mindi 2.1.3-r3026 not ok)

mindi 2.0.6-r2151 ok - ext2fs is detected

Call GetInitrdFilesystemToUse() with parameter /boot/vmlinuz-2.6.9-42.0.10.ELsmp to get filesystem to use for initrd.
  GetInitrdFilesystemToUse(): called with parameter: /boot/vmlinuz-2.6.9-42.0.10.ELsmp.\n
  GetInitrdFilesystemToUse(): gzip magic found at lvOffset 17956.\n
  GetInitrdFilesystemToUse(): Filesytem to use for initrd is ext2fs.\n

mindi 2.1.3-r3026 not ok

INFO: Call GetInitrdFilesystemToUse() with parameter /boot/vmlinuz-2.6.9-42.0.10.ELsmp to get filesystem to use for initrd.
INFO:   GetInitrdFilesystemToUse(): called with parameter: /boot/vmlinuz-2.6.9-42.0.10.ELsmp
INFO:   GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is initramfs.
INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image...

comment:4 Changed 17 months ago by vicgat

I compared the mindi 2.0.6 and 2.1.3 sources and found what differs concerning the fs detection.

Check "diff-mindi2.1.3-mindi2.0.6.png" screenshot attached.

I created a little shell-script from these differences ("test.sh" attached), and I attached (in "test-results.htm" attached) the results for RHEL 4, RHEL 6, SLES 10 SP4 and SLES 11 SP1.

Last edited 17 months ago by vicgat (previous) (diff)

Changed 17 months ago by vicgat

Diff between mindi 2.0.6 and mindi 2.1.3 concerning fs detection

comment:5 Changed 17 months ago by vicgat

Sorry, little error in my script, I'll modify it and run it again.

Changed 17 months ago by vicgat

results of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11

Changed 17 months ago by vicgat

results (html file compressed) of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11

comment:6 Changed 17 months ago by vicgat

I modified my shell-script, results are good now, fs detection works.

Just a remark, sometimes lvScanRes get two results, and then ext2fs is choiced because it's the first of the if/elif of the shell-script.

Example :

lvScanRes=<6>checking if image is initramfs...
<3>EXT2-fs: blocksize too small for device.

I attached the shell-script modified which replaces my old one.

Remark : test-results.htm, test-results2.htm, and test-results.zip are the same file, with the results of my shell-script modified.

Last edited 17 months ago by vicgat (previous) (diff)

comment:7 Changed 17 months ago by vicgat

I modified again the test.sh shell-script, to better reflect what could be the mindi tests.

Results are in test-results.htm.

Changed 17 months ago by vicgat

shell-script that use the old detection mode

Changed 17 months ago by vicgat

results of test.sh (old detection mode) on RHEL 4 and 6 and SLES 10 and 11

comment:8 Changed 17 months ago by bruno

  • Status changed from new to assigned

Many thanks Victori for all these tests.

I've now re-introduced the old code for gzip detection inside the kernel at the offset as this is really mandatory.

I'm rebuilding a new mindi version for all distros based on rev [3103]. Could you check that it's fixing the issue for good on the various one you have ? (under the test subdir).

I'll publish that version as a new stable for mindi this week-end then.

comment:9 Changed 16 months ago by bruno

  • Status changed from assigned to closed
  • Resolution set to fixed

Seems to have been fixed with mindi-2.1.5

Note: See TracTickets for help on using tickets.