UNIX File System Basics

The UNIX file system is based on a hierarchical structure, which means that all files and directories are organized in a tree-like structure. The root directory is at the top of the tree and is denoted by the forward slash (/) symbol.

File System Hierarchy

The UNIX file system is organized into a number of directories, each of which contains a set of files and subdirectories. The key directories in the UNIX file system include:

  • /bin: contains essential command-line utilities
  • /boot: contains files required to boot the system
  • /dev: contains device files
  • /etc: contains system configuration files
  • /home: contains home directories for users
  • /lib: contains system libraries
  • /sbin: contains essential system administration utilities
  • /usr: contains user applications and libraries

Inodes

The UNIX file system uses inodes to keep track of files. An inode is a data structure that contains information about a file, such as its permissions, ownership, size, and location on disk. Each file in the UNIX file system is associated with a unique inode number.

Directories

In the UNIX file system, directories are simply files that contain a list of other files and directories. Each directory has an associated inode, just like a file, and the contents of the directory are stored in data blocks on disk.

Links are another key feature of the UNIX file system. A link is simply a pointer to a file or directory. There are two types of links in the UNIX file system: hard links and soft links.

A hard link is a direct link to a file. When you create a hard link, you are creating another file that points to the same inode as the original file. This means that changes to either file will be reflected in both files.

A soft link, also known as a symbolic link, is a file that contains a pointer to another file or directory. Unlike a hard link, a soft link is simply a reference to the original file. This means that if the original file is deleted, the soft link will no longer work.

Key Features of the UNIX File System

The UNIX file system has several key features that make it different from other file systems.

Permissions and Ownership

One of the most important features of the UNIX file system is its permissions and ownership model. Each file and directory in the UNIX file system is associated with a set of permissions and an owner. The permissions determine who can read, write, or execute the file, and the owner determines who can modify the file. This model provides a high level of security and control over the file system.

File Types

The UNIX file system supports several different file types, including regular files, directories, links, and special files. Regular files contain data, directories contain lists of files and directories, links point to other files or directories, and special files are used to represent devices or other system resources.

As mentioned earlier, the UNIX file system supports both hard and soft links. Hard links allow multiple files to point to the same inode, while soft links provide a way to create a symbolic reference to a file or directory.

File System Attributes

The UNIX file system also supports a number of attributes that can be assigned to files and directories. These attributes include the creation time, modification time, access time, and file size, among others. These attributes can be used to provide additional information about the file system and to help manage files and directories.

How UNIX File System Differs from Other File Systems

While the UNIX file system shares many similarities with other file systems, there are several key differences that set it apart.

Hierarchical Structure

The hierarchical structure of the UNIX file system is one of its defining features. Unlike some other file systems that use a flat structure, the UNIX file system organizes files and directories in a tree-like structure that begins with the root directory.

Inodes and Directories

The use of inodes and directories is another feature that sets the UNIX file system apart. Inodes provide a way to manage files and track file attributes, while directories are used to organize files and create a hierarchy.

The UNIX file system’s support for hard and soft links is another key difference from other file systems. These links provide a way to create multiple paths to a file or directory, which can be useful in a variety of situations.

Permissions and Ownership

The UNIX file system’s permissions and ownership model is another feature that sets it apart. This model provides a high level of security and control over the file system, which is essential in many contexts.


OS-2022

Q-1.

(a) Write are the functions of operating systems? write a note on multi programmed operating systems ?

(b) Distinguish between client server and peer to peer model of distributed systems .

Q-2.

(a) With a Neat Sketch, Describe the services that an Operating System provides to users, processes and other systems.

(b) What is meant by Storage Structure? Discuss Storage Hierarchy.

(c) Write the Advantages and Disadvantages of using the same system call interface for manipulating both Files and Devices.

Q-3.

(a) What are the criteria for evaluating the CPU scheduling algorithms? Why do we need it?

(b) Define process. Explain various steps involved in change of a process state with process state neat transition diagram.

Q-4.

(a) What is synchronization? Explain how semaphores can be used to deal with n-process critical problem.

(b) Define a thread. Give the benefits of multithreading. What resources are used when a thread is created?

Q-5.

(a) How dose deadlock avoidance differ from deadlock prevention? Write about deadlock avoidance algorithm in detail.

(b) Different between external fragmentation and internal fragmentation. How to solve the fragmentation using paging?

Q-6.

(a) What is the purpose of paging the page table? Consider the following page reference string 1,2,3,4,5,1,2,3,4,5 for a memory with three frames. How many page faults would LRU and FIFO replacement algorithm?

(b) What are the disadvantages of single contiguous memory allocation? Explain.

Q-7.

(a) Briefly explain about single-level, two-level and three Structured directories.

(b) What is disk scheduling? Explain the C-SCAN scheduling by giving an example.

Q-8.

(a) Interrupt and spooling.

(b) UNIX file system.

(c) Program and system threats.

JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.