Ext* Content Areas Inodes, Directories & Files. Review Recall …the file system metadata The superblock describes the file system The group descriptor.

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

Concepts about the file system 2. The disk structure 3. Files in disk – The ext2 FS 4. The Virtual File System (c) 2013, Prof. Jordi Garcia.
Chapter 4 : File Systems What is a file system?
File Systems.
File Systems Examples.
COS 318: Operating Systems File Layout and Directories
Ext2/Ext3 Linux File System Reporter: Po-Liang, Wu.
File System Analysis.
File System Basics Brandon Checketts. Some terminology Superblocks Inodes Journaling Hard links Symbolic links Directory entries.
File System Interface CSCI 444/544 Operating Systems Fall 2008.
1 EXT4NTFS 6FAT32 Allocation method IndexedIndexed, by “runs”Linked File representation i-node (default size 256KB) MFT record (default size 1Kb) Chain.
Day 27 File System. UNIX File Management Types of files Ordinary – stream of bytes Directory – list of names plus pointers to attributes of the entry.
Operating Systems File Systems (in a Day) Ch
File Systems Implementation
Files. System Calls for File System Accessing files –Open, read, write, lseek, close Creating files –Create, mknod.
File Systems Implementation. 2 Announcements Homework 4 available later today –Due Wednesday after spring break, March 28th. Project 4, file systems,
Linux+ Guide to Linux Certification, Second Edition
Ceng Operating Systems
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
1 File Management in Representative Operating Systems.
File Systems Implementation. 2 Recap What we have covered: –User-level view of FS –Storing files: contiguous, linked list, memory table, FAT, I-nodes.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Filesystem Hierarchy Standard (FHS) –Standard of outlining the location of set files and directories on a Linux system –Gives Linux software developers.
1Fall 2008, Chapter 11 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
Computer Forensics COEN 252.  File systems can be extent-based ◦ E.g. NTFS ◦ Storage space is allocated in extents, large sets of contiguous blocks ◦
Linux+ Guide to Linux Certification, Second Edition
Files CS Spring Overview Example: FAT File System File Organization File System Organization –File Directories and File Sharing –Record Blocking.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
Chapter 5 File Management File System Implementation.
File Storage Organization The majority of space on a device is reserved for the storage of files. When files are created and modified physical blocks are.
File System Implementation
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Implementation.
Module 4.0: File Systems File is a contiguous logical address space.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
Unix File Access Unix file access is accomplished via a series of tables Process file table System file table v-nodes (sometimes i-nodes)
UNIX File System (UFS) Chapter Five.
Jeff's Filesystem Papers Review Part I. Review of "Design and Implementation of The Second Extended Filesystem"
File Systems. 2 What is a file? A repository for data Is long lasting (until explicitly deleted).
Lecture 10 Page 1 CS 111 Summer 2013 File Systems Control Structures A file is a named collection of information Primary roles of file system: – To store.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems File systems.
CS 3204 Operating Systems Godmar Back Lecture 21.
NCHU System & Network Lab Lab 14 File and Directory.
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
File system and file structures
Files An operating system, maintains descriptive information about files in a data structure called a file descriptor. NameDeletion control Storage Organization.
W4118 Operating Systems Instructor: Junfeng Yang.
COMP 3500 Introduction to Operating Systems Directory Structures Block Management Dr. Xiao Qin Auburn University
The need for File Systems Need to store data and programs in files Must be able to store lots of data Must be nonvolatile and survive crashes and power.
Linux Filesystem Management
File Systems and Disk Management
Day 28 File System.
EXT in Detail High-Performance Database Research Center
Chapter 11: File System Implementation
Day 27 File System.
File System Structure How do I organize a disk into a file system?
Chapter 11: File System Implementation
Filesystems.
Chapter 11: File System Implementation
Chapter 11: File System Implementation
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
File System Implementation
Chapter 11: File System Implementation
File Systems CSE 2431: Introduction to Operating Systems
Presentation transcript:

Ext* Content Areas Inodes, Directories & Files

Review Recall …the file system metadata The superblock describes the file system The group descriptor table describes the equally sized block groups The block bitmap tracks group block allocation

Overview Today: The data metadata and contents The inode bitmap tracks inode allocation The inode table is a block that contains the inodes –Inode 2 is the root directory Each inode contains metadata for, and points to, a file Directories are just special files that point to inode table entries File data is found in the content area blocks of the block group

Inode Contents (I) File size (32 or 64 bit) 1 st 12 content block addresses –1 single-indirect block address –1 double-indirect block pointer Group ID, user ID (not necessarily real) –chown, chgrp –User may not exist in /etc/password Last Access, modify, change, delete times

