SlideShare uma empresa Scribd logo
1 de 78
Baixar para ler offline
GSoC & grub4ext4

                                 Peng Tao

                  BUPT—Broadband Network Research Center




Peng Tao (BUPT)        Introduction to GSoC and grub4ext4   1 / 37
Agenda




1   Google Summer of Code



2   Google Summer of Code 2008



3   Grub4ext4: enable ext4 file system as boot partition




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4   2 / 37
About Me



Peng Tao
Broadband Network Research Center, BUPT
Graduate at Apr,2010(expected)
bergwolf@gmail.com


                                                          Copyright c 2008.
                                     No rights reserved except that of others.
                                                                     Bergwolf




Peng Tao (BUPT)   Introduction to GSoC and grub4ext4                      3 / 37
1   Google Summer of Code

2   Google Summer of Code 2008

3   Grub4ext4: enable ext4 file system as boot partition




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 student
developers stipends to write code for various open source projects.

Google will be working with several open source, free software, and
technology-related groups to identify and fund several projects over a
three month period.

Kicked off in 2005. In 2005, 2006 and 2007, the program has brought
together over 1,500 students with over 130 open source projects to create
millions 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 student
developers stipends to write code for various open source projects.

Google will be working with several open source, free software, and
technology-related groups to identify and fund several projects over a
three month period.

Kicked off in 2005. In 2005, 2006 and 2007, the program has brought
together over 1,500 students with over 130 open source projects to create
millions 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 student
developers stipends to write code for various open source projects.

Google will be working with several open source, free software, and
technology-related groups to identify and fund several projects over a
three month period.

Kicked off in 2005. In 2005, 2006 and 2007, the program has brought
together over 1,500 students with over 130 open source projects to create
millions of lines of code.




