Did not find any suitable thread for Linux kernel, so started a new Topic. My apologize if, its already present.
A bit too long description of problem follows: ( Please bear with me )
I am working on CentOS 5.0 distribution. The base kernel used in it is 2.6.18-8 which is a vanilla kernel. I have modified the ext3 & ext2 super block by inducing an struct (ABC of 6 longs) inside it & reduced the reserved array (from 190 to 184) at the end of the structure. Everything works fine, except for one.
When I create a new LV using LVM or a new partition using fdisk and execute mkfs.ext2/3 to format the disk, the super block initialized using mkfs.ext2/3 is not propagated properly to on disk super block. Due to which, one of my structure member gets some junk value.
When I browsed through mkfs code from "e2fsprogs" source, found out that the latest e2fsprogs (version 1.40.8) has a default served array of 163 longs in super block structure of ext2/3. This might be the reason why my ABC structure members get some value initialized. I want it to be zero.
Further study of other versions of e2fsprogs source (http://sourceforge.net/project/showf...ackage_id=2374
) showed that version 1.29 of e2fsprogs source has 189 longs as reserved in super block of ext2/3, whereas 1.30 has 192 longs free. Don't know whether this is the problem.
But as per my understanding, when you format the disk using mkfs, mkfs.ext3 will use its super block structure for ext3 and initialize it to zero (in code, using memset) & then fill the required members. But as the structure read in mkfs is different then that present in kernel, it make the new member have some initial value.
How do you solve this problem ? Any pointers in this direction would be of great help.
I solution for the problem, I feel is to modify the mkfs utility source code to have ext3 super block similar to what is available in kernel source & then use the newly compiled mkfs utility.