Showing posts with label linux file system. Show all posts
Showing posts with label linux file system. Show all posts

Thursday, 31 January 2013

Linux File system

VIRTUAL FILE SYSTEM
Linux has a virtual file system(VFS) , which is sort of a kernel layer which is responsible in providing a common interface all file systems.Thus you can invoke file related system calls (reading,writing etc) to different file systems be it  ext3,ext4,VFAT etc.
Those of you using windows as well as linux in your machine would know that you can mount a windows defined C drive (FAT or NTFS) in linux environment but windows dosen't allow you to mount linux (ext*) file system (Use ext2explore software for mounting ext2 in windows).

Thus all your file related system calls is screened by a VFS , what it does is,it observes the system call to a particular file system and handles the structural manipulations and translates the user system call to physical file system code which then can be used to perform the file chores for a given file system.


Thus the VFS stores information related to mounted file system,such as blocksize,inode and dirty flag etc.Which it uses while translating system call to file specific commands


INODES
All resources in linux such as hard disks, serial ports, memory etc are treated as file objects.Each file is represented by a structure called inode.Inode contains all information about the file such as file type,access rights,time stamps,size etc.



The directories are implemented as files composed of list of entries ,each indicating the inode number and file name,where each entry identifies a file in the directory.