Peng Tao (BUPT)       Introduction to GSoC and grub4ext4                 4 / 37
Goals of Google Summer of Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (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 Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (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 Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (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 Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (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 Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (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 Code
Google 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 source
development;

Help open source projects identify and bring in new developers and
committers;

Provide students in Computer Science and related fields the opportunity
to do work related to their academic pursuits (think ”flip bits, not
burgers”);

Give students more exposure to real-world software development
scenarios (e.g., distributed development, software licensing questions,
mailing-list etiquette).
Peng Tao (BUPT)       Introduction to GSoC and grub4ext4                  5 / 37
A Simple workflow


1. Open source projects who’d like to participate in Google Summer of
Code in 2008 should choose an organization administrator(s) to represent
them;

2. Organization administrators will submit the project’s application for
participation online;

3. Google will notify the organization administrators of acceptance, and
an account for the organization will be created in the Google Summer of
Code web app;

4. Students submit project proposals online to work with particular
mentoring organizations;


Peng Tao (BUPT)         Introduction to GSoC and grub4ext4            6 / 37
A Simple workflow


1. Open source projects who’d like to participate in Google Summer of
Code in 2008 should choose an organization administrator(s) to represent
them;

2. Organization administrators will submit the project’s application for
participation online;

3. Google will notify the organization administrators of acceptance, and
an account for the organization will be created in the Google Summer of
Code web app;

4. Students submit project proposals online to work with particular
mentoring organizations;


Peng Tao (BUPT)         Introduction to GSoC and grub4ext4            6 / 37
A Simple workflow


1. Open source projects who’d like to participate in Google Summer of
Code in 2008 should choose an organization administrator(s) to represent
them;

2. Organization administrators will submit the project’s application for
participation online;

3. Google will notify the organization administrators of acceptance, and
an account for the organization will be created in the Google Summer of
Code web app;

4. Students submit project proposals online to work with particular
mentoring organizations;


Peng Tao (BUPT)         Introduction to GSoC and grub4ext4            6 / 37
A Simple workflow


1. Open source projects who’d like to participate in Google Summer of
Code in 2008 should choose an organization administrator(s) to represent
them;

2. Organization administrators will submit the project’s application for
participation online;

3. Google will notify the organization administrators of acceptance, and
an account for the organization will be created in the Google Summer of
Code web app;

4. Students submit project proposals online to work with particular
mentoring organizations;


Peng Tao (BUPT)         Introduction to GSoC and grub4ext4            6 / 37
A Simple workflow


1. Open source projects who’d like to participate in Google Summer of
Code in 2008 should choose an organization administrator(s) to represent
them;

2. Organization administrators will submit the project’s application for
participation online;

3. Google will notify the organization administrators of acceptance, and
an account for the organization will be created in the Google Summer of
Code web app;

4. Students submit project proposals online to work with particular
mentoring organizations;


Peng Tao (BUPT)         Introduction to GSoC and grub4ext4            6 / 37
5. Mentoring organizations rank student proposals and perform any
other due diligence on their potential mentees; student proposals are
matched with a mentor;

6. Google allocates a particular number of student slots to each
organization;

7. Students are notified of acceptance;

8. Students begin learning more about their mentoring organization and
its community before coding work starts;




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4                  7 / 37
5. Mentoring organizations rank student proposals and perform any
other due diligence on their potential mentees; student proposals are
matched with a mentor;

6. Google allocates a particular number of student slots to each
organization;

7. Students are notified of acceptance;

8. Students begin learning more about their mentoring organization and
its community before coding work starts;




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4                  7 / 37
5. Mentoring organizations rank student proposals and perform any
other due diligence on their potential mentees; student proposals are
matched with a mentor;

6. Google allocates a particular number of student slots to each
organization;

7. Students are notified of acceptance;

8. Students begin learning more about their mentoring organization and
its community before coding work starts;




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4                  7 / 37
5. Mentoring organizations rank student proposals and perform any
other due diligence on their potential mentees; student proposals are
matched with a mentor;

6. Google allocates a particular number of student slots to each
organization;

7. Students are notified of acceptance;

8. Students begin learning more about their mentoring organization and
its 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 the
program start date;

10. Mentors and students provide mid-term progress evaluations;

11. Mentors provide a final evaluation of student progress at close of
program; students submit a final review of their mentor and the
program;

12. Student who passes final evaluation uploads completed code to a
Google 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 the
program start date;

10. Mentors and students provide mid-term progress evaluations;

11. Mentors provide a final evaluation of student progress at close of
program; students submit a final review of their mentor and the
program;

12. Student who passes final evaluation uploads completed code to a
Google 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 the
program start date;

10. Mentors and students provide mid-term progress evaluations;

11. Mentors provide a final evaluation of student progress at close of
program; students submit a final review of their mentor and the
program;

12. Student who passes final evaluation uploads completed code to a
Google 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 the
program start date;

10. Mentors and students provide mid-term progress evaluations;

11. Mentors provide a final evaluation of student progress at close of
program; students submit a final review of their mentor and the
program;

12. Student who passes final evaluation uploads completed code to a
Google Code hosted project. Program close up.




Peng Tao (BUPT)       Introduction to GSoC and grub4ext4                8 / 37
1   Google Summer of Code

2   Google Summer of Code 2008

3   Grub4ext4: enable ext4 file system as boot partition




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4   9 / 37
Google Summer of Code 2008




Peng Tao (BUPT)   Introduction to GSoC and grub4ext4   9 / 37
Google Summer of Code 2008



GSoC 2008 was officially announced on February 25 and concluded on
September 2, 2008.

177 open source organizations with more than 3000 ideas.

over 1000 students from all over the world participated. Eighty-three
percent of them received passing final evaluations from their mentors and
communities, the highest rate of success in all four years running the
program.




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                  10 / 37
Google Summer of Code 2008



GSoC 2008 was officially announced on February 25 and concluded on
September 2, 2008.

177 open source organizations with more than 3000 ideas.

over 1000 students from all over the world participated. Eighty-three
percent of them received passing final evaluations from their mentors and
communities, the highest rate of success in all four years running the
program.




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                  10 / 37
Google Summer of Code 2008



GSoC 2008 was officially announced on February 25 and concluded on
September 2, 2008.

177 open source organizations with more than 3000 ideas.

over 1000 students from all over the world participated. Eighty-three
percent of them received passing final evaluations from their mentors and
communities, the highest rate of success in all four years running the
program.




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                  10 / 37
GSoC 2008 organizations




Peng Tao (BUPT)   Introduction to GSoC and grub4ext4   11 / 37
GSoC 2008 organizations




Peng Tao (BUPT)   Introduction to GSoC and grub4ext4   12 / 37
openSUSE in GSoC 2008




openSUSE provided 30 project ideas this year. Ten of them became a
GSoC project and all ten projects passed final evaluation!



Peng Tao (BUPT)     Introduction to GSoC and grub4ext4           13 / 37
openSUSE mentors and students




Peng Tao (BUPT)   Introduction to GSoC and grub4ext4   14 / 37
GSoC 2008 and Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Me

Preparation: Started from last winter, I began to do the RTFC things. I
collected documents and manuals about GRUB legacy, got a slight idea
of how to patch GRUB from GRUB’s side.

Application: There was about two weeks to write my proposal(Officially
only one week, but there was one week’s delay). Communication is very
important while writing proposal, especially with the mentor.

Working on it: Reading kernel and e2fsprogs code, asking questions on
IRC, writing patch, bla bla. A lot of things happened.

Submitting: I submitted my code and documents to Coly Li on August
14.

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 Code

2   Google Summer of Code 2008

3   Grub4ext4: enable ext4 file system as boot partition




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4   16 / 37
Introduction



The 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 is
the most popular bootloader nowadays, doesn’t yet support mounting
and reading ext4 partitions.




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4              16 / 37
Introduction



The 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 is
the most popular bootloader nowadays, doesn’t yet support mounting
and reading ext4 partitions.

As part of Google Summer of Code 2008 program, grub4ext4 aims at
enabling gurb to boot on ext4 partitions.




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4              16 / 37
Introduction(ctd.)




Project home:
http://bergwolf.googlepages.com/grub4ext4

Packages:
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 systems

2   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 systems

2   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 systems

2   receive system calls from user level(e.g.write, open, stat, link)

3   Interact with a specific file system based on mount point traversal

4   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: inode

2   user instantiated file handle: file

3   the whole filesystem metadata: superblock

4   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 file

Inode has operations:
const struct inode operations *i op;
const struct file operations *i fop;

Inodes contain an FS specific information




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4          20 / 37
Linux VFS concepts(ctd.)


File:

Store the process’s information about the file

File 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 the
file object by the kernel

Two file operation tables are maintained per FS: one for directories and
the other for regular files




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4               21 / 37
Linux VFS concepts(ctd.)



Superblock:

Handel metadata only

Responsible for retrieving and storing metadata from FS media or peers

Struct superblock hold things like:
– block device, blocksize, filesystem type, flags, list of (inodes, dirty
inodes, etc) – super operations – wait queue – pointer to the root dentry
of 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 structure

Dentry is a name to inode translation structure

Dentry has Pointers to store the parent-child relationship of the files

Cached aggressively by VFS

Eliminate lookups by FS & private caches, faster lookups for NFS




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                  23 / 37
From ext3 to ext4


    There are four incompatible ext4 features against ext3 defined in
fs/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 in
fs/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 in
fs/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 in
fs/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 in
fs/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 in
fs/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

To enable grub to boot on ext4 filesystem is to provide grub with support for
these incompatible features.




      Peng Tao (BUPT)     Introduction to GSoC and grub4ext4             24 / 37
EXT4 FEATURE INCOMPAT EXTENTS

Ext2/3 uses Indirect mapping to store data on disk.




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4   25 / 37
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 files




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4               26 / 37
extents



ext4 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 files

an extent is a single descriptor for a chunk of contiguous blocks

     efficient to represent large contiguous files
     fewer metadata IO, better CPU utilization




Peng 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 filesystem


struct 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 large
continues 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 marked
with this feature. Group descriptor is fixed sized(32 bytes) in ext2/3 but can
be flexible in ext4(at least 64 bytes).




    Peng Tao (BUPT)       Introduction to GSoC and grub4ext4              31 / 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.




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 BG




flex bg feature allows bitmaps and inode tables for a block group to be
placed anywhere on the storage media.

greatly decrease fsck time




Peng Tao (BUPT)     Introduction to GSoC and grub4ext4              33 / 37
EXT4 FEATURE INCOMPAT FLEX BG




flex bg feature allows bitmaps and inode tables for a block group to be
placed anywhere on the storage media.

greatly decrease fsck time

grub doesn’t interfere with bitmaps but uses group desc structure to
access the inode table, so this feature is naturally supported.




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                33 / 37
Solved problem 1




How 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 block
number 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 a
48bit 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 a
48bit ext4 filesystem?

Physical block number is 64bit in ext4.
In grub4ext4, high 16 bits is checked to avoid reading files whose physical
block number exceeds 32bit limitation.
If a request for such files is received, grub will return ERR FILELENGTH
with error message ”Filesystem compatibility error, cannot read whole file”.




    Peng Tao (BUPT)      Introduction to GSoC and grub4ext4                  35 / 37
Thanks




grub4ext4 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 in
understanding new ext4 features.

Also, without Google Summer of Code program, this project would not
have been grown so quickly. Google, you rock!




Peng Tao (BUPT)      Introduction to GSoC and grub4ext4               36 / 37
Thank you!
                          Q&A
Peng Tao
Broadband Network Research Center
State Key Laboratory of Network and Switching Technology
Beijing University of Posts and Telecommunications
Beijing, 100876, China
bergwolf@gmail.com



Peng Tao (BUPT)   Introduction to GSoC and grub4ext4   37 / 37

Mais conteúdo relacionado

Destaque

Abhishek proposal for gsoc 2014
Abhishek proposal for gsoc 2014Abhishek proposal for gsoc 2014
Abhishek proposal for gsoc 2014Abhishek Kaswan
 
Presentation of GSoC 2016 at Fachhochschule Salzburg
Presentation of GSoC 2016 at Fachhochschule SalzburgPresentation of GSoC 2016 at Fachhochschule Salzburg
Presentation of GSoC 2016 at Fachhochschule SalzburgSergio Fernández
 
GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...João Paulo Rechi Vita
 

Destaque (6)

Abhishek proposal for gsoc 2014
Abhishek proposal for gsoc 2014Abhishek proposal for gsoc 2014
Abhishek proposal for gsoc 2014
 
Proposal gcompris
Proposal gcomprisProposal gcompris
Proposal gcompris
 
GSOC 2016 mifos
GSOC 2016 mifosGSOC 2016 mifos
GSOC 2016 mifos
 
Presentation of GSoC 2016 at Fachhochschule Salzburg
Presentation of GSoC 2016 at Fachhochschule SalzburgPresentation of GSoC 2016 at Fachhochschule Salzburg
Presentation of GSoC 2016 at Fachhochschule Salzburg
 
Safe heart
Safe heartSafe heart
Safe heart
 
GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...
 

Semelhante a gsoc and grub4ext4

Google Summer of Code 2011
Google Summer of Code 2011Google Summer of Code 2011
Google Summer of Code 2011Carol Smith
 
Google Summer of Code 2013 OSCON update
Google Summer of Code 2013 OSCON updateGoogle Summer of Code 2013 OSCON update
Google Summer of Code 2013 OSCON updateCarol Smith
 
Github Developer Pack
Github Developer PackGithub Developer Pack
Github Developer PackThestarsahil
 
github student developer pack with student benifits
github student developer pack with student benifitsgithub student developer pack with student benifits
github student developer pack with student benifitsamithvp002
 
hacktober Collaboration.pptx
hacktober Collaboration.pptxhacktober Collaboration.pptx
hacktober Collaboration.pptxAnandMenon54
 
Open Source and GitHub for Teaching with Software Development Projects
Open Source and GitHub for Teaching with Software Development ProjectsOpen Source and GitHub for Teaching with Software Development Projects
Open Source and GitHub for Teaching with Software Development ProjectsDaniel Nüst
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersDeepikaRana30
 
GDSC PCE Hacktoberfest 1.pptx
GDSC PCE Hacktoberfest 1.pptxGDSC PCE Hacktoberfest 1.pptx
GDSC PCE Hacktoberfest 1.pptxAnandMenon54
 
Hacktoberfest GDSC Pillai College of Engineering
Hacktoberfest GDSC Pillai College of EngineeringHacktoberfest GDSC Pillai College of Engineering
Hacktoberfest GDSC Pillai College of EngineeringAnandMenon54
 
Shipping to Learn and Accelerate Growth with GitHub
Shipping to Learn and Accelerate Growth with GitHubShipping to Learn and Accelerate Growth with GitHub
Shipping to Learn and Accelerate Growth with GitHubOptimizely
 
Awareness about Google Summer Of Code 2018
Awareness about Google Summer Of Code 2018Awareness about Google Summer Of Code 2018
Awareness about Google Summer Of Code 2018Dr. Prital Patel
 
Fostering pre-university student participation in OSGeo through the Google Co...
Fostering pre-university student participation in OSGeo through the Google Co...Fostering pre-university student participation in OSGeo through the Google Co...
Fostering pre-university student participation in OSGeo through the Google Co...Jeff McKenna
 
Internships and Employability.pptx
Internships and Employability.pptxInternships and Employability.pptx
Internships and Employability.pptxharrishadjiantonis1
 
Free and Open Source Software for Geoinformatics in Geosciences Operative an...
Free and Open Source Software for  Geoinformatics in Geosciences Operative an...Free and Open Source Software for  Geoinformatics in Geosciences Operative an...
Free and Open Source Software for Geoinformatics in Geosciences Operative an...Carlos Gabriel Asato
 
GDSC IT Del Info Session.pptx
GDSC IT Del Info Session.pptxGDSC IT Del Info Session.pptx
GDSC IT Del Info Session.pptxsamuel175737
 
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...Women Who Code
 

Semelhante a gsoc and grub4ext4 (20)

Google Summer of Code 2011
Google Summer of Code 2011Google Summer of Code 2011
Google Summer of Code 2011
 
Google Summer of Code 2013 OSCON update
Google Summer of Code 2013 OSCON updateGoogle Summer of Code 2013 OSCON update
Google Summer of Code 2013 OSCON update
 
Github Developer Pack
Github Developer PackGithub Developer Pack
Github Developer Pack
 
github student developer pack with student benifits
github student developer pack with student benifitsgithub student developer pack with student benifits
github student developer pack with student benifits
 
hacktober Collaboration.pptx
hacktober Collaboration.pptxhacktober Collaboration.pptx
hacktober Collaboration.pptx
 
Open Source and GitHub for Teaching with Software Development Projects
Open Source and GitHub for Teaching with Software Development ProjectsOpen Source and GitHub for Teaching with Software Development Projects
Open Source and GitHub for Teaching with Software Development Projects
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginners
 
GDSC PCE Hacktoberfest 1.pptx
GDSC PCE Hacktoberfest 1.pptxGDSC PCE Hacktoberfest 1.pptx
GDSC PCE Hacktoberfest 1.pptx
 
Hacktoberfest GDSC Pillai College of Engineering
Hacktoberfest GDSC Pillai College of EngineeringHacktoberfest GDSC Pillai College of Engineering
Hacktoberfest GDSC Pillai College of Engineering
 
GitHub.docx
GitHub.docxGitHub.docx
GitHub.docx
 
Shipping to Learn and Accelerate Growth with GitHub
Shipping to Learn and Accelerate Growth with GitHubShipping to Learn and Accelerate Growth with GitHub
Shipping to Learn and Accelerate Growth with GitHub
 
Awareness about Google Summer Of Code 2018
Awareness about Google Summer Of Code 2018Awareness about Google Summer Of Code 2018
Awareness about Google Summer Of Code 2018
 
Fostering pre-university student participation in OSGeo through the Google Co...
Fostering pre-university student participation in OSGeo through the Google Co...Fostering pre-university student participation in OSGeo through the Google Co...
Fostering pre-university student participation in OSGeo through the Google Co...
 
Internships and Employability.pptx
Internships and Employability.pptxInternships and Employability.pptx
Internships and Employability.pptx
 
Free and Open Source Software for Geoinformatics in Geosciences Operative an...
Free and Open Source Software for  Geoinformatics in Geosciences Operative an...Free and Open Source Software for  Geoinformatics in Geosciences Operative an...
Free and Open Source Software for Geoinformatics in Geosciences Operative an...
 
Let's talk FOSS!
Let's talk FOSS!Let's talk FOSS!
Let's talk FOSS!
 
GDSC IT Del Info Session.pptx
GDSC IT Del Info Session.pptxGDSC IT Del Info Session.pptx
GDSC IT Del Info Session.pptx
 
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...
9-July-2014 Open Source Software Panel - Google Summer of Code & Code-In intr...
 
DSC - info session 2022.pptx
DSC - info session 2022.pptxDSC - info session 2022.pptx
DSC - info session 2022.pptx
 
Hacktoberfest 23.pptx
Hacktoberfest 23.pptxHacktoberfest 23.pptx
Hacktoberfest 23.pptx
 

Mais de bergwolf

NFS updates for CLSF
NFS updates for CLSFNFS updates for CLSF
NFS updates for CLSFbergwolf
 
Google Megastore
Google MegastoreGoogle Megastore
Google Megastorebergwolf
 
vmfs intro
vmfs introvmfs intro
vmfs introbergwolf
 
pnfs status
pnfs statuspnfs status
pnfs statusbergwolf
 
linux trim
linux trimlinux trim
linux trimbergwolf
 
network filesystem briefs
network filesystem briefsnetwork filesystem briefs
network filesystem briefsbergwolf
 
grub4ext4 status-plans
grub4ext4 status-plansgrub4ext4 status-plans
grub4ext4 status-plansbergwolf
 

Mais de bergwolf (11)

NFS updates for CLSF
NFS updates for CLSFNFS updates for CLSF
NFS updates for CLSF
 
Linux aio
Linux aioLinux aio
Linux aio
 
RCU
RCURCU
RCU
 
CLFS 2010
CLFS 2010CLFS 2010
CLFS 2010
 
Google Megastore
Google MegastoreGoogle Megastore
Google Megastore
 
vmfs intro
vmfs introvmfs intro
vmfs intro
 
pnfs status
pnfs statuspnfs status
pnfs status
 
linux trim
linux trimlinux trim
linux trim
 
network filesystem briefs
network filesystem briefsnetwork filesystem briefs
network filesystem briefs
 
logfs
logfslogfs
logfs
 
grub4ext4 status-plans
grub4ext4 status-plansgrub4ext4 status-plans
grub4ext4 status-plans
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

gsoc and grub4ext4

  • 1. GSoC & grub4ext4 Peng Tao BUPT—Broadband Network Research Center Peng Tao (BUPT) Introduction to GSoC and grub4ext4 1 / 37
  • 2. Agenda 1 Google Summer of Code 2 Google Summer of Code 2008 3 Grub4ext4: enable ext4 file system as boot partition Peng Tao (BUPT) Introduction to GSoC and grub4ext4 2 / 37
  • 3. About Me Peng Tao Broadband Network Research Center, BUPT Graduate at Apr,2010(expected) bergwolf@gmail.com Copyright c 2008. No rights reserved except that of others. Bergwolf Peng Tao (BUPT) Introduction to GSoC and grub4ext4 3 / 37
  • 4. 1 Google Summer of Code 2 Google Summer of Code 2008 3 Grub4ext4: enable ext4 file system as boot partition Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • 5. What is Google Summer of Code? Google Summer of Code (GSoC) is a program that offers student developers stipends to write code for various open source projects. Google will be working with several open source, free software, and technology-related groups to identify and fund several projects over a three month period. Kicked off in 2005. In 2005, 2006 and 2007, the program has brought together over 1,500 students with over 130 open source projects to create millions of lines of code. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • 6. What is Google Summer of Code? Google Summer of Code (GSoC) is a program that offers student developers stipends to write code for various open source projects. Google will be working with several open source, free software, and technology-related groups to identify and fund several projects over a three month period. Kicked off in 2005. In 2005, 2006 and 2007, the program has brought together over 1,500 students with over 130 open source projects to create millions of lines of code. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • 7. What is Google Summer of Code? Google Summer of Code (GSoC) is a program that offers student developers stipends to write code for various open source projects. Google will be working with several open source, free software, and technology-related groups to identify and fund several projects over a three month period. Kicked off in 2005. In 2005, 2006 and 2007, the program has brought together over 1,500 students with over 130 open source projects to create millions of lines of code. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 4 / 37
  • 8. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 9. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 10. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 11. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 12. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 13. Goals of Google Summer of Code Google 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 source development; Help open source projects identify and bring in new developers and committers; Provide students in Computer Science and related fields the opportunity to do work related to their academic pursuits (think ”flip bits, not burgers”); Give students more exposure to real-world software development scenarios (e.g., distributed development, software licensing questions, mailing-list etiquette). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 5 / 37
  • 14. A Simple workflow 1. Open source projects who’d like to participate in Google Summer of Code in 2008 should choose an organization administrator(s) to represent them; 2. Organization administrators will submit the project’s application for participation online; 3. Google will notify the organization administrators of acceptance, and an account for the organization will be created in the Google Summer of Code web app; 4. Students submit project proposals online to work with particular mentoring organizations; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 15. A Simple workflow 1. Open source projects who’d like to participate in Google Summer of Code in 2008 should choose an organization administrator(s) to represent them; 2. Organization administrators will submit the project’s application for participation online; 3. Google will notify the organization administrators of acceptance, and an account for the organization will be created in the Google Summer of Code web app; 4. Students submit project proposals online to work with particular mentoring organizations; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 16. A Simple workflow 1. Open source projects who’d like to participate in Google Summer of Code in 2008 should choose an organization administrator(s) to represent them; 2. Organization administrators will submit the project’s application for participation online; 3. Google will notify the organization administrators of acceptance, and an account for the organization will be created in the Google Summer of Code web app; 4. Students submit project proposals online to work with particular mentoring organizations; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 17. A Simple workflow 1. Open source projects who’d like to participate in Google Summer of Code in 2008 should choose an organization administrator(s) to represent them; 2. Organization administrators will submit the project’s application for participation online; 3. Google will notify the organization administrators of acceptance, and an account for the organization will be created in the Google Summer of Code web app; 4. Students submit project proposals online to work with particular mentoring organizations; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 18. A Simple workflow 1. Open source projects who’d like to participate in Google Summer of Code in 2008 should choose an organization administrator(s) to represent them; 2. Organization administrators will submit the project’s application for participation online; 3. Google will notify the organization administrators of acceptance, and an account for the organization will be created in the Google Summer of Code web app; 4. Students submit project proposals online to work with particular mentoring organizations; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 6 / 37
  • 19. 5. Mentoring organizations rank student proposals and perform any other due diligence on their potential mentees; student proposals are matched with a mentor; 6. Google allocates a particular number of student slots to each organization; 7. Students are notified of acceptance; 8. Students begin learning more about their mentoring organization and its community before coding work starts; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 20. 5. Mentoring organizations rank student proposals and perform any other due diligence on their potential mentees; student proposals are matched with a mentor; 6. Google allocates a particular number of student slots to each organization; 7. Students are notified of acceptance; 8. Students begin learning more about their mentoring organization and its community before coding work starts; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 21. 5. Mentoring organizations rank student proposals and perform any other due diligence on their potential mentees; student proposals are matched with a mentor; 6. Google allocates a particular number of student slots to each organization; 7. Students are notified of acceptance; 8. Students begin learning more about their mentoring organization and its community before coding work starts; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 22. 5. Mentoring organizations rank student proposals and perform any other due diligence on their potential mentees; student proposals are matched with a mentor; 6. Google allocates a particular number of student slots to each organization; 7. Students are notified of acceptance; 8. Students begin learning more about their mentoring organization and its community before coding work starts; Peng Tao (BUPT) Introduction to GSoC and grub4ext4 7 / 37
  • 23. 9. Students begin coding work at the official start of the program, provided they’ve interacted well with their community up until the program start date; 10. Mentors and students provide mid-term progress evaluations; 11. Mentors provide a final evaluation of student progress at close of program; students submit a final review of their mentor and the program; 12. Student who passes final evaluation uploads completed code to a Google Code hosted project. Program close up. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 24. 9. Students begin coding work at the official start of the program, provided they’ve interacted well with their community up until the program start date; 10. Mentors and students provide mid-term progress evaluations; 11. Mentors provide a final evaluation of student progress at close of program; students submit a final review of their mentor and the program; 12. Student who passes final evaluation uploads completed code to a Google Code hosted project. Program close up. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 25. 9. Students begin coding work at the official start of the program, provided they’ve interacted well with their community up until the program start date; 10. Mentors and students provide mid-term progress evaluations; 11. Mentors provide a final evaluation of student progress at close of program; students submit a final review of their mentor and the program; 12. Student who passes final evaluation uploads completed code to a Google Code hosted project. Program close up. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 26. 9. Students begin coding work at the official start of the program, provided they’ve interacted well with their community up until the program start date; 10. Mentors and students provide mid-term progress evaluations; 11. Mentors provide a final evaluation of student progress at close of program; students submit a final review of their mentor and the program; 12. Student who passes final evaluation uploads completed code to a Google Code hosted project. Program close up. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 8 / 37
  • 27. 1 Google Summer of Code 2 Google Summer of Code 2008 3 Grub4ext4: enable ext4 file system as boot partition Peng Tao (BUPT) Introduction to GSoC and grub4ext4 9 / 37
  • 28. Google Summer of Code 2008 Peng Tao (BUPT) Introduction to GSoC and grub4ext4 9 / 37
  • 29. Google Summer of Code 2008 GSoC 2008 was officially announced on February 25 and concluded on September 2, 2008. 177 open source organizations with more than 3000 ideas. over 1000 students from all over the world participated. Eighty-three percent of them received passing final evaluations from their mentors and communities, the highest rate of success in all four years running the program. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • 30. Google Summer of Code 2008 GSoC 2008 was officially announced on February 25 and concluded on September 2, 2008. 177 open source organizations with more than 3000 ideas. over 1000 students from all over the world participated. Eighty-three percent of them received passing final evaluations from their mentors and communities, the highest rate of success in all four years running the program. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • 31. Google Summer of Code 2008 GSoC 2008 was officially announced on February 25 and concluded on September 2, 2008. 177 open source organizations with more than 3000 ideas. over 1000 students from all over the world participated. Eighty-three percent of them received passing final evaluations from their mentors and communities, the highest rate of success in all four years running the program. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 10 / 37
  • 32. GSoC 2008 organizations Peng Tao (BUPT) Introduction to GSoC and grub4ext4 11 / 37
  • 33. GSoC 2008 organizations Peng Tao (BUPT) Introduction to GSoC and grub4ext4 12 / 37
  • 34. openSUSE in GSoC 2008 openSUSE provided 30 project ideas this year. Ten of them became a GSoC project and all ten projects passed final evaluation! Peng Tao (BUPT) Introduction to GSoC and grub4ext4 13 / 37
  • 35. openSUSE mentors and students Peng Tao (BUPT) Introduction to GSoC and grub4ext4 14 / 37
  • 36. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 37. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 38. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 39. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 40. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 41. GSoC 2008 and Me Preparation: Started from last winter, I began to do the RTFC things. I collected documents and manuals about GRUB legacy, got a slight idea of how to patch GRUB from GRUB’s side. Application: There was about two weeks to write my proposal(Officially only one week, but there was one week’s delay). Communication is very important while writing proposal, especially with the mentor. Working on it: Reading kernel and e2fsprogs code, asking questions on IRC, writing patch, bla bla. A lot of things happened. Submitting: I submitted my code and documents to Coly Li on August 14. 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
  • 42. 1 Google Summer of Code 2 Google Summer of Code 2008 3 Grub4ext4: enable ext4 file system as boot partition Peng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • 43. Introduction The 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 is the most popular bootloader nowadays, doesn’t yet support mounting and reading ext4 partitions. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • 44. Introduction The 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 is the most popular bootloader nowadays, doesn’t yet support mounting and reading ext4 partitions. As part of Google Summer of Code 2008 program, grub4ext4 aims at enabling gurb to boot on ext4 partitions. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 16 / 37
  • 46. 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
  • 47. 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 2 receive system calls from user level(e.g.write, open, stat, link) Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • 48. 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 2 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
  • 49. 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 2 receive system calls from user level(e.g.write, open, stat, link) 3 Interact with a specific file system based on mount point traversal 4 receive request from other parts of the kernel, mostly from memory management Peng Tao (BUPT) Introduction to GSoC and grub4ext4 18 / 37
  • 50. Linux VFS concepts(ctd.) VFS data structures: 1 VFS handle for the file: inode 2 user instantiated file handle: file 3 the whole filesystem metadata: superblock 4 a name to inode translation: dentry Peng Tao (BUPT) Introduction to GSoC and grub4ext4 19 / 37
  • 51. Linux VFS concepts(ctd.) Inodes: Inode object is the kernel representation of the low level file Inode has operations: const struct inode operations *i op; const struct file operations *i fop; Inodes contain an FS specific information Peng Tao (BUPT) Introduction to GSoC and grub4ext4 20 / 37
  • 52. Linux VFS concepts(ctd.) File: Store the process’s information about the file File 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 the file object by the kernel Two file operation tables are maintained per FS: one for directories and the other for regular files Peng Tao (BUPT) Introduction to GSoC and grub4ext4 21 / 37
  • 53. Linux VFS concepts(ctd.) Superblock: Handel metadata only Responsible for retrieving and storing metadata from FS media or peers Struct superblock hold things like: – block device, blocksize, filesystem type, flags, list of (inodes, dirty inodes, etc) – super operations – wait queue – pointer to the root dentry of the FS – etc... Peng Tao (BUPT) Introduction to GSoC and grub4ext4 22 / 37
  • 54. Linux VFS concepts(ctd.) Dentry: The kernel uses dentries to represent the file system structure Dentry is a name to inode translation structure Dentry has Pointers to store the parent-child relationship of the files Cached aggressively by VFS Eliminate lookups by FS & private caches, faster lookups for NFS Peng Tao (BUPT) Introduction to GSoC and grub4ext4 23 / 37
  • 55. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/ext4/ext4.h: Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • 56. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • 57. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/ext4/ext4.h: 1 EXT4 FEATURE INCOMPAT EXTENTS 2 EXT4 FEATURE INCOMPAT 64BIT Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • 58. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/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
  • 59. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/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
  • 60. From ext3 to ext4 There are four incompatible ext4 features against ext3 defined in fs/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 To enable grub to boot on ext4 filesystem is to provide grub with support for these incompatible features. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 24 / 37
  • 61. EXT4 FEATURE INCOMPAT EXTENTS Ext2/3 uses Indirect mapping to store data on disk. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 25 / 37
  • 62. 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 files Peng Tao (BUPT) Introduction to GSoC and grub4ext4 26 / 37
  • 63. extents ext4 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 files an extent is a single descriptor for a chunk of contiguous blocks efficient to represent large contiguous files fewer metadata IO, better CPU utilization Peng Tao (BUPT) Introduction to GSoC and grub4ext4 26 / 37
  • 64. 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 filesystem struct 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
  • 65. extent mapping Ext4 uses extent mapping, which is an advantage when storing large continues files. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 28 / 37
  • 66. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 29 / 37
  • 67. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 30 / 37
  • 68. EXT4 FEATURE INCOMPAT 64BIT Currently(kernel 2.26.1), only changes in group descriptor are marked with this feature. Group descriptor is fixed sized(32 bytes) in ext2/3 but can be flexible in ext4(at least 64 bytes). Peng Tao (BUPT) Introduction to GSoC and grub4ext4 31 / 37
  • 69. 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. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 32 / 37
  • 70. 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
  • 71. EXT4 FEATURE INCOMPAT FLEX BG flex bg feature allows bitmaps and inode tables for a block group to be placed anywhere on the storage media. greatly decrease fsck time Peng Tao (BUPT) Introduction to GSoC and grub4ext4 33 / 37
  • 72. EXT4 FEATURE INCOMPAT FLEX BG flex bg feature allows bitmaps and inode tables for a block group to be placed anywhere on the storage media. greatly decrease fsck time grub doesn’t interfere with bitmaps but uses group desc structure to access the inode table, so this feature is naturally supported. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 33 / 37
  • 73. Solved problem 1 How about ext3 files that are left unchanged on ext4 file system? Peng Tao (BUPT) Introduction to GSoC and grub4ext4 34 / 37
  • 74. 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 block number to physical block number in grub. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 34 / 37
  • 75. Solved problem 2 What if physical block number of a file exceeds 32bit limitation on a 48bit ext4 filesystem? Peng Tao (BUPT) Introduction to GSoC and grub4ext4 35 / 37
  • 76. Solved problem 2 What if physical block number of a file exceeds 32bit limitation on a 48bit ext4 filesystem? Physical block number is 64bit in ext4. In grub4ext4, high 16 bits is checked to avoid reading files whose physical block number exceeds 32bit limitation. If a request for such files is received, grub will return ERR FILELENGTH with error message ”Filesystem compatibility error, cannot read whole file”. Peng Tao (BUPT) Introduction to GSoC and grub4ext4 35 / 37
  • 77. Thanks grub4ext4 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 in understanding new ext4 features. Also, without Google Summer of Code program, this project would not have been grown so quickly. Google, you rock! Peng Tao (BUPT) Introduction to GSoC and grub4ext4 36 / 37
  • 78. Thank you! Q&A Peng Tao Broadband Network Research Center State Key Laboratory of Network and Switching Technology Beijing University of Posts and Telecommunications Beijing, 100876, China bergwolf@gmail.com Peng Tao (BUPT) Introduction to GSoC and grub4ext4 37 / 37