Professional Documents
Culture Documents
PROGRAMMING
Chapter-3
1
• Unix File system : A file system is a component Unix that
enables the user to view, organize, secure and interact with
files and directories that are located on storage devices.
Different types of file systems :
•Disk-oriented file system : Physically accessible file systems residing on a hard drive,
CD-ROM, DVD ROM, USB drive or any other device.
• Network-oriented file system : A file system accessed from a remote location. These are
usually disk-oriented on the server side.
•Special file system – A file system that typically doesn’t physically reside on disk such as
Temporary file system (TMPS) and process file system (PROCFS).
Inodes store information about files and directories (folders), such as file ownership,
access mode (read, write, execute permissions), and file type.
The inode number indexes a table of
inodes in a known location on the device.
From the inode number, the kernel's file
system driver can access the inode
contents, including the location of the file,
thereby allowing access to the file. A
file's inode number can be found using
the ls -i command. The ls -
i command prints the i-node number in
the first column of the report
Freeing an inode :- If the free inode list in super block has space enough, the
freed one is put there. If the freed inode number is less than the remembered
inode, then the remembered inode is updated with the freed inode
Soft & Hard Links :- In UNIX, a file is required to be accessed by two or more
different directories / or run by two or more different users at the same time. For
example a configuration file required to be accessed by two different software
packages or a document (C Program) that needs to be accessed by different
users. The file could simply be copied, this would mean to replicate the file and
changes in the file simultaneously would then create an administrative
nightmare. The way two (or more) files can have the same data is by using links.
Links are of two type soft link and hard link.
Soft Link:
It is a file containing name of another file.
A soft link (symbolic link) is a pointer pointing to the file's contents.
"In -s" is used to create symbolic link.
If the original file is deleted symbolic file can't be opened.
"rm" can be used to remove a symbolic file.
Hard Link:
• 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