SlideShare a Scribd company logo
1 of 33
Why we need ext4?
Robin Dong <sanbai@taobao.com>
ext2 global layout
Image from: http://learn.akae.cn/media/ch29s02.html
ext2 global layout
Super Block (1 block)
GDT (multi blocks)
Block Bitmap (1 block)
Inode Bitmap (1 block)
Inode table (multi blocks)
Super-block and GDT are vital, therefore
other groups will store their copies.
If mkfs with “sparse_super”(default) not
all groups have the copy of super block
and GDT, only Group
0,1,3,5,7,32
,52
,72
,33
,53
,73
....have it.
ext2 global layout
There is a structure called
“Reserved GDT”
which is putted after GDT and before
Block-bitmap, it is also a large file.
It is used for “resize” feature which
could expand the size of whole
filesystem.
ext2 file layout
Image from: http://e2fsprogs.sourceforge.net/ext2intro.html
The ext2 directory layout is just like
regular file, but the content of its
data block is stored by
“struct ext2_dir_entry”
ext2 directory layout
Image from: http://www.pluto.it/files/journal/pj9811/e2fs.html
The length of ext2_dir_entry is
obviously different, so when users try
to find a file in directory, ext2 have to
check filename one by one. (It can't
use some algorithm like binary-
search)
If there is a large number of files in a
directory, searching operation will be
inefficent.
ext2 directory layout
ext2 directory remove
Image from: http://blog.csdn.net/anghlq/archive/2011/05/17/6427052.aspx
ext2 directory pack
● e2fsck -D
● Optimize directories in filesystem. This
option causes e2fsck to try to optimize all
directories, either by reindexing them if
the filesystem supports directory
indexing, or by sorting and compressing
directories for smaller directories, or for
filesystems using traditional linear
directories.
● Regular Symlink: link path is stored in
data block
● Fast Symlink: link path is stored in
inode (if link path is smaller than 56
bytes)
ext2 symlink
ext2 symlink
Image from: http://www.pluto.it/files/journal/pj9811/e2fs.html
ext2 hard link
ext2 xattr
ext2 xattr
● * +--------------------+
●
* | header |
●
* | entry 1 | |
● * | entry 2 | | growing downwards
●
* | entry 3 | v
● * | four null bytes |
● * | . . . |
●
* | value 1 | ^
● * | value 3 | | growing upwards
●
* | value 2 | |
● * +--------------------+
ext2: badblock
● e2fsck use program “badblocks” to
detect bad blocks and mark these
blocks as “used” in block bitmap.
● If meta-data is in bad blocks,e2fsck
will try to allocate new block for it.
enhane of ext3
● Journal
ext3 could be looked like an ext2
filesystem with a journal file
● dir_index
more efficent directory-searching
ext3: journal
● ext2 filesystem may corrupt after reboot from
exception like power reset directly.
● Journal will ensure filesystem consistent or
recovery filesystem on system boot.
● Journal mode
● Writeback
● Ordered
● Journal
ext3: dir_index
● Compute hash
value of
ext3_dir_entry
● Find dx_entry
against hash value
in root block by
binary-search
● Find ext3_dir_entry
in leaf block one by
one
ext3: dir_index
● Advantage: dir_index could have no more
than two level indexs , therefore finding a file
in directory needs to read 3 blocks at most.
Imaging an ext3 filesystem with 4K block
size, a directory could contain about 5 million
files (file name is 100 bytes)
● Disadvantage: when add files to a directory,
the b-tree will split, but after deleting files,
the b-tree will not merge.
A directory with a few files will occupy many
blocks.
ext3 xattr
● Put xattr into inode.
● Less IO
● mkfs.ext3 -I 256 /dev/sda
limits of ext2/ext3
Block Size Max file size Max filesystem size
1KB 16GB 2TB
2KB 256GB 8TB
4KB 2TB 16TB
8KB (ppc arch) 2TB 32TB
● Read data from the indirect block of a
file will make extra IO
ext4
● ext4 inherits all the features of
ext2/ext3
● Larger filesystem
Max file size: 16TB
Max filesystem size: 1EB(1048576TB)
ext4: meta_bg
Image from: http://www.ibm.com/developerworks/cn/linux/l-cn-filesrc5/
ext4: meta_bg
● Group Descriptor size is 64 bytes
● Imaging an ext4 filesystem with block_size =
1K
1K/64 = 16
a meta group will contain 16 groups.
The meta-GDT(1 block) will be put in Group
0, Group1, Group15
Group 16, Group17, Group31
Group 32, Group33, Group63
…...
ext4: flex_bg
ext4: flex_bg
● Merge Block-Bitmap/Inode-
Bitmap/Inode-table to Group 0
● The position of Super-block and GDT
follow the rule of “sparse”
● Advantage: save the space of Group
1,Group 2,Group 3 (especially for the
extent of ext4)
ext4: uninit_bg
● mkfs.ext4 -O uninit_bg
● Create a filesystem without initializing all of
the block groups. This feature also
enables checksums and highest-inode-used
statistics in each blockgroup. This feature
can speed up filesystem creation time
noticeably (if lazy_itable_init is enabled), and
can also reduce e2fsck time dramatically.
ext4: uninit_bg
● When init block-group?
● lazy_itable_init run
● ext4_new_inode →
ext4_read_block_bitmap
ext4: extent
Image from:
http://www.ibm.com/developerworks/cn/linux/l-cn-
filesrc5/
ext4: extent
● An ext4_extent could point to 128MB
continuious space.
● Example: a 300G file in ext3 will
occupied 300MB meta-data-blocks,
but in ext4 it only occupuied 36KB
ext4: delay allocation
● It consists of delaying block allocation
until the data is going to be written to
the disk
● This improves performance and
reduces fragmentation by improving
block allocation decisions based on
the actual file size
33
Q & A
Thanks!

