
OperatingSystemsCh10, part2Details of Ext2/3 File System
Operating Systems Ch10, part2 Details of Ext2/3 File System 1

Trivia: Extended File System (Ext2/3/4)-Follow index-node allocationPrimaryFS forLinuxdistribution- Ext4 was merged in the Linux 2.6.28 and released in 2008-Backward-compatible- For simplicity, we focus on Ext2/3-FeaturesofExt2/3/4- https://ext4.wiki.kernel.org/index.php/Main Page-http://e2fsprogs.sourceforge.net/ext2.html
Trivia • Extended File System (Ext2/3/4) – Follow index-node allocation – Primary FS for Linux distribution – Ext4 was merged in the Linux 2.6.28 and released in 2008 – Backward-compatible – For simplicity, we focus on Ext2/3 – Features of Ext2/3/4 – https://ext4.wiki.kernel.org/index.php/Main_Page – http://e2fsprogs.sourceforge.net/ext2.html

Details of Ext2/3- LayoutInode and directory structureLink fileBuffer cacheJournalingVFS3
Details of Ext2/3 - Layout - Inode and directory structure - Link file - Buffer cache - Journaling - VFS 3

Details of Ext2/3- LayoutInode and directory structureLink fileBuffer cacheJournalingVFS4
Details of Ext2/3 - Layout - Inode and directory structure - Link file - Buffer cache - Journaling - VFS 4

Index-nodeallocation Ext2/3 file systems follow the index-node allocationFilenameIndexIndexIndexIndexNode#...node#2node#1node#n-11rock.mp32game.exe3ubuntu.isoIt is arranged as an array. Solookingupanindexnodewillbefast.FLREEIndex NodeRootTableDirectoryT11121305
5 Index-node allocation Filename Index Node # rock.mp3 1 game.exe 2 ubuntu.iso 3 Root Directory F R E E Index Node Table 1 11 21 30 It is arranged as an array. So, looking up an index node will be fast. Index node #1 Index node #2 . Index node #n-1 . . . . . . • Ext2/3 file systems follow the index-node allocation

SpecificLayout: The file system is not that simple...- it is divided into groupsGDBlockInodeInodeDataSuperblockBitmapBitmapTableBlocksTGroupUGroupGroupn-1
Specific Layout • The file system is not that simple. – it is divided into groups

SpecificLayout: The file system is not that simple...- it is divided into groups- every group has the same structureGDTGroup0BlockInodeDataInodeSuperblockBitmapBitmapTableBlocksThey areTheyaredifferentthesame.GDTGroup1BlockInodeInodeDataSuperblockBitmapBitmapTableBlocks
Specific Layout G Superblock D T Block Bitmap Inode Bitmap Inode Table Data Blocks Superblock D T G Block Bitmap Inode Bitmap Inode Table Data Blocks They are the same. Group 0 Group 1 They are different. • The file system is not that simple. – it is divided into groups – every group has the same structure

Specific Layout. Why doing so?GDTGroupoBlockInodeInodeDataSuperblockBitmapBitmapTableBlocksThey areTheyaredifferentthesameGDTGroup1BlockInodeInodeDataSuperblockBitmapBitmapTableBlocks
Specific Layout • Why doing so? G Superblock D T Block Bitmap Inode Bitmap Inode Table Data Blocks Superblock D T G Block Bitmap Inode Bitmap Inode Table Data Blocks They are the same. Group 0 Group 1 They are different

Specific Layout. Why doing so?- For reliability...GGroupoBlockInodeDataInodeDSuperblockBitmapBitmapTableBlocksTherearemanycopiesofthesuperblockSo,thisincreasesthereliabilityoftheFsThey arethesameThe superblock in Group O is calledthe primary superblockOthersuperblocksarecalledthebackupsuperblockGGroup1BlockInodeInodeDataDSuperblockBitmapBitmapTableBlocksT
Specific Layout • Why doing so? – For reliability. G Superblock D T Block Bitmap Inode Bitmap Inode Table Data Blocks Superblock D T G Block Bitmap Inode Bitmap Inode Table Data Blocks They are the same. Group 0 Group 1 They are different. The superblock in Group 0 is called the primary superblock. Other superblocks are called the backup superblock. There are many copies of the superblock So, this increases the reliability of the FS

Specific Layout. Why doing so?-Forperformance..GroupoSuperblockE.g.-InodetableinGroup0storesinodesfrom#1to#100-InodetableinGroup1storesinodesfrom#101to#200They are-etc...thesameThegoodaboutthisistokeeptheinodesandthefilecontentsclosetogether!Group1SuperblockBimapBitmaplapleBIOCKS
Specific Layout • Why doing so? –For performance. G Superblock D T Block Bitmap Inode Bitmap Inode Table Data Blocks Superblock D T G Block Bitmap Inode Bitmap Inode Table Data Blocks They are the same. Group 0 Group 1 They are different. E.g., - Inode table in Group 0 stores inodes from #1 to #100; - Inode table in Group 1 stores inodes from #101 to #200; - etc. The good about this is to keep the inodes and the file contents close together!