Write short notes on File System highlighting advantages and disadvantages .
The Unix file system is a methodology for logically organizing and storing large quantities of data such that the system is easy to manage. A file can be informally defined as a collection of (typically related) data, which can be logically viewed as a stream of bytes (i.e. characters). A file is the smallest unit of storage in the Unix file system.
- Unix File system is generally divided into four part
- The Boot Block
- The Super Block
- The inode Table
- The data block
- The boot block
- It is located at the beginning of the file system
- It can be accessed by code incorporated by computer ROM bios
- The boot block is part of disk label
- It contain a program called bootstrap to boot the OS
- The super block
- It contain statistical information to keep track of the entries in the file system
- Whenever disk manipulation is required the super block is accessed
- Always the copy kept in RAM
The super block contain information
- Size of the file system
- The storage size of the device or current partition
- List of storage blocks
- The storage space is divided into series of standard size block
- When data moved to or from the file system ie block
- Number of free block on the file system
- A list of free block with their location
- Size of the inode list
- The inode list is initialized to track the maximum number of files which cannot be more than maximum number of storage blocks
- Number of free inode on the file system
- A list of free inodes
- Index to next free inode on the list
- Lock fields for free blocks and free inode lists
- Flag to indicate modification of super blocks
- The inode table
- Information about each file in the file system is kept in a special kernel structure called inode
- The inode contain pointer to disk block containing data in the file
- It contain other information like file size, file modification time, permission bit owner, group etc
- It does not contain name of file
- The name of file is listed in directory
- The directory contain the file name and their associated inode
- A inode size of 64 bytes for a file contain the information
- File owner type
- This is number id used as password to find user of the system
- Group id
- This is group to access the owner file
- File type
- it indicate whether inode represent a file, a directory or block device
- If the type value is zero then inode is free
- File Access Permission
- User access
- Group Access
- Access the member of specified group
- Other Access
- Three types of Access
- Each file contain 9 access permission for read write and execute
- The format rwx-rwx-rwx
- Date & time of last file access
- Date & time of last modified
- Inode modification time
- Whenever the file is accessed or modified or when inode is modified, the content of the file changed – the inode modification time also change
- Number of links
- It gives the number of directory entries referencing the same inode
- Size of the file
- This gives the size of the file in bytes
- Table of disk address
- The data is stored on the storage device
- The block storing the data file data in which to retrieve
- Totally there is 13 address or pointer
- The first 10 point directly
- If additional storage is required 11th pointer is used(256 space)
- If additional storage is required 12th pointer is used(256 *256 space)
- If additional storage is required 13th pointer is used(256*256*256 space)
- The data block
- It contain the actual data in the file or directories
- It follow inode table and occupy most storage space
- The file allotted for one file cannot allotted for other file unless the two files are linked
- Advantages
- Data in small files can be accessed directly from inode
- Larger files can be accessed efficiently
- Disk can be filled completely
- Disadvantage
- Inode information kept separately from data often requires a long seek when file accessed
- Inode of files in a common directory are not kept together so it case low performance
- Original file system uses 512 bytes block , an inefficient transfer size