Thursday, 11 October 2007

(Review) - A file system is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk.

There are two kinds of major partitions on a Linux system:

- Data partition: normal Linux system data, including the root partition containing all necessary data to startup and run the system.
- Swap partition: expansion of the computer's physical memory, extra memory on hard disk. It’s generally kept double the capacity of system memory.

One of the great features of Linux is that it supports numerous file systems. This makes it very flexible and smooth enough to coexist with a variety of other operating systems. These file systems include: ext, ext2, xia, minix, umsdos, msdos, vfat, proc, smb, ncp, iso9660, sysv, hpfs, affs and ufs.

Roughly speaking, Linux is a versatile operating system that supports a wide range of file systems. This is made possible by the unified interface of the Linux kernel. This unified interface is known as "virtual file interface." Note that it’s not a file system on its own but an interface that provides a clearly defined link between the operating system kernel and different file systems.

This virtual file system accomplishes the following tasks:

- Supplies the applications with the system calls for the management.
-
Improving performance of default actions.

Before a partition or disk can be used as a file system, it should be initialized and some structures (such as inode) need to be written for it.

This kind of layout does offer few advantages. Let’s look at directory "/," for example. With the Linux file system, you can choose to mount it off another partition or another machine over the network. The underlying system will not know the difference because / appears to be a local directory that is part of the local directory structure. How many times have you wished to move around executables and data structures under Windows, only to run into registry and system errors? Try moving C:\Windows\System to another partition or drive, and you’ll quickly find yourself bombarded with errors.

Linux uses single hierarchical directory structure, similar to UNIX. Everything starts with "/" i.e. root directory. This is the first thing people notice that have migrated from Windows operating systems to Linux. They face problems navigating through the file system, especially when they are using the console. Also in Windows, various partitions are detected and assigned a drive letter, whereas in Linux you need to mount a partition before accessing it.

There is a rather popular saying about Linux and UNIX systems that relates well to this topic:

"On a UNIX system, everything is a file; if something is not a file, it is a process."

Also, Linux does not differentiate between a file and a directory. In fact, a directory is special type of file in Linux. We will look into this later.

Linux has inherited most of its properties from UNIX, including its name (Linux is not UNIX) and file systems. From UNIX, Linux also has a hierarchal structure and is case sensitive. This means that /puru and /PURU are considered different files in Linux, whereas they are the same on a Windows machine.

There are different types of files on Linux. Let’s have a look at them:

- Links: a system to make a file or directory visible in other parts of the system's file structure
- Directories: files that are lists of other files
- Named Pipes: act more or less like sockets and form a way for processes to communicate with each other, without using network socket semantics.
- Special Files: used for input and output. Most special files are in /dev.
- Sockets: a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system's access control.

You can see file listings in Linux using ls binary. You may use –l for further explanation, –a to see hidden files, and ls for more details.

We’ll look into file system implementation and other related topics in the next few articles.

More Articles:
- Brief Look: ELF File Format in Linux
- What is Aspect Oriented Programming?
- The Process of Booting an Operating System: An Introduction
- How Linux Runlevels Operate?
- Analysis: Blue Screen of Death (BSoD) 

- Subscribe to OSWeekly.com's RSS Feed


Article Tools
Index
E-mail Email this article