Opened 12 years ago
Closed 12 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)
Change History (16)
by , 12 years ago
Attachment: | RHEL 4.htm added |
---|
comment:1 by , 12 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 , 12 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 , 12 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 , 12 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.
by , 12 years ago
Attachment: | diff-mindi2.1.3-mindi2.0.6.png added |
---|
Diff between mindi 2.0.6 and mindi 2.1.3 concerning fs detection
by , 12 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 , 12 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 , 12 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.
comment:7 by , 12 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 , 12 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 , 12 years ago
Status: | new → 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 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Seems to have been fixed with mindi-2.1.5
RHEL 4 fs detection tests