On Mon, Aug 17, 2009 at 11:38 AM, Manish Katiyar <mkati...@gmail.com> wrote:
> On Mon, Aug 17, 2009 at 11:06 AM, ajit mote<mail2black...@gmail.com> > wrote: > > > > Hello, > > > > I would like to know how file system structures are mapped to hard disk > > sector. > > Each filesystem deals in the granularity of "block size" which is > generally configurable (typically 4K) during fs creation time. So each > block maps to 8 sectors (which are generally 512 bytes). Now given a > block number you can multiply it by 8 to get your hard disk sector. > This is the starting point which I am looking for , you pointed exactly the same ... Any document which describes above in details will be great .... > > My goal is to understand how file system is created on block device > > and how superblocks are mapped to hard disk sectors. > > Filesystem is created using a userspace binary (mke2fs for example in > case of ext2). Appropriate datastructures are written at appropiate > places during the FS creation time. See the sources of mkfs.c in > e2fsprogs. > I reached here , already downloaded the source for e2fsck package and playing with it .... > > Superblock will have a predefined block number where it resides. From > the above calculation you can know which sector to read. > I can read the superblock content(will write small module) using superblock operation pointed : http://lxr.linux.no/#linux+v2.6.30.4/fs/ext3/super.c > > > > > I am not sure whether I stated the problem precisely or not but if I did > not > > described it properly then let me know. > > I am not sure if that answers your question correctly :-) . If not > please let me know. You answered what i needed at this time ... Thanks > > > Thanks - > Manish > > > > > This is just an understanding sort of issue which I am looking for > teaching > > purpose. > > > > Note: > > Please free to change the subject line if not proper. > > > > -- > > Thanks & Regards, > > Ajit Subhash Mote > > > > > > > > -- > Thanks - > Manish > -- Thanks & Regards, Ajit Subhash Mote