SlideShare a Scribd company logo
Submit Search
Upload
Login
Signup
Linux File System
Report
Anil Kumar Pugalia
Follow
Linux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
Oct. 3, 2010
•
0 likes
•
24,390 views
1
of
33
Linux File System
Oct. 3, 2010
•
0 likes
•
24,390 views
Report
Technology
Anil Kumar Pugalia
Follow
Linux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
Recommended
Linux file system
Md. Tanvir Hossain
8.9K views
•
23 slides
Linux file system
Midaga Mengistu
505 views
•
22 slides
File Management
insanmisteri111
5.6K views
•
29 slides
Linux file system
Burhan Abbasi
11.6K views
•
13 slides
Disk and File System Management in Linux
Henry Osborne
3.4K views
•
33 slides
file system in operating system
tittuajay
16.9K views
•
22 slides
More Related Content
What's hot
Ext filesystem4
Neha Kulkarni
2K views
•
33 slides
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Ahmed El-Arabawy
1.7K views
•
39 slides
File system.
elyza12
8.8K views
•
88 slides
File system Os
Nehal Naik
14.4K views
•
25 slides
Linux Directory Structure
Kevin OBrien
10.8K views
•
61 slides
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Sowmya Jyothi
633 views
•
17 slides
What's hot
(20)
Ext filesystem4
Neha Kulkarni
•
2K views
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Ahmed El-Arabawy
•
1.7K views
File system.
elyza12
•
8.8K views
File system Os
Nehal Naik
•
14.4K views
Linux Directory Structure
Kevin OBrien
•
10.8K views
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Sowmya Jyothi
•
633 views
Chapter 21 - The Linux System
Wayne Jones Jnr
•
12.7K views
File System Interface
chandinisanz
•
1.1K views
File system
Harleen Johal
•
41.5K views
Operating Systems: Linux in Detail
Damian T. Gordon
•
3.7K views
Linux Administration
Harish1983
•
16.3K views
Operating system memory management
rprajat007
•
5.5K views
Operating Systems - File Management
Damian T. Gordon
•
83.4K views
File System in Operating System
Meghaj Mallick
•
171 views
Course 102: Lecture 14: Users and Permissions
Ahmed El-Arabawy
•
1.5K views
Operating systems system structures
Mukesh Chinta
•
1.7K views
File management
Vishal Singh
•
33.8K views
Files and directories in Linux 6
Meenakshi Paul
•
775 views
File system structure
sangrampatil81
•
2.5K views
Windows File Systems
primeteacher32
•
544 views
Viewers also liked
History Of Linux
anand09
15.7K views
•
16 slides
Mr
Tianwei Liu
585 views
•
10 slides
Hadoop introduction 2
Tianwei Liu
861 views
•
25 slides
Scraping the web with python
Jose Manuel Ortega Candel
4.7K views
•
104 slides
Linux Introduction (Commands)
anandvaidya
25.3K views
•
155 slides
Tutorial on Web Scraping in Python
Nithish Raghunandanan
1.4K views
•
12 slides
Viewers also liked
(11)
History Of Linux
anand09
•
15.7K views
Mr
Tianwei Liu
•
585 views
Hadoop introduction 2
Tianwei Liu
•
861 views
Scraping the web with python
Jose Manuel Ortega Candel
•
4.7K views
Linux Introduction (Commands)
anandvaidya
•
25.3K views
Tutorial on Web Scraping in Python
Nithish Raghunandanan
•
1.4K views
Linux command ppt
kalyanineve
•
80.8K views
Linux.ppt
onu9
•
159K views
Linux ppt
lincy21
•
40.9K views
Big Data & Hadoop Tutorial
Edureka!
•
90.2K views
Web Scraping with Python
Paul Schreiber
•
11.7K views
Similar to Linux File System
Block Drivers
Anil Kumar Pugalia
38.2K views
•
21 slides
File System Modules
Anil Kumar Pugalia
20.7K views
•
37 slides
TLPI Chapter 14 File Systems
Shu-Yu Fu
693 views
•
28 slides
File System Modules
Anil Kumar Pugalia
25K views
•
27 slides
Embedded Storage Management
Anil Kumar Pugalia
4.1K views
•
16 slides
Linux
keydak11
1.1K views
•
25 slides
Similar to Linux File System
(20)
Block Drivers
Anil Kumar Pugalia
•
38.2K views
File System Modules
Anil Kumar Pugalia
•
20.7K views
TLPI Chapter 14 File Systems
Shu-Yu Fu
•
693 views
File System Modules
Anil Kumar Pugalia
•
25K views
Embedded Storage Management
Anil Kumar Pugalia
•
4.1K views
Linux
keydak11
•
1.1K views
pptdisk
Mukhtiar ali burfat
•
249 views
Case study of BtrFS: A fault tolerant File system
Kumar Amit Mehta
•
2.2K views
Introduction to Linux
Anil Kumar Pugalia
•
11.2K views
Introduction to Linux
Anil Kumar Pugalia
•
4K views
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
•
6K views
Linux - Introduction
Shashank Chintalagiri
•
420 views
Embedded I/O Management
Anil Kumar Pugalia
•
5.1K views
Feature rich BTRFS is Getting Richer with Encryption
LF Events
•
696 views
Next generation storage: eliminating the guesswork and avoiding forklift upgrade
Jisc
•
1.9K views
제3회난공불락 오픈소스 인프라세미나 - lustre
Tommy Lee
•
1.6K views
Character Drivers
Anil Kumar Pugalia
•
56.5K views
Btrfs: Design, Implementation and the Current Status
Lukáš Czerner
•
1.8K views
Root file system
Bindu U
•
254 views
10 Tips for AIX Security
HelpSystems
•
1.2K views
More from Anil Kumar Pugalia
Kernel Debugging & Profiling
Anil Kumar Pugalia
5.9K views
•
14 slides
Processes
Anil Kumar Pugalia
7K views
•
33 slides
System Calls
Anil Kumar Pugalia
4.2K views
•
17 slides
Embedded C
Anil Kumar Pugalia
25.6K views
•
20 slides
Embedded Software Design
Anil Kumar Pugalia
6.9K views
•
29 slides
Playing with R L C Circuits
Anil Kumar Pugalia
2.8K views
•
17 slides
More from Anil Kumar Pugalia
(20)
Kernel Debugging & Profiling
Anil Kumar Pugalia
•
5.9K views
Processes
Anil Kumar Pugalia
•
7K views
System Calls
Anil Kumar Pugalia
•
4.2K views
Embedded C
Anil Kumar Pugalia
•
25.6K views
Embedded Software Design
Anil Kumar Pugalia
•
6.9K views
Playing with R L C Circuits
Anil Kumar Pugalia
•
2.8K views
Audio Drivers
Anil Kumar Pugalia
•
20.6K views
Video Drivers
Anil Kumar Pugalia
•
23.2K views
Shell Scripting
Anil Kumar Pugalia
•
6.2K views
References
Anil Kumar Pugalia
•
21.7K views
Functional Programming with LISP
Anil Kumar Pugalia
•
6.1K views
Power of vi
Anil Kumar Pugalia
•
3K views
gcc and friends
Anil Kumar Pugalia
•
14.2K views
"make" system
Anil Kumar Pugalia
•
4.2K views
Hardware Design for Software Hackers
Anil Kumar Pugalia
•
1.7K views
RPM Building
Anil Kumar Pugalia
•
4K views
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
•
6.5K views
Linux Network Management
Anil Kumar Pugalia
•
11.2K views
System Calls
Anil Kumar Pugalia
•
9.7K views
Timers
Anil Kumar Pugalia
•
6.5K views
Recently uploaded
Understanding Wireguard, TLS and Workload Identity
Christian Posta
175 views
•
51 slides
EuroBSDCon 2023 - (auto)Installing BSD Systems - Cases using pfSense, TrueNAS...
Vinícius Zavam
64 views
•
30 slides
GIT AND GITHUB (1).pptx
GDSCCVRGUPoweredbyGo
22 views
•
20 slides
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
170 views
•
46 slides
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
65 views
•
71 slides
Scaling out with WordPress
Konstantin Kovshenin
58 views
•
55 slides
Recently uploaded
(20)
Understanding Wireguard, TLS and Workload Identity
Christian Posta
•
175 views
EuroBSDCon 2023 - (auto)Installing BSD Systems - Cases using pfSense, TrueNAS...
Vinícius Zavam
•
64 views
GIT AND GITHUB (1).pptx
GDSCCVRGUPoweredbyGo
•
22 views
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
•
170 views
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
•
65 views
Scaling out with WordPress
Konstantin Kovshenin
•
58 views
Demystifying ML/AI
Matthew Reynolds
•
41 views
Privacy in the era of quantum computers
Speck&Tech
•
86 views
Safe Community Call #12.pdf
LornyPfeifer
•
24 views
Netwitness RT - Don’t scratch that patch.pptx
Stefano Maccaglia
•
105 views
Advancing Equity and Inclusion for Deaf Students in Higher Education
3Play Media
•
154 views
Experts Live Europe 2023 - Ensure your compliance in Microsoft Teams with Mic...
Jasper Oosterveld
•
87 views
Cloud Composer workshop at Airflow Summit 2023.pdf
Leah Cole
•
89 views
Getting your enterprise ready for Microsoft 365 Copilot
Vignesh Ganesan I Microsoft MVP
•
167 views
"From Orchestration to Choreography and Back", Yevhen Bobrov
Fwdays
•
33 views
UiPath Tips and Techniques for Debugging - Session 3
DianaGray10
•
38 views
Product Listing Presentation_Cathy.pptx
CatarinaTorrenuevaMa
•
79 views
Machine learning with quantum computers
Speck&Tech
•
95 views
The Flutter Job Market At The Moment
Ahmed Abu Eldahab
•
21 views
Easy Salesforce CI/CD with Open Source Only - Dreamforce 23
NicolasVuillamy1
•
441 views
Linux File System
1.
Linux File System ©
2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
2.
What to Expect? W's
of a File System Three Levels of File System © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
3.
What is a
File System? Mechanism of Organizing our Data Labelling by Names, Easy Access, ... Algorithm to Achieve the Desired Organization Ability to Store, Retrieve, Search, Sort, ... Data Structures to Achieve the Desired Performance © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
4.
Why we need
a File System? Preserve Data for Later Access Update Discard Tag Data for Categorizing Easy & Fast Lookup Fast & Reliable Data Management by Optimized Operations © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
5.
File System Decoded Three
things at three levels Hardware Space – The Physical Organization of Data on the Storage Devices Kernel Space – Drivers to decode & access the data from the Physical Organization User Space – All what you see from / - The User View Which ever it be, it basically does Organize our data For easy access by tagging For fast maintenance by optimizing © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
6.
Hardware Space File
System © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
7.
The Hard Disk
Tracks Sectors Disk or Platter © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
8.
The Hard Disk
Spindle Heads . . Cylinder . . . . © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
9.
Understanding a Hard
Disk Example (Hard Disk) Heads (or Platters): 0 – 9 Tracks (or Cylinders): 0 – 24 Sectors: 1 – 64 Size of the Hard Disk 10 x 25 x 64 x 512 bytes = 8000KiB Device independent numbering (h, t, s) → 64 * (10 * t + h) + s → (1 - 16000) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
10.
Partitioning a Hard
Disk First Sector – Master Boot Record (MBR) Contains Boot Info Contains Physical Partition Table Maximum Physical Partitions: 4 At max 1 as Extended Partition Rest as Primary Partition Extended could be further partitioned into Logical Partitions In each partition First Sector – Boot Record (BR) Remaining for File System / Format Extended Partition BR contains the Logical Partition Table © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
11.
Placement of a
Hardware FS Each Partition contains a File System Raw (no FS) Organized Organized one is initialized by the corresponding Formating “Partition Type is to OS” W95*, DOS*, BSD*, Solaris*, Linux, ... “Format Type is to File System” ext2, ext3, vfat, ntfs, jffs2, … Particular Partition Types support only Particular File System Types © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
12.
Design a FS Let's
Take 1 Partition With 16 blocks of 2 sectors each Size = 16 x 2 x 512 bytes = 16KB Given 3 data pieces Source Code – 2.5KB Image – 8KB Document – 2KB Place optimally for further operations © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
13.
Kernel Space File
System © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
14.
Kernel Space File
System Has 2 Roles to Play Decode the Hardware FS Layout to access data (by implementing your logic in s/w) Interface that with the User Space FS to give you a unified view, as you all see at / First part: ext2, ext3, vfat, ntfs, jffs2, … Also called the File System modules Second part: VFS Kernel provides VFS to achieve the virtual user view So, FS module should actually interact with VFS © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
15.
Linux specific File
Systems Initial Linux: Minix FS As Linux matured: Extended (ext) FS 1994: Second Extended (ext2) FS Latest: Third Extended (ext3) FS Features Introduced: Access Control Lists (ACL) Block Fragmentation Logical Deletion Journaling © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
16.
Linux FS Data
Structures Super block – Stores filesystem meta data Inode – Stores file meta data Directory Entry – Stores file name & inode number Inode & Data block Bitmap – Bitmap for tracking usage status of the various blocks Group Entry – Stores information of groups of Data Storage © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.
17.
Linux FS Transitions Choosing
Optimal Block Size (from 1KiB to 4KiB), depending on the expected average file length Choosing Number of Inodes Partition Groups: Each group includes Data Blocks and Inodes stored in adjacent tracks Preallocating Disk Data Blocks to Regular Files Fast Symbolic Links © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 17 All Rights Reserved.
18.
File System related
Commands File and Inode information – stat Hardlinks and Softlinks – ln & ln -s Mounting filesystem – mount & umount Creating special files – mknod, mkfifo Permission related – chmod Ownership related – chown, chgrp Timestamp related – touch © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 18 All Rights Reserved.
19.
Case Study: ext2/ext3 ©
2010 Anil Kumar Pugalia <email@sarika-pugs.com> 19 All Rights Reserved.
20.
ext2/ext3: Disk Data
Structure Boot Block group 0 ... Block group n block Super Group Data block Inode Inode Data blocks block Descriptors Bitmap Bitmap Table 1 block n blocks 1 block 1 block n blocks n blocks Superblock and Group Descriptors are duplicated in each Block Group Superblock and Group Descriptors in Block Group 0 are used by the kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 20 All Rights Reserved.
21.
ext2/ext3: Superblock unsigned long
s_frag_size; /* Size of a fragment in bytes */ unsigned long s_frags_per_block; /* Number of fragments per block */ unsigned long s_inodes_per_block; /* Number of inodes per block */ unsigned long s_frags_per_group; /* Number of fragments in a group */ unsigned long s_blocks_per_group; /* Number of blocks in a group */ unsigned long s_inodes_per_group; /* Number of inodes in a group */ unsigned long s_itb_per_group; /* Number of inode table blocks per group */ unsigned long s_gdb_count; /* Number of group descriptor blocks */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ ... © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 21 All Rights Reserved.
22.
ext2/ext3: Group Descriptor __le32
bg_block_bitmap; /* Blocks bitmap block number */ __le32 bg_inode_bitmap; /* Inodes bitmap block number */ __le32 bg_inode_table; /* Inodes table first block number */ __le16 bg_free_blocks_count; /* Free blocks in the group */ __le16 bg_free_inodes_count; /* Free inodes in the group */ __le16 bg_used_dirs_count; /* Directories in the group */ __le16 bg_pad; /* Alignment to word */ __le32 bg_reserved[3]; /* Nulls to pad out 24 bytes */ © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 22 All Rights Reserved.
23.
ext2/ext3: Inode Entry Inode
Table consists of Inode Entries. An Inode Entry is as follows __le16 i_mode; /* File type & access rights */ __le16 i_uid; /* Low 16 bits of owner uid */ __le32 i_size; /* File size in bytes */ __le32 i_atime; /* Last file access time */ __le32 i_ctime; /* File creation time */ __le32 i_mtime; /* Last file contents modification time */ __le32 i_dtime; /* File deletion time */ __le16 i_gid; /* Low 16 bits of group id */ __le16 i_links_count; /* Hard links counter */ __le32 i_blocks; /* Number of data blocks of the file */ __le32 i_flags; /* File flags */ union osd1; /* OS specific information */ __le32 i_block[12 + 3]; /* Pointers to data blocks */ ... © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 23 All Rights Reserved.
24.
ext2/ext3: File Types File
Types supported File Type Value Description 0 Unknown 1 Regular 2 Directory 3 Character Device 4 Block Device 5 Named Pipe 6 Socket 7 Symbolic Link © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 24 All Rights Reserved.
25.
ext2/ext3: Directory Entry Directory
is a File, with Data Blocks containing Directory Entries A Directory Entry is as follows __le32 inode; /* Inode number */ __le16 rec_len; /* Directory entry length */ __u8 name_len; /* Name length */ __u8 file_type; /* File type */ char name[255]; /* File name */ © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 25 All Rights Reserved.
26.
Virtual File System ©
2010 Anil Kumar Pugalia <email@sarika-pugs.com> 26 All Rights Reserved.
27.
VFS Specifics Inherited from
the Linux specific FS Promoted to a super set of various FS Provides a unified view to the User Default values for various attributes owner, group, permissions, … File Types Same seven types as in ext2/ext3 © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 27 All Rights Reserved.
28.
Virtual File System
Interactions User Space File System View @ / VFS .... ext2 .... vfat .... Partition 0 Partition 1 ... Partition N ... © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 28 All Rights Reserved.
29.
Virtual File System
Internals d r Super Block Directory Entry Table Inode Table > FS Meta Data > Root Inode Number > File Name > Inode Number > File Meta Data > File Data Block Nos Data Block © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 29 All Rights Reserved.
30.
Recall: User Space
File System © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 30 All Rights Reserved.
31.
/ & the
System Directories /bin, /sbin - system binaries/applications /var - logs, mails /proc, /sys - “virtual” windows into the kernel /etc - configuration files /lib - shared system libraries /dev - device files /boot - Linux kernel and boot related binary files /opt - for third-party packages /root, /home - home directory for super user & other users /usr - user space related files and dirs (binaries, libraries, ...) /tmp - scratch pad /mnt - mount points © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 31 All Rights Reserved.
32.
What all have
we learnt? W's of a File System Three Levels of File System Hardware Space Kernel Space User Space © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 32 All Rights Reserved.
33.
Any Queries? © 2010
Anil Kumar Pugalia <email@sarika-pugs.com> 33 All Rights Reserved.