More Related Content

What's hot

FUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspaceFUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspaceelliando dias
 
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxTushar B Kute
 
b tree file system report
b tree file system reportb tree file system report
b tree file system reportDinesh Gupta
 
A fast file system for unix presentation by parang saraf (cs5204 VT)
A fast file system for unix presentation by parang saraf (cs5204 VT)A fast file system for unix presentation by parang saraf (cs5204 VT)
A fast file system for unix presentation by parang saraf (cs5204 VT)Parang Saraf
 
Advfs 3 in-memory structures
Advfs 3 in-memory structuresAdvfs 3 in-memory structures
Advfs 3 in-memory structuresJustin Goldberg
 
B tree file system
B tree file systemB tree file system
B tree file systemDinesh Gupta
 
Glusterfs session #1 disk filesystems
Glusterfs session #1   disk filesystemsGlusterfs session #1   disk filesystems
Glusterfs session #1 disk filesystemsPranith Karampuri
 
101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystemsAcácio Oliveira
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondZubair Nabi
 
Introduction to file system and OCFS2
Introduction to file system and OCFS2Introduction to file system and OCFS2
Introduction to file system and OCFS2Gang He
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file systemGang He
 
Osdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkOsdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkUdo Seidel
 
Perbedaan antar computer filesystem 5109100164
Perbedaan antar computer filesystem 5109100164Perbedaan antar computer filesystem 5109100164
Perbedaan antar computer filesystem 5109100164Budi Raharjo
 
Glusterfs session #2 1 layer above disk filesystems
Glusterfs session #2   1 layer above disk filesystemsGlusterfs session #2   1 layer above disk filesystems
Glusterfs session #2 1 layer above disk filesystemsPranith Karampuri
 
Btrfs current status and_future_prospects
Btrfs current status and_future_prospectsBtrfs current status and_future_prospects
Btrfs current status and_future_prospectsfj_staoru_takeuchi
 
File system.
File system.File system.
File system.elyza12
 
m+storeMemory storage
m+storeMemory storagem+storeMemory storage
m+storeMemory storageOwen Funnell
 
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel DreyfusFUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfuseurobsdcon
 

