SlideShare a Scribd company logo
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,3 2 ,5 2 ,7 2 ,3 3 ,5 3 ,7 3 ....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

More Related Content

PDF
Percona XtraDB Cluster
PPTX
Ext filesystem4
PDF
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
PDF
Linux basic commands with examples
PDF
NVMe Over Fabrics Support in Linux
PDF
Linux file commands and shell scripts
PDF
Linux scheduler
PPTX
LLVM Backend Porting
Percona XtraDB Cluster
Ext filesystem4
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Linux basic commands with examples
NVMe Over Fabrics Support in Linux
Linux file commands and shell scripts
Linux scheduler
LLVM Backend Porting

What's hot (20)

PDF
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
PPT
Device tree support on arm linux
PPTX
Linux Network Stack
PDF
Q4.11: Introduction to eMMC
PDF
Linux Systems Performance 2016
PPT
Pyqgis 기초편
PPTX
Linux container, namespaces & CGroup.
PDF
Apache Cassandra - wprowadzenie do architektury, modelowania i narzędzi
PPTX
Linux Kernel MMC Storage driver Overview
PDF
Character drivers
PDF
Introduction to Modern U-Boot
PPT
Linux SD/MMC Driver Stack
PDF
Get to know PostgreSQL!
PDF
The Linux Block Layer - Built for Fast Storage
PPTX
Active directory backup
PDF
Device Tree for Dummies (ELC 2014)
PPT
Introduce to AM37x Sitara™ Processors
PDF
Mrtg ubuntu
PPTX
Gstreamer plugin development
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
Device tree support on arm linux
Linux Network Stack
Q4.11: Introduction to eMMC
Linux Systems Performance 2016
Pyqgis 기초편
Linux container, namespaces & CGroup.
Apache Cassandra - wprowadzenie do architektury, modelowania i narzędzi
Linux Kernel MMC Storage driver Overview
Character drivers
Introduction to Modern U-Boot
Linux SD/MMC Driver Stack
Get to know PostgreSQL!
The Linux Block Layer - Built for Fast Storage
Active directory backup
Device Tree for Dummies (ELC 2014)
Introduce to AM37x Sitara™ Processors
Mrtg ubuntu
Gstreamer plugin development
Ad

Similar to why we need ext4 (20)

ODP
ext2-110628041727-phpapp02
PPTX
Root file system
PDF
TLPI Chapter 14 File Systems
PDF
grub4ext4 status-plans
PPTX
Raspberry pi Part 5
PPT
Linux
PPTX
11 linux filesystem copy
PPTX
Disk and File System Management in Linux
DOCX
linux file sysytem& input and output
PPTX
How to install gentoo distributed
PDF
Advfs 3 in-memory structures
DOCX
There are 4 parts for the project. The question may be long to r.docx
DOCX
There are 4 part for the project and the question may be long to rea.docx
PDF
Linuxdiskmanagementcommands
DOCX
There are 4 parts for the project. The question may be long to read .docx
PDF
Osdc2011.ext4btrfs.talk
PDF
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
DOCX
File systemimplementationfinal
PDF
PostgreSQL on EXT4, XFS, BTRFS and ZFS
ext2-110628041727-phpapp02
Root file system
TLPI Chapter 14 File Systems
grub4ext4 status-plans
Raspberry pi Part 5
Linux
11 linux filesystem copy
Disk and File System Management in Linux
linux file sysytem& input and output
How to install gentoo distributed
Advfs 3 in-memory structures
There are 4 parts for the project. The question may be long to r.docx
There are 4 part for the project and the question may be long to rea.docx
Linuxdiskmanagementcommands
There are 4 parts for the project. The question may be long to read .docx
Osdc2011.ext4btrfs.talk
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
File systemimplementationfinal
PostgreSQL on EXT4, XFS, BTRFS and ZFS
Ad

More from Hao(Robin) Dong (8)

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

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
MYSQL Presentation for SQL database connectivity
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Dropbox Q2 2025 Financial Results & Investor Presentation
Understanding_Digital_Forensics_Presentation.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
MYSQL Presentation for SQL database connectivity
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf

why we need ext4