13

Click here to load reader

20080622 grub4ext4 status-plans

  • Upload
    linuxfb

  • View
    209

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 20080622 grub4ext4 status-plans

Grub4ext4

grub4ext4: Current Status and Future Plans

[email protected]

Broad-band Network Research Center

Page 2: 20080622 grub4ext4 status-plans

Grub4ext4

Agenda

1 Introduction to grub4ext4

2 Current Status

3 Future Plans

Page 3: 20080622 grub4ext4 status-plans

Grub4ext4

Introduction to grub4ext4

What is grub4ext4?

grub4ext4 is a 2008 Google Summer of Code program,working with opensuse.org mentored by Colyli.

grub4ext4 aims at enabling GRUB legacy to boot an ext4partition.

The program is hosted athttp://code.google.com/p/grub4ext4/,

Development notes can be found athttp://bergwolf.googlepages.com/grub4ext4.

Page 4: 20080622 grub4ext4 status-plans

Grub4ext4

Introduction to grub4ext4

Proposed features of grub4ext4

The initial motivation of ext4 file system is to support larger singlepartition using larger block numbers.There are several incompatible features in ext4 that disables GRUBlegacy from booting an ext4 partition.

Replace indirect mapping with extent mapping.

64-bit metadata(superblock, inode, group descriptor) changes.

Flexible block groups. This allows metadata blocks to begrouped together outside of the block group that theyadminister, allowing contiguous regions of data blocks to spanmultiple block groups, and making metadata intensiveworkloads seek less.

Multiple mount protection. Not implemented yet(as of Linuxkernel 2.6.25.1)

Page 5: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

Agenda

1 Introduction to grub4ext4

2 Current Status

3 Future Plans

Page 6: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

Current status of grub4ext4

Now GRUB legacy is able to read extents enabledpartitions(without other ext4 incompatible features).

Each file in the file system is divided into several logicalblocks, and stored on disk in forms of several physical blocks.

Ext4 file system uses extent mapping to map the logical blocknumber of a file to physical block number, which is differentfrom indirect mapping in ext2/3.

Page 7: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

Indirect mapping in ext2/3

Figure: ext2/3 indirect mapping, image taken from ’Taking advantage ofExt3 journaling file system in a forensic investigation’ [email protected]

Page 8: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

Extent mapping

The biggest advantage of extent mapping over indirect mapping isthat it avoids disk seeking when the file is allocated continuously.

Figure: ext4 extent mapping, image taken from ’Ext4: The NextGeneration of Ext2/3’ by Theodore Ts’o

Page 9: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

i block(60 bytes) in ext4 inode structure can first store oneext4 extent header and four ext4 extent. When the file needs morethan four ext4 extent, it expands to an extent tree.

Figure: ext4 extent tree, image taken from ’The new ext4 filesystem:current status and future plans’ by Andreas Dilger and Alex Tomas

Page 10: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

What I have done?

Based on ext4 ext find extent, I implemented static intext4fs block map(int logical block), which looks for the physicalblock number mapped to logical block instead of building theextent path which traversal the extents tree.It working in this way:

(1)Check eh depth in extent header. eh depth==0, go to(3),otherwise go to(2)

(2)the current level if index. Find the extent index closestto(which means the smallest ei block that is larger than thelogical block) the logical block we are looking for. Read theblock pointed by the index found in (2) into buffer. Go to (1)

(3)the current level is the leaf. So look for the closest extentand return the physical block.

Page 11: 20080622 grub4ext4 status-plans

Grub4ext4

Current Status

Test results

I have run a simple test on my code. It worked just fine on 8partitions(four ext3 partitions and four ext4 partitions with extentsfeature enabled) on my USB storage device.

You can check the test procedure athttp://bergwolf.googlepages.com/test case1, and build your owntest case if you are interested.

Page 12: 20080622 grub4ext4 status-plans

Grub4ext4

Future Plans

Future work

support incompatible 64-bit metadata changes. This is mainlyabout supporting changes in group descriptor. I can checkEXT4 FEATURE INCOMPAT 64BIT in superblock anddetermine which type of group descriptor to use.

support flexible block groups.

Page 13: 20080622 grub4ext4 status-plans

Grub4ext4

Future Plans

Q&A

Thank You!

no rights reserved except that of others