Unix Internals: Ms. Radha Senthilkumar, Lecturer Department of IT MIT, Chromepet Anna University, Chennai
Unix Internals: Ms. Radha Senthilkumar, Lecturer Department of IT MIT, Chromepet Anna University, Chennai
1
INTERNAL REPRESENTATION
OF FILES
2
Table of Contents
Introduction
Inodes
Structure of a Regular File
Directories
Conversion of a Path Name to an Inode
Super Block
Inode Assignment to a New File
Allocation of Disk Blocks
Other File Types
Summary
namei
alloc free ialloc ifree
40 50 60 70
40 50 60 70 85
101
8 367 75
0 816th byte
331 3333
0
3333
428 (10K+256K) Data block
331
9156 Single indirect Byte 350,000 in a file
11 9156 Double indirect
824
Consists of
the size of the file system
the number of free blocks in the file system
a list of free blocks available on the file system
the index of the next free block in the free block list
the size of the inode list
the number of free inodes in the file system
a list of free inodes in the file system
the index of the next free inode in the free inode list
lock fields for the free block and free inode lists
a flag indicating that the super block has been modified
18 19 20 array
index
18 19 20 array
index
0 array1
remembered
index inode
0
48 49 50
index
(a) I
empty
(b)
Free inodes
(d) J I
109
211 208 205 202 …………………… 112
211
310 307 304 301 …………………… 214
310
409 406 403 400 …………………… 313
109
211 208 205 202 ……………………………..
112
original configuration
109
211 208 205 202 ……………………………….
112
After freeing block number 949
109
211 208 205 202 ……………………………….
112
After assigning block number(949)