DISCLAIMER : Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility.If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.
Unix filesystems explained
A filesystem is a logical collection of files on a partition or disk. A
partition is a container for information and can span an entire hard
drive if desired.
Everything in Unix is considered to be a file, including physical devices such as DVD-ROMs, USB devices, floppy drives, and so forth.
Unix uses a hierarchical file system structure, much like an
upside-down tree, with root (/) at the base of the file system and all
other directories spreading from there.
A UNIX filesystem is a collection of files and directories that has the following properties:
Everything in Unix is considered to be a file, including physical devices such as DVD-ROMs, USB devices, floppy drives, and so forth.
A UNIX filesystem is a collection of files and directories that has the following properties:
- It has a root directory (/) that contains other files and directories.
- Each file or directory is uniquely identified by its name, the directory in which it resides, and a unique identifier, typically called an inode.
- By convention, the root directory has an inode number of 2 and the lost+found directory has an inode number of 3. Inode numbers 0 and 1 are not used. File inode numbers can be seen by specifying the -i option to ls command.
- It is self contained. There are no dependencies between one filesystem and any other.
Directory | Description |
---|---|
/ | This is the root directory which should contain only the directories needed at the top level of the file structure. |
/bin | This is where the executable files are located. They are available to all user. |
/dev | These are device drivers. |
/etc | Supervisor directory commands, configuration files, disk configuration files, valid user lists, groups, ethernet, hosts, where to send critical messages. |
/lib | Contains shared library files and sometimes other kernel-related files. |
/boot | Contains files for booting the system. |
/home | Contains the home directory for users and other accounts. |
/mnt | Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive and floppy diskette drive, respectively |
/proc | Contains all processes marked as a file by process number or other information that is dynamic to the system. |
/tmp | Holds temporary files used between system boots |
/usr | Used for miscellaneous purposes, or can be used by many users. Includes administrative commands, shared files, library files, and others |
/var | Typically contains variable-length files such as log and print files and any other type of file that may contain a variable amount of data |
/sbin | Contains binary (executable) files, usually for system administration. For example fdisk and ifconfig utlities. |
/kernel | Contains kernel files |