Opened 11 years ago

Closed 11 years ago

#681 closed defect (fixed)

mindi kernel fs detection is wrong

Reported by: victor gattegno Owned by: Bruno Cornec
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: victor gattegno, rue

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 (7)

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

Download all attachments as: .zip

Change History (16)

by victor gattegno, 11 years ago

Attachment: RHEL 4.htm added

RHEL 4 fs detection tests

by victor gattegno, 11 years ago

Attachment: SLES 11 SP1.htm added

SLES 11 SP1 fs detection tests

comment:1 by victor gattegno, 11 years ago

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 by victor gattegno, 11 years ago

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 by victor gattegno, 11 years ago

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 by victor gattegno, 11 years ago

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 11 years ago by victor gattegno (previous) (diff)

by victor gattegno, 11 years ago

Diff between mindi 2.0.6 and mindi 2.1.3 concerning fs detection

comment:5 by victor gattegno, 11 years ago

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

by victor gattegno, 11 years ago

Attachment: test-results.2.htm added

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

by victor gattegno, 11 years ago

Attachment: test-results.zip added

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

comment:6 by victor gattegno, 11 years ago

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 11 years ago by victor gattegno (previous) (diff)

comment:7 by victor gattegno, 11 years ago

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

Results are in test-results.htm.

by victor gattegno, 11 years ago

Attachment: test.sh added

shell-script that use the old detection mode

by victor gattegno, 11 years ago

Attachment: test-results.htm added

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

comment:8 by Bruno Cornec, 11 years ago

Status: newassigned

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 by Bruno Cornec, 11 years ago

Resolution: fixed
Status: assignedclosed

Seems to have been fixed with mindi-2.1.5

Note: See TracTickets for help on using tickets.