1 / 24

File System and Directory Structure in Linux

File System and Directory Structure in Linux. What is File System. In a computer, a file system is the way in which files are named and where they are placed logically for storage and retrieval.

serena
Download Presentation

File System and Directory Structure in Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. File System and Directory Structure in Linux

  2. What is File System • In a computer, a file system is the way in which files are named and where they are placed logically for storage and retrieval. • Sometimes the term refers to the part of an operating system or an added-on program that supports a file system. Examples of such add-on file systems include the Network File System (NFS).

  3. logical file structure physical representation on disk

  4. File System • File systems specify conventions for naming files. These conventions include the maximum number of characters in a name, which characters can be used, and, in some systems, how long the file name suffix can be. A file system also includes a format for specifying the path to a file through the structure of directories.

  5. Linux File System • Ext2: This is like UNIX file system. • Ext3: It is ext2 filesystem with enhancement. • Isofs (iso9660): Used by CDROM file system. • Sysfs: It is a ram-based filesystem initially based on ramfs. It is use to exporting kernel objects so that end user can use it easily. • Procfs: The proc file system acts as an interface to internal data structures in the kernel For example you can find out cpuinfo with following command:

  6. Inside File System • User Data • Meta Data

  7. Linux Directory Structure • The Directory Structure in Unix & Linux are a unified Directory Structure where in all the directories are unified under the "/" Root file system. Irrespective of where the File System is physically mounted all the directories are arranged hierarchically under the Root file system.

  8. 1. / – Root • Every single file and directory starts from the root directory. • Only root user has write privilege under this directory.

  9. 2. /bin – User Binaries • Contains binary executables. • Common linux commands you need to use in single-user modes are located under this directory. • For example: ps, ls, ping, grep, cp.

  10. 3. /sbin – System Binaries • Just like /bin, /sbin also contains binary executables. • But, the linux commands located under this directory are used typically by system administrator, for system maintenance purpose. • For example: iptables, reboot, fdisk, ifconfig,

  11. 4. /etc – Configuration Files • Contains configuration files required by all programs. • This also contains startup and shutdown shell scripts used to start/stop individual programs. • For example: /etc/resolv.conf, /etc/logrotate.conf

  12. 5. /dev – Device Files • Contains device files. • These include terminal devices, usb, or any device attached to the system. • For example: /dev/tty1, /dev/usbmon0

  13. 6. /proc – Process Information • Contains information about system process. • This filesystemcontains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid. • This is a virtual filesystem with text information about system resources. For example: /proc/uptime

  14. 7. /var – Variable Files • varstands for variable files. • Content of the files that are expected to grow can be found under this directory. • This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);

  15. 8. /tmp – Temporary Files • Directory that contains temporary files created by system and users. • Files under this directory are deleted when system is rebooted.

  16. 9. /usr – User Programs • Home directories for all users to store their personal files. • For example: /home/john

  17. 11. /boot – Boot Loader Files • Contains boot loader related files. • Grub files are located under /boot • For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

  18. 12. /lib – System Libraries • Contains library files that supports the binaries located under /bin and /sbin • Library filenames are either ld* or lib*.so.* • For example: ld-2.11.1.so, libncurses.so.5.7

  19. 13. /opt – Optional add-on Applications • opt stands for optional. • Contains add-on applications from individual vendors. • add-on applications should be installed under either /opt/ or /opt/ sub-directory.

  20. 14. /mnt – Mount Directory • Temporary mount directory where sysadmins can mount filesystems.

  21. Inode • The inode (index node) is a fundamental concept in the Linux and UNIX file system. Each object in the file system is represented by an inode.

  22. File Information • File type (executable, block special etc)=> Permissions (read, write etc)=> Owner=> Group=> File Size=> File access, change and modification time (remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux sys admin job interview)=> File deletion time=> => Access Control List (ACLs)

  23. Inode • All the above information stored in an inode. In short the inode identifies the file and its attributes (as above) . Each inode is identified by a unique inode number within the file system. Inode is also know as index number.

More Related