Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi, I have created an image file and mounted it with ext4 file system. I want to store its information in sb_info structure of ext4 file system ext4.h header file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10

    store a block device information in sb_info struct of ext4 file system


    Hi,
    I have created an image file and mounted it with ext4 file system. I want to store its information in sb_info structure of ext4 file system ext4.h header file. I am not sure about how to modify the code as i am new to this file system.
    Could some one please help me with this !

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Sorry I don't understand your requirement. ext4_sb_info is a in-memory representation of ext4 superblock do you want to store it on hard disk ? Anyway - they will be flushed disk once sb gets dirty .
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10
    thanks for the reply ! I appretiate that..

    actually i am trying to separately store the metadata and the data and for doing that i have created an img file and formatted this partition with ext4. I need to store this partitions information in the ext4_sb_info struct but i am not very sure how to do this.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Quote Originally Posted by shwety1085 View Post

    actually i am trying to separately store the metadata and the data and for doing that i have created an img file and formatted this partition with ext4. I need to store this partitions information in the ext4_sb_info struct but i am not very sure how to do this.
    Metadata --which one? are you referring to inode table or inode/block bitmaps?
    Can you be more specific ,I'm still find it hard to understand it. From above stmt,I assume you have img. file created using dd & formatted as mkfs.ext4 . right?
    Are you using the partition information similar to one stored in MBR into ext4_sb_info struct? why?
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  6. #5
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10
    the metadata which is stored in inodes.
    yes you are right, i created a img file using dd command and mounted it using mkfs.ext4.
    I just need to provide this partitions information or hard code it in the ext4_sb_info struct but not sure how to go about doing it. Does it have to be done by making changes at the vfs layer?
    Could you please tell me how to do this.
    Please let me know if my query is still not clear to you..

  7. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Quote Originally Posted by shwety1085 View Post
    the metadata which is stored in inodes.
    yes you are right, i created a img file using dd command and mounted it using mkfs.ext4.
    Okay.I understand it. You are looking for file's inode informations. Inode table.

    I just need to provide this partitions information
    Are you referring to ext4 File system disk layout as "partitions"? I guess you want to take a backup of inode table (which contains inode) to some place ..Is that correct?
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  8. #7
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10
    yes i want to make a backup of the inode table or you can say i want to duplicate the data to some other disk or partition. I have figured out that it can be done by the following:
    1) Parse a new inode device mount point.
    2) Store inode block device information in struct sb_info.

    Could you please guide me how to proceed with this.

  9. #8
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Quote Originally Posted by shwety1085 View Post
    yes i want to make a backup of the inode table or you can say i want to duplicate the data to some other disk or partition. I have figured out that it can be done by the following:
    1) Parse a new inode device mount point.
    2) Store inode block device information in struct sb_info.

    Could you please guide me how to proceed with this.
    In order to duplicate inodes ,are you writing a kernel module or you want to do it from userspace? I don't have much info with kernel module..Though I can look around and see whats going on...If you want to do it from user space then something like ext2lib is a excellent & right way to begin with
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  10. #9
    Just Joined!
    Join Date
    Aug 2011
    Posts
    10
    I guess it would be correct to do it from kernel mode i.e by inserting a module..
    can you suggest me some way to provide the partition's info in the struct sb_info

  11. #10
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Quote Originally Posted by shwety1085 View Post
    I guess it would be correct to do it from kernel mode i.e by inserting a module..
    can you suggest me some way to provide the partition's info in the struct sb_info
    Yes,kernel module is the right approach. But it depends on the requirement. If I want to backup file's inodes into a separate disk.I would use user space program with ext2lib. But anyway If you want to use sb_info --is that vfs sb_info or ext4 specific sb_info which is LXR / The Linux Cross Reference
    I don't see any reason to add it vfs sb_info or something like you want to work only with ext4.

    And also you would recommend you to drop a mail to ext3/ext4 user list and seek their input.
    Last edited by Lakshmipathi; 09-08-2011 at 02:15 PM.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •