Details of Ext2/3LayoutInode and directory structureLink fileBuffer cacheJournalingVFS16
Details of Ext2/3 - Layout - Inode and directory structure - Link file - Buffer cache - Journaling - VFS 16
Inode Structure We know that..- The locations of the data blocks of a file are stored in2nd layer ofthe inode.1stlayerofindirectindirectblocksblocksIndexnodestructureDirectBlock#DirectBlock#1.DirectBlock#11IndirectBlockDoublelndirectBlockTriple Indirect BlockDataBlockData Block storingblockaddress.storing data
Inode Structure • We know that. – The locations of the data blocks of a file are stored in the inode. Index node structure Direct Block #0 Direct Block #1 . . Direct Block #11 Indirect Block Double Indirect Block Triple Indirect Block Data Block storing block address. Data Block storing data. . . 1st layer of indirect blocks 2nd layer of indirect blocks
Inode StructureInodeStructure(128byteslong)What are stored in inodeValueBytesbesidesblockaddresses?0-1Filetype andpermission2-3UserID4-7Lower32bitsoffilesizesinbytes8-23TimeinformationAn inode is the structure that24-25GroupIDstoreseveryinformationabout26-27Linkcounta file....40-8712directdatablockpointers88-91SingleindirectblockpointerThelocations of thedata92-95Doubleindirectblock pointerblocks96-99TripleIndirectblockpointer.108-111Upper32bitsoffilesizesinbytesMoredetails:https://ext4.wiki.kernel.org/index.php/Ext4DiskLayout#lnodeTable
Inode Structure An inode is the structure that stores every information about a file. The locations of the data blocks Inode Structure (128 bytes long) Bytes Value 0-1 File type and permission 2-3 User ID 4-7 Lower 32 bits of file sizes in bytes 8-23 Time information 24-25 Group ID 26-27 Link count . . 40-87 12 direct data block pointers 88-91 Single indirect block pointer 92-95 Double indirect block pointer 96-99 Triple Indirect block pointer . . 108-111 Upper 32 bits of file sizes in bytes What are stored in inode besides block addresses? More details: https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table
Inode StructureInode Structure (128bytes long)WhatisthemaximumfileBytesValuesize supported?0-1Filetypeandpermission2-3264-1User ID4-7Lower32bitsoffilesizesinbytes=16x230Gbytes-1byte8-23Timeinformation24-25Group IDIs this really the case?26-27Link count.....Rememberthedominating40-8712directdatablockpointersfactor: 24x-688-91Single indirect blockpointer92-95Double indirectblock pointer96-99TripleIndirectblockpointerBlock sizeFile size...1024B=210~16 Gbytes108-111Upper32bitsoffilesizesinbytes2124096B~4 Tbytes3=
Inode Structure What is the maximum file size supported? 264 – 1 = 16 x 230 Gbytes – 1 byte Is this really the case? Inode Structure (128 bytes long) Bytes Value 0-1 File type and permission 2-3 User ID 4-7 Lower 32 bits of file sizes in bytes 8-23 Time information 24-25 Group ID 26-27 Link count . . 40-87 12 direct data block pointers 88-91 Single indirect block pointer 92-95 Double indirect block pointer 96-99 Triple Indirect block pointer . . 108-111 Upper 32 bits of file sizes in bytes Remember the dominating factor: 2 4x-6 Block size File size 1024B = 210 ~16 Gbytes 4096B = 212 ~4 Tbytes
Inode StructureInode Structure (128bytes long)What is link count?BytesValue0-1We will talk about it laterFile type and permission2-3User ID4-7Lower32bitsoffilesizesinbytesWhere is the file name?8-23Timeinformation24-25GroupID26-27Link countLet us take a look at the...directorystructure40-8712direct datablock pointers88-91Single indirect blockpointer92-95Double indirectblock pointer96-99TripleIndirectblockpointer...108-111Upper32bitsoffilesizesinbytes
Inode Structure What is link count? Inode Structure (128 bytes long) Bytes Value 0-1 File type and permission 2-3 User ID 4-7 Lower 32 bits of file sizes in bytes 8-23 Time information 24-25 Group ID 26-27 Link count . . 40-87 12 direct data block pointers 88-91 Single indirect block pointer 92-95 Double indirect block pointer 96-99 Triple Indirect block pointer . . 108-111 Upper 32 bits of file sizes in bytes We will talk about it later Where is the file name? Let us take a look at the directory structure