Inode Contents (II) Mode –File type File, directory, named pipe, Unix socket, block & raw devices –Permissions –Special properties (sticky, SUID, SGID) Link counter –0  unallocated inode (or orphaned file, will be unallocated when process ends) Many supported attributes –“don’t update the Access time for files” –Write-immediate –Append-only –Immutable –Don’t dump (backup) Extended attributes created by the user (custom attributes)

Inode Structure (I) BytesDescription 0-1File mode (type & permissions) 2-3UID lower 2 bytes 4-7Size lower 4 bytes 8-11Access Time 12-15Change Time 16-19Modification Time 20-23Delete Time 24-25GID lower 2 bytes 26-27Link count 28-31Sector count 32-35Flags 36-39unused

Inode Structure (II) BytesDescription direct block pointers single-indirect pointer double-indirect pointer triple-indirect pointer Generation number Extended attribute block address Size upper 4 bytes OR Directory ACL Fragment block address Fragment size unused UID upper 2 bytes GID upper 2 bytes unused

Large Files – Indirect Pointers With only 12 block addresses, file size is limited (in the basic case) Single-indirection supports larger files by pointing to a block of addresses Addresses are 4 bytes, thus each block stores blocksize / 4 address pointers Double-indirection supports huge files by pointing to a block of single-indirection addresses Triple-indirection points to a block of double-indirection pointers This scheme provides efficiency for smaller files, but the ability to grow as large as space allows

Inode Usage Inodes 1 – 10 are reserved –Inode 2 – root directory –Inode 8 – lost+found –Allocated blocks without an inode are “lost files” –These are pointed to by the lost+found inode Inode 11 and after – content (files, directories, devices, links, mount points, etc.)

Typical Inode/File Relationship If the inode represents a Directory –The inode points to a directory block Each directory entry points back to an inode If the inode represents a File –The 12 inode block addresses point to the 1 st 12 blocks of the file –The single-indirect address points to a block of addresses that are the next m blocks of the file –Double-indirect address points to a block of single- indirect addresses that ultimately point to the next n blocks of the file –Triple-indirect address points to a block of double- indirect addresses

Indirection Triple-indirect … Single-Indirect Double-Indirect Blocks 4-9 Pointers to content blocks One Inode (shows pointers only) Blocks in the Group Single-Indirect Block

Directory Entries A directory is just a special type file –inode.file mode (type) = directory –Creating a directory allocates blocks of directory entries Each block stores dynamically sized directory entries (the directory “table”), each describing a file or directory Size of each entry is variable –Variable filename length –8 bytes of static information –Entry size is rounded-up to a multiple of 4 Four entry attributes –Name length (1 byte) –Filename (1-255 chars) –Inode address of the file content –Pointer to next directory entry Unused entries are “jumped over”

Directory Example The first two entries are always. and.. Directory table for new directory NameName lengthRecord length Add a file NameName lengthRecord length File1.dat84072 Last entry always has the remaining length in the directory block

Directory Entries Each entry points to the next active entry Old.txt has been deleted  the entry for F1.txt now points to F2.txt F2.txt points to the end of the directory block  F2.txt is the last file in the directory. inode 75.. inode 26 F1.txt inode 95 Old.txt inode 35 F2.txt Inode 29

Links Links are special types of directory entries –They point to files that already have directory entries Hard Link –another name for the file, in same file system The directory entries for. and.. are hard links –OS creates a new directory entry pointing to the original inode Increments the inode link count Soft link –another name, points to another file system –OS creates a file of the type “symbolic link” Each “file’s” inode link count = 1 (or unchanged)

Mount Points Mount points are special types of directory entries that virtually replace the contents of a directory by redirecting the directory to another file system –FS1 has /dir1/ –FS2 mounts /dir1/ –User cd’s to /dir1 and sees the contents of FS2 Implication for CF investigations: know where file systems are mounted, or you’ll miss the real contents of /dir1/

Inode Time Changes Access (A-time) –File: read contents, copy, move to new volume (no change on same volume) –Dir: list contents, open file or subdirectory Modify (M-time) –File: copy (destination only), change contents When moving to network file system, might change (  new file) –Dir: file create/delete Change (C-time) inode metadata –Dir: content change, permissions/ownership change –File: same as Dir, plus when moved Delete (D-time) –Initially 0 –If D-time == C-time == M-time  likely a deleted file

Analysis Considerations Sparse blocks exist when the file allocated space, but never used it A-Time & M-time are easily set to any value using touch RAM slack space is typically 0’d –  the only valuable slack is in unallocated blocks De-allocated inodes are purged of size & allocation information –  must analyze the unallocated blocks directly using what is known of allocation algorithms and the file system structures