So we can store 2 block numbers in each block using a 1-bit index. In triple indirection we store the block number of a block containing block numbers of blocks containing block numbers of blocks containing block numbers.Įxample: assume we have 8 byte blocks, containing 4 byte block numbers. In double indirection we store the block number of a block containing block numbers of blocks containing block numbers.
Our max file size, assuming 1Kbyte block size and 4byte block numbers is 12*1K + 1K/4 *1K = 268KiB. It requires two disk accesses to read one for the indirect block and one for the target block. Single indirection is where we store the block number of a block which contains block numbers where higher offsets are stored. We store offsets greater than the 12 blocks using indirection. write(f, "hello") lseek(f,1000000) write(f,"world") only needs to store the start and end of the file, not all the empty blocks in between so size=1000005 and blocks=2+any indirect blocksĭirect blocks store the block numbers of the first 12 blocks in the file we can find the blocks directly from the inode Note: that the number of blocks can be much less than expected given the file size. block count - the number of disk blocks used by the file.size - the offset of the highest byte written.mtime - time when file was last modified.regular file or directory) and access mode (e.g. it maps human-oriented to system-oriented names The inode contains the fundamental file metadata access rights, owner, accounting info, (partial) block index table of a file etc.Įach inode has a unique number a system oriented name (try ls -i on Unix-based systems)ĭirectories map file names to inode numbers i.e. Recap: inodesĮach file is represented by an inode on disk. The journal is a file where updates are logged. The ext3 file system fixed this by keeping a journal of (meta-data) updates. os crashes, power-loss etc.) would result the e2fsck file system checker running, which would take a long time to run for large storage capacities. The main problem with ext2 was that an unclean unmount (e.g. has performance optimisations to improve locality (from BSD Fast File System (FFS)).its block size (1024, 2048, and 4096) is configured at file system creation.It was evolved from the Minix file system. Ext2 for extended file system was the main Linux file system before ext3.