What's hot (20)

FUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspaceFUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspace
 
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
 
b tree file system report
b tree file system reportb tree file system report
b tree file system report
 
A fast file system for unix presentation by parang saraf (cs5204 VT)
A fast file system for unix presentation by parang saraf (cs5204 VT)A fast file system for unix presentation by parang saraf (cs5204 VT)
A fast file system for unix presentation by parang saraf (cs5204 VT)
 
Advfs 3 in-memory structures
Advfs 3 in-memory structuresAdvfs 3 in-memory structures
Advfs 3 in-memory structures
 
B tree file system
B tree file systemB tree file system
B tree file system
 
Glusterfs session #1 disk filesystems
Glusterfs session #1   disk filesystemsGlusterfs session #1   disk filesystems
Glusterfs session #1 disk filesystems
 
101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyond
 
Introduction to file system and OCFS2
Introduction to file system and OCFS2Introduction to file system and OCFS2
Introduction to file system and OCFS2
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file system
 
Osdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkOsdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talk
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
Perbedaan antar computer filesystem 5109100164
Perbedaan antar computer filesystem 5109100164Perbedaan antar computer filesystem 5109100164
Perbedaan antar computer filesystem 5109100164
 
Glusterfs session #2 1 layer above disk filesystems
Glusterfs session #2   1 layer above disk filesystemsGlusterfs session #2   1 layer above disk filesystems
Glusterfs session #2 1 layer above disk filesystems
 
Btrfs current status and_future_prospects
Btrfs current status and_future_prospectsBtrfs current status and_future_prospects
Btrfs current status and_future_prospects
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
File system.
File system.File system.
File system.
 
m+storeMemory storage
m+storeMemory storagem+storeMemory storage
m+storeMemory storage
 
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel DreyfusFUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
 

Similar to ext2-110628041727-phpapp02

TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsShu-Yu Fu
 
grub4ext4 status-plans
grub4ext4 status-plansgrub4ext4 status-plans
grub4ext4 status-plansbergwolf
 
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliOSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliNETWAYS
 
Root file system
Root file systemRoot file system
Root file systemBindu U
 
Raspberry pi Part 5
Raspberry pi Part 5Raspberry pi Part 5
Raspberry pi Part 5Techvilla
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemKumar Amit Mehta
 
How to install gentoo distributed
How to install gentoo distributedHow to install gentoo distributed
How to install gentoo distributedSongWang54
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Linuxconeurope2011.ext4btrfs.talk
Linuxconeurope2011.ext4btrfs.talkLinuxconeurope2011.ext4btrfs.talk
Linuxconeurope2011.ext4btrfs.talkUdo Seidel
 
OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)Chinmaya M. N
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsBimal Jain
 
There are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docxThere are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docxsusannr
 
PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSTomas Vondra
 
There are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docxThere are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docxsusannr
 
There are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docxThere are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docxsusannr
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyNugroho Gito
 

Similar to ext2-110628041727-phpapp02 (20)

TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
 
grub4ext4 status-plans
grub4ext4 status-plansgrub4ext4 status-plans
grub4ext4 status-plans
 
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliOSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
 
Ext filesystem4
Ext filesystem4Ext filesystem4
Ext filesystem4
 
Root file system
Root file systemRoot file system
Root file system
 
Raspberry pi Part 5
Raspberry pi Part 5Raspberry pi Part 5
Raspberry pi Part 5
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File system
 
Linuxdiskmanagementcommands
LinuxdiskmanagementcommandsLinuxdiskmanagementcommands
Linuxdiskmanagementcommands
 
How to install gentoo distributed
How to install gentoo distributedHow to install gentoo distributed
How to install gentoo distributed
 
Lect11
Lect11Lect11
Lect11
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
pptdisk
pptdiskpptdisk
pptdisk
 
Linuxconeurope2011.ext4btrfs.talk
Linuxconeurope2011.ext4btrfs.talkLinuxconeurope2011.ext4btrfs.talk
Linuxconeurope2011.ext4btrfs.talk
 
OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
There are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docxThere are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docx
 
PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFS
 
There are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docxThere are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docx
 
There are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docxThere are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docx
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 

More from Hao(Robin) Dong

flashcache原理及改造
flashcache原理及改造flashcache原理及改造
flashcache原理及改造Hao(Robin) Dong
 
Ext4 Bigalloc report public
Ext4 Bigalloc report publicExt4 Bigalloc report public
Ext4 Bigalloc report publicHao(Robin) Dong
 
Ext4 new feature - bigalloc
Ext4 new feature - bigallocExt4 new feature - bigalloc
Ext4 new feature - bigallocHao(Robin) Dong
 
Kernel在多核机器上的负载均衡机制
Kernel在多核机器上的负载均衡机制Kernel在多核机器上的负载均衡机制
Kernel在多核机器上的负载均衡机制Hao(Robin) Dong
 
Linux下Poll和Epoll内核源码剖析
Linux下Poll和Epoll内核源码剖析Linux下Poll和Epoll内核源码剖析
Linux下Poll和Epoll内核源码剖析Hao(Robin) Dong
 

More from Hao(Robin) Dong (8)

Transformer and BERT
Transformer and BERTTransformer and BERT
Transformer and BERT
 
Google TPU
Google TPUGoogle TPU
Google TPU
 
flashcache原理及改造
flashcache原理及改造flashcache原理及改造
flashcache原理及改造
 
Ext4 Bigalloc report public
Ext4 Bigalloc report publicExt4 Bigalloc report public
Ext4 Bigalloc report public
 
Overlayfs and VFS
Overlayfs and VFSOverlayfs and VFS
Overlayfs and VFS
 
Ext4 new feature - bigalloc
Ext4 new feature - bigallocExt4 new feature - bigalloc
Ext4 new feature - bigalloc
 
Kernel在多核机器上的负载均衡机制
Kernel在多核机器上的负载均衡机制Kernel在多核机器上的负载均衡机制
Kernel在多核机器上的负载均衡机制
 
Linux下Poll和Epoll内核源码剖析
Linux下Poll和Epoll内核源码剖析Linux下Poll和Epoll内核源码剖析
Linux下Poll和Epoll内核源码剖析
 

