gsoc and grub4ext4
Upcoming SlideShare
Loading in...5
×
 

gsoc and grub4ext4

on

  • 378 views

 

Statistics

Views

Total Views
378
Views on SlideShare
377
Embed Views
1

Actions

Likes
0
Downloads
4
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

gsoc and grub4ext4 gsoc and grub4ext4 Presentation Transcript

  • GSoC & grub4ext4 Peng Tao BUPT—Broadband Network Research CenterPeng Tao (BUPT) Introduction to GSoC and grub4ext4 1 / 37
  • Agenda1 Google Summer of Code2 Google Summer of Code 20083 Grub4ext4: enable ext4 file system as boot partitionPeng Tao (BUPT) Introduction to GSoC and grub4ext4 2 / 37
  • About MePeng TaoBroadband Network Research Center, BUPTGraduate at Apr,2010(expected)bergwolf@gmail.com Copyright c 2008. No rights reserved except that of others. BergwolfPeng Tao (BUPT) Introduction to GSoC and grub4ext4 3 / 37 View slide
  • 1 Google Summer of Code2 Google Summer of Code 20083 Grub4ext4: enable ext4 file system as boot partitionPeng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37 View slide
  • What is Google Summer of Code?Google Summer of Code (GSoC) is a program that offers studentdevelopers stipends to write code for various open source projects.Google will be working with several open source, free software, andtechnology-related groups to identify and fund several projects over athree month period.Kicked off in 2005. In 2005, 2006 and 2007, the program has broughttogether over 1,500 students with over 130 open source projects to createmillions of lines of code.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • What is Google Summer of Code?Google Summer of Code (GSoC) is a program that offers studentdevelopers stipends to write code for various open source projects.Google will be working with several open source, free software, andtechnology-related groups to identify and fund several projects over athree month period.Kicked off in 2005. In 2005, 2006 and 2007, the program has broughttogether over 1,500 students with over 130 open source projects to createmillions of lines of code.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • What is Google Summer of Code?Google Summer of Code (GSoC) is a program that offers studentdevelopers stipends to write code for various open source projects.Google will be working with several open source, free software, andtechnology-related groups to identify and fund several projects over athree month period.Kicked off in 2005. In 2005, 2006 and 2007, the program has broughttogether over 1,500 students with over 130 open source projects to createmillions of lines of code.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • Goals of Google Summer of CodeGoogle Summer of Code has several goals:Get more open source code created and released for the benefit of all;Inspire young developers to begin participating in open sourcedevelopment;Help open source projects identify and bring in new developers andcommitters;Provide students in Computer Science and related fields the opportunityto do work related to their academic pursuits (think ”flip bits, notburgers”);Give students more exposure to real-world software developmentscenarios (e.g., distributed development, software licensing questions,mailing-list etiquette).Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • A Simple workflow1. Open source projects who’d like to participate in Google Summer ofCode in 2008 should choose an organization administrator(s) to representthem;2. Organization administrators will submit the project’s application forparticipation online;3. Google will notify the organization administrators of acceptance, andan account for the organization will be created in the Google Summer ofCode web app;4. Students submit project proposals online to work with particularmentoring organizations;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • A Simple workflow1. Open source projects who’d like to participate in Google Summer ofCode in 2008 should choose an organization administrator(s) to representthem;2. Organization administrators will submit the project’s application forparticipation online;3. Google will notify the organization administrators of acceptance, andan account for the organization will be created in the Google Summer ofCode web app;4. Students submit project proposals online to work with particularmentoring organizations;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • A Simple workflow1. Open source projects who’d like to participate in Google Summer ofCode in 2008 should choose an organization administrator(s) to representthem;2. Organization administrators will submit the project’s application forparticipation online;3. Google will notify the organization administrators of acceptance, andan account for the organization will be created in the Google Summer ofCode web app;4. Students submit project proposals online to work with particularmentoring organizations;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • A Simple workflow1. Open source projects who’d like to participate in Google Summer ofCode in 2008 should choose an organization administrator(s) to representthem;2. Organization administrators will submit the project’s application forparticipation online;3. Google will notify the organization administrators of acceptance, andan account for the organization will be created in the Google Summer ofCode web app;4. Students submit project proposals online to work with particularmentoring organizations;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • A Simple workflow1. Open source projects who’d like to participate in Google Summer ofCode in 2008 should choose an organization administrator(s) to representthem;2. Organization administrators will submit the project’s application forparticipation online;3. Google will notify the organization administrators of acceptance, andan account for the organization will be created in the Google Summer ofCode web app;4. Students submit project proposals online to work with particularmentoring organizations;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 5. Mentoring organizations rank student proposals and perform anyother due diligence on their potential mentees; student proposals arematched with a mentor;6. Google allocates a particular number of student slots to eachorganization;7. Students are notified of acceptance;8. Students begin learning more about their mentoring organization andits community before coding work starts;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 5. Mentoring organizations rank student proposals and perform anyother due diligence on their potential mentees; student proposals arematched with a mentor;6. Google allocates a particular number of student slots to eachorganization;7. Students are notified of acceptance;8. Students begin learning more about their mentoring organization andits community before coding work starts;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 5. Mentoring organizations rank student proposals and perform anyother due diligence on their potential mentees; student proposals arematched with a mentor;6. Google allocates a particular number of student slots to eachorganization;7. Students are notified of acceptance;8. Students begin learning more about their mentoring organization andits community before coding work starts;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 5. Mentoring organizations rank student proposals and perform anyother due diligence on their potential mentees; student proposals arematched with a mentor;6. Google allocates a particular number of student slots to eachorganization;7. Students are notified of acceptance;8. Students begin learning more about their mentoring organization andits community before coding work starts;Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 9. Students begin coding work at the official start of the program,provided they’ve interacted well with their community up until theprogram start date;10. Mentors and students provide mid-term progress evaluations;11. Mentors provide a final evaluation of student progress at close ofprogram; students submit a final review of their mentor and theprogram;12. Student who passes final evaluation uploads completed code to aGoogle Code hosted project. Program close up.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 9. Students begin coding work at the official start of the program,provided they’ve interacted well with their community up until theprogram start date;10. Mentors and students provide mid-term progress evaluations;11. Mentors provide a final evaluation of student progress at close ofprogram; students submit a final review of their mentor and theprogram;12. Student who passes final evaluation uploads completed code to aGoogle Code hosted project. Program close up.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 9. Students begin coding work at the official start of the program,provided they’ve interacted well with their community up until theprogram start date;10. Mentors and students provide mid-term progress evaluations;11. Mentors provide a final evaluation of student progress at close ofprogram; students submit a final review of their mentor and theprogram;12. Student who passes final evaluation uploads completed code to aGoogle Code hosted project. Program close up.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 9. Students begin coding work at the official start of the program,provided they’ve interacted well with their community up until theprogram start date;10. Mentors and students provide mid-term progress evaluations;11. Mentors provide a final evaluation of student progress at close ofprogram; students submit a final review of their mentor and theprogram;12. Student who passes final evaluation uploads completed code to aGoogle Code hosted project. Program close up.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 1 Google Summer of Code2 Google Summer of Code 20083 Grub4ext4: enable ext4 file system as boot partitionPeng Tao (BUPT) Introduction to GSoC and grub4ext4 9 / 37
  • Google Summer of Code 2008Peng Tao (BUPT) Introduction to GSoC and grub4ext4 9 / 37
  • Google Summer of Code 2008GSoC 2008 was officially announced on February 25 and concluded onSeptember 2, 2008.177 open source organizations with more than 3000 ideas.over 1000 students from all over the world participated. Eighty-threepercent of them received passing final evaluations from their mentors andcommunities, the highest rate of success in all four years running theprogram.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • Google Summer of Code 2008GSoC 2008 was officially announced on February 25 and concluded onSeptember 2, 2008.177 open source organizations with more than 3000 ideas.over 1000 students from all over the world participated. Eighty-threepercent of them received passing final evaluations from their mentors andcommunities, the highest rate of success in all four years running theprogram.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • Google Summer of Code 2008GSoC 2008 was officially announced on February 25 and concluded onSeptember 2, 2008.177 open source organizations with more than 3000 ideas.over 1000 students from all over the world participated. Eighty-threepercent of them received passing final evaluations from their mentors andcommunities, the highest rate of success in all four years running theprogram.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • GSoC 2008 organizationsPeng Tao (BUPT) Introduction to GSoC and grub4ext4 11 / 37
  • GSoC 2008 organizationsPeng Tao (BUPT) Introduction to GSoC and grub4ext4 12 / 37
  • openSUSE in GSoC 2008openSUSE provided 30 project ideas this year. Ten of them became aGSoC project and all ten projects passed final evaluation!Peng Tao (BUPT) Introduction to GSoC and grub4ext4 13 / 37
  • openSUSE mentors and studentsPeng Tao (BUPT) Introduction to GSoC and grub4ext4 14 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • GSoC 2008 and MePreparation: Started from last winter, I began to do the RTFC things. Icollected documents and manuals about GRUB legacy, got a slight ideaof how to patch GRUB from GRUB’s side.Application: There was about two weeks to write my proposal(Officiallyonly one week, but there was one week’s delay). Communication is veryimportant while writing proposal, especially with the mentor.Working on it: Reading kernel and e2fsprogs code, asking questions onIRC, writing patch, bla bla. A lot of things happened.Submitting: I submitted my code and documents to Coly Li on August14.The end: With Coly Li’s help, my patch is now in openSUSE 11.1 beta1.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 15 / 37
  • 1 Google Summer of Code2 Google Summer of Code 20083 Grub4ext4: enable ext4 file system as boot partitionPeng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • IntroductionThe ext4 file system is merged into Linux kernel as ext4dev.However, an ext4-formated partition can not be used as a boot partition,because GRUB Legacy(referred to as grub in the following text), which isthe most popular bootloader nowadays, doesn’t yet support mountingand reading ext4 partitions.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • IntroductionThe ext4 file system is merged into Linux kernel as ext4dev.However, an ext4-formated partition can not be used as a boot partition,because GRUB Legacy(referred to as grub in the following text), which isthe most popular bootloader nowadays, doesn’t yet support mountingand reading ext4 partitions.As part of Google Summer of Code 2008 program, grub4ext4 aims atenabling gurb to boot on ext4 partitions.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • Introduction(ctd.)Project home:http://bergwolf.googlepages.com/grub4ext4Packages:http://download.opensuse.org/repositories/home:/bergwolf:/grub4ext4/Peng Tao (BUPT) Introduction to GSoC and grub4ext4 17 / 37
  • Linux VFS concepts Generally, Linux Virtual File System(VFS) accomplishes following tasks:1 Manage kernel level file abstractions in one format for all file systems Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • Linux VFS concepts Generally, Linux Virtual File System(VFS) accomplishes following tasks:1 Manage kernel level file abstractions in one format for all file systems2 receive system calls from user level(e.g.write, open, stat, link) Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • Linux VFS concepts Generally, Linux Virtual File System(VFS) accomplishes following tasks:1 Manage kernel level file abstractions in one format for all file systems2 receive system calls from user level(e.g.write, open, stat, link)3 Interact with a specific file system based on mount point traversal Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • Linux VFS concepts Generally, Linux Virtual File System(VFS) accomplishes following tasks:1 Manage kernel level file abstractions in one format for all file systems2 receive system calls from user level(e.g.write, open, stat, link)3 Interact with a specific file system based on mount point traversal4 receive request from other parts of the kernel, mostly from memory management Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • Linux VFS concepts(ctd.) VFS data structures:1 VFS handle for the file: inode2 user instantiated file handle: file3 the whole filesystem metadata: superblock4 a name to inode translation: dentry Peng Tao (BUPT) Introduction to GSoC and grub4ext4 19 / 37
  • Linux VFS concepts(ctd.)Inodes:Inode object is the kernel representation of the low level fileInode has operations:const struct inode operations *i op;const struct file operations *i fop;Inodes contain an FS specific informationPeng Tao (BUPT) Introduction to GSoC and grub4ext4 20 / 37
  • Linux VFS concepts(ctd.)File:Store the process’s information about the fileFile information: use count, flags, mode, owner, uid, gid, file operations,etc.File operations are copied from the i fop field of the inode object to thefile object by the kernelTwo file operation tables are maintained per FS: one for directories andthe other for regular filesPeng Tao (BUPT) Introduction to GSoC and grub4ext4 21 / 37
  • Linux VFS concepts(ctd.)Superblock:Handel metadata onlyResponsible for retrieving and storing metadata from FS media or peersStruct superblock hold things like:– block device, blocksize, filesystem type, flags, list of (inodes, dirtyinodes, etc) – super operations – wait queue – pointer to the root dentryof the FS – etc...Peng Tao (BUPT) Introduction to GSoC and grub4ext4 22 / 37
  • Linux VFS concepts(ctd.)Dentry:The kernel uses dentries to represent the file system structureDentry is a name to inode translation structureDentry has Pointers to store the parent-child relationship of the filesCached aggressively by VFSEliminate lookups by FS & private caches, faster lookups for NFSPeng Tao (BUPT) Introduction to GSoC and grub4ext4 23 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS 2 EXT4 FEATURE INCOMPAT 64BIT Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS 2 EXT4 FEATURE INCOMPAT 64BIT 3 EXT4 FEATURE INCOMPAT MMP(not implemented yet) Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS 2 EXT4 FEATURE INCOMPAT 64BIT 3 EXT4 FEATURE INCOMPAT MMP(not implemented yet) 4 EXT4 FEATURE INCOMPAT FLEX BG Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • From ext3 to ext4 There are four incompatible ext4 features against ext3 defined infs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS 2 EXT4 FEATURE INCOMPAT 64BIT 3 EXT4 FEATURE INCOMPAT MMP(not implemented yet) 4 EXT4 FEATURE INCOMPAT FLEX BGTo enable grub to boot on ext4 filesystem is to provide grub with support forthese incompatible features. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • EXT4 FEATURE INCOMPAT EXTENTSExt2/3 uses Indirect mapping to store data on disk.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 25 / 37
  • extentsext2/3 indirect block maps are incredibly inefficient for large files one extra block read per 1024 blocks very obvious when moving or deleting big CD/DVD image filesPeng Tao (BUPT) Introduction to GSoC and grub4ext4 26 / 37
  • extentsext4 introduces a new on-disk data storage structure: extents.ext2/3 indirect block maps are incredibly inefficient for large files one extra block read per 1024 blocks very obvious when moving or deleting big CD/DVD image filesan extent is a single descriptor for a chunk of contiguous blocks efficient to represent large contiguous files fewer metadata IO, better CPU utilizationPeng Tao (BUPT) Introduction to GSoC and grub4ext4 26 / 37
  • on-disk extent format 12 bytes ext4 extent structure 48 bit physical block number to address 1EB filesystem 15 bit extent to store at most 128MB in a single extent 32 bit logical block number to address 16TB filesystemstruct ext4 extent { le32 ee block; /* first logical block extent covers */ le16 ee len; /* number of blocks covered by extent */ le16 ee start hi; /* high 16 bits of physical block */ le32 ee start lo; /* low 32 bits of physical block */}; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 27 / 37
  • extent mapping Ext4 uses extent mapping, which is an advantage when storing largecontinues files. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 28 / 37
  • Peng Tao (BUPT) Introduction to GSoC and grub4ext4 29 / 37
  • Peng Tao (BUPT) Introduction to GSoC and grub4ext4 30 / 37
  • EXT4 FEATURE INCOMPAT 64BIT Currently(kernel 2.26.1), only changes in group descriptor are markedwith this feature. Group descriptor is fixed sized(32 bytes) in ext2/3 but canbe flexible in ext4(at least 64 bytes). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 31 / 37
  • size of group descriptorsize of group descriptor is stored in s desc size of ext4 superblock whichis not present in ext2/3 superblock.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 32 / 37
  • size of group descriptor size of group descriptor is stored in s desc size of ext4 superblock which is not present in ext2/3 superblock. In grub4ext4, test EXT4 FEATURE INCOMPAT 64BIT bit to decide whether to read s desc size.#define EXT2 DESC SIZE(s)(EXT4 HAS INCOMPAT FEATURE(s,EXT4 FEATURE INCOMPAT 64BIT)?s–>s desc size : EXT4 MIN DESC SIZE) Peng Tao (BUPT) Introduction to GSoC and grub4ext4 32 / 37
  • EXT4 FEATURE INCOMPAT FLEX BGflex bg feature allows bitmaps and inode tables for a block group to beplaced anywhere on the storage media.greatly decrease fsck timePeng Tao (BUPT) Introduction to GSoC and grub4ext4 33 / 37
  • EXT4 FEATURE INCOMPAT FLEX BGflex bg feature allows bitmaps and inode tables for a block group to beplaced anywhere on the storage media.greatly decrease fsck timegrub doesn’t interfere with bitmaps but uses group desc structure toaccess the inode table, so this feature is naturally supported.Peng Tao (BUPT) Introduction to GSoC and grub4ext4 33 / 37
  • Solved problem 1How about ext3 files that are left unchanged on ext4 file system?Peng Tao (BUPT) Introduction to GSoC and grub4ext4 34 / 37
  • Solved problem 1 How about ext3 files that are left unchanged on ext4 file system?There might be nonextent files on ext4 filesystem.i flag in each file’s inode should be checked before mapping its logical blocknumber to physical block number in grub. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 34 / 37
  • Solved problem 2 What if physical block number of a file exceeds 32bit limitation on a48bit ext4 filesystem? Peng Tao (BUPT) Introduction to GSoC and grub4ext4 35 / 37
  • Solved problem 2 What if physical block number of a file exceeds 32bit limitation on a48bit ext4 filesystem?Physical block number is 64bit in ext4.In grub4ext4, high 16 bits is checked to avoid reading files whose physicalblock number exceeds 32bit limitation.If a request for such files is received, grub will return ERR FILELENGTHwith error message ”Filesystem compatibility error, cannot read whole file”. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 35 / 37
  • Thanksgrub4ext4 is originally Coly Li’s idea. Without his insightful guiding,grub4ext4 would not be what it is today.And special thanks goes to Aneesh Kumar, who have helped me a lot inunderstanding new ext4 features.Also, without Google Summer of Code program, this project would nothave been grown so quickly. Google, you rock!Peng Tao (BUPT) Introduction to GSoC and grub4ext4 36 / 37
  • Thank you! Q&APeng TaoBroadband Network Research CenterState Key Laboratory of Network and Switching TechnologyBeijing University of Posts and TelecommunicationsBeijing, 100876, Chinabergwolf@gmail.comPeng Tao (BUPT) Introduction to GSoC and grub4ext4 37 / 37