Slide 1

Slide 1 text

UNIX File Architecture P. Mihaylov Student at Software University E-mail: [email protected]

Slide 2

Slide 2 text

Agenda 1. Difference between an inode, file and file data 2. Filesystem redundancy – Superblocks, Datablocks 3. Directory entries in UNIX 4. File contents 5. File redundancy – Symlinks, Hardlinks 6. Deleting files in UNIX

Slide 3

Slide 3 text

Inodes, files and file data 1. Inode • An element, that keeps a reference to a given file/inode as well as metadata about it • Similar to pointers in programming languages 2. File data • The physical content of a given file on the PC storage (HDD/SSD) 3. File • An abstract element • The logical representation of the file data, as well as the inode pointing to it. • Contains information about its inodes, data, file type, etc

Slide 4

Slide 4 text

File System Redundancy Two types of Inodes in UNIX – Superblocks, Datablocks 1. Superblock – Inode, containing File system metadata 2. Datablock – Regular Inode, containing file metadata as well as a pointer to the file data location.

Slide 5

Slide 5 text

Directory entries in UNIX • In UNIX, there are no directories • There are inodes, that point to other inodes. These are called directory entries (Dentry)

Slide 6

Slide 6 text

File contents • Every inode contains file metadata • File type – designates how the file system should treat the file • Link count – shows how many inodes point to this file • Owner/Group ID – shows who does this file belong to • LAT/LMT/LIAT – Timestamps (Not trustworthy) • Pointers – keep reference of the data location

Slide 7

Slide 7 text

File Redundancy • In UNIX, there are two types of links – symlinks, hardlinks • Symlink – A regular file, that keeps the file location of another one (Similar to shortcuts in Windows) • Hardlink – An inode, that points to a file data location of another inode(s)

Slide 8

Slide 8 text

Deleting files in UNIX • In UNIX, files do not get deleted, they get overwritten • When a file is “deleted” from the file system, you delete the inode pointing to the file data, not the actual file data. • A file is considered “deleted”, when the last inode pointing to it is removed. (Despite that, they can still be restored) • Similar to deleting reference objects in programming languages. (In UNIX, there is no garbage collector )

Slide 9

Slide 9 text

Summary • Difference between a file, inode and file data • Superblocks/Datablocks in UNIX. File system redundancy • “Directories”/Directory entries in UNIX • File contents/metadata • Redundancy of files – Symlinks, Hardlinks • “Deleting”/Overwriting files in UNIX

Slide 10

Slide 10 text

Questions? P. Mihaylov Student at Software University E-mail: [email protected]