ext2-110628041727-phpapp02

  • 1. Why we need ext4? Robin Dong <sanbai@taobao.com>
  • 2. ext2 global layout Image from: http://learn.akae.cn/media/ch29s02.html
  • 3. ext2 global layout Super Block (1 block) GDT (multi blocks) Block Bitmap (1 block) Inode Bitmap (1 block) Inode table (multi blocks)
  • 4. Super-block and GDT are vital, therefore other groups will store their copies. If mkfs with “sparse_super”(default) not all groups have the copy of super block and GDT, only Group 0,1,3,5,7,32 ,52 ,72 ,33 ,53 ,73 ....have it. ext2 global layout
  • 5. There is a structure called “Reserved GDT” which is putted after GDT and before Block-bitmap, it is also a large file. It is used for “resize” feature which could expand the size of whole filesystem.
  • 6. ext2 file layout Image from: http://e2fsprogs.sourceforge.net/ext2intro.html
  • 7. The ext2 directory layout is just like regular file, but the content of its data block is stored by “struct ext2_dir_entry” ext2 directory layout Image from: http://www.pluto.it/files/journal/pj9811/e2fs.html
  • 8. The length of ext2_dir_entry is obviously different, so when users try to find a file in directory, ext2 have to check filename one by one. (It can't use some algorithm like binary- search) If there is a large number of files in a directory, searching operation will be inefficent. ext2 directory layout
  • 9. ext2 directory remove Image from: http://blog.csdn.net/anghlq/archive/2011/05/17/6427052.aspx
  • 10. ext2 directory pack ● e2fsck -D ● Optimize directories in filesystem. This option causes e2fsck to try to optimize all directories, either by reindexing them if the filesystem supports directory indexing, or by sorting and compressing directories for smaller directories, or for filesystems using traditional linear directories.
  • 11. ● Regular Symlink: link path is stored in data block ● Fast Symlink: link path is stored in inode (if link path is smaller than 56 bytes) ext2 symlink
  • 12. ext2 symlink Image from: http://www.pluto.it/files/journal/pj9811/e2fs.html
  • 15. ext2 xattr ● * +--------------------+ ● * | header | ● * | entry 1 | | ● * | entry 2 | | growing downwards ● * | entry 3 | v ● * | four null bytes | ● * | . . . | ● * | value 1 | ^ ● * | value 3 | | growing upwards ● * | value 2 | | ● * +--------------------+
  • 16. ext2: badblock ● e2fsck use program “badblocks” to detect bad blocks and mark these blocks as “used” in block bitmap. ● If meta-data is in bad blocks,e2fsck will try to allocate new block for it.
  • 17. enhane of ext3 ● Journal ext3 could be looked like an ext2 filesystem with a journal file ● dir_index more efficent directory-searching
  • 18. ext3: journal ● ext2 filesystem may corrupt after reboot from exception like power reset directly. ● Journal will ensure filesystem consistent or recovery filesystem on system boot. ● Journal mode ● Writeback ● Ordered ● Journal
  • 19. ext3: dir_index ● Compute hash value of ext3_dir_entry ● Find dx_entry against hash value in root block by binary-search ● Find ext3_dir_entry in leaf block one by one
  • 20. ext3: dir_index ● Advantage: dir_index could have no more than two level indexs , therefore finding a file in directory needs to read 3 blocks at most. Imaging an ext3 filesystem with 4K block size, a directory could contain about 5 million files (file name is 100 bytes) ● Disadvantage: when add files to a directory, the b-tree will split, but after deleting files, the b-tree will not merge. A directory with a few files will occupy many blocks.
  • 21. ext3 xattr ● Put xattr into inode. ● Less IO ● mkfs.ext3 -I 256 /dev/sda
  • 22. limits of ext2/ext3 Block Size Max file size Max filesystem size 1KB 16GB 2TB 2KB 256GB 8TB 4KB 2TB 16TB 8KB (ppc arch) 2TB 32TB ● Read data from the indirect block of a file will make extra IO
  • 23. ext4 ● ext4 inherits all the features of ext2/ext3 ● Larger filesystem Max file size: 16TB Max filesystem size: 1EB(1048576TB)
  • 24. ext4: meta_bg Image from: http://www.ibm.com/developerworks/cn/linux/l-cn-filesrc5/
  • 25. ext4: meta_bg ● Group Descriptor size is 64 bytes ● Imaging an ext4 filesystem with block_size = 1K 1K/64 = 16 a meta group will contain 16 groups. The meta-GDT(1 block) will be put in Group 0, Group1, Group15 Group 16, Group17, Group31 Group 32, Group33, Group63 …...
  • 27. ext4: flex_bg ● Merge Block-Bitmap/Inode- Bitmap/Inode-table to Group 0 ● The position of Super-block and GDT follow the rule of “sparse” ● Advantage: save the space of Group 1,Group 2,Group 3 (especially for the extent of ext4)
  • 28. ext4: uninit_bg ● mkfs.ext4 -O uninit_bg ● Create a filesystem without initializing all of the block groups. This feature also enables checksums and highest-inode-used statistics in each blockgroup. This feature can speed up filesystem creation time noticeably (if lazy_itable_init is enabled), and can also reduce e2fsck time dramatically.
  • 29. ext4: uninit_bg ● When init block-group? ● lazy_itable_init run ● ext4_new_inode → ext4_read_block_bitmap
  • 31. ext4: extent ● An ext4_extent could point to 128MB continuious space. ● Example: a 300G file in ext3 will occupied 300MB meta-data-blocks, but in ext4 it only occupuied 36KB
  • 32. ext4: delay allocation ● It consists of delaying block allocation until the data is going to be written to the disk ● This improves performance and reduces fragmentation by improving block allocation decisions based on the actual file size