1 / 65

Operating System & Administration

Operating System & Administration. UNIT-III Introduction to File System. OUTLINE. 1.PathName 2.File System Mounting and Unmounting 3.Organization of File Tree 4.File Type 5.File Attribute 6.Access Control List. What is a file.

ebrownlee
Télécharger la présentation

Operating System & Administration

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. Operating System & Administration UNIT-III Introduction to File System

  2. OUTLINE 1.PathName 2.File System Mounting and Unmounting 3.Organization of File Tree 4.File Type 5.File Attribute 6.Access Control List

  3. What is a file • File is a collection of data items stored on disk. Or, it's device which can store the information like data, music (mp3 files), picture, movie, sound, book etc. • In fact whatever you store in computer it must be in the form of file. • File is the last object in your file system tree.

  4. Component of File System • A namespace – a way to name things and organize them in a hierarchy • An API – a set of system calls for navigating and manipulating objects • A security model – a scheme for protecting, hiding, and sharing things • An implementation – software to tie the logical model to the hardware. • Note:- file should not contain / in between file name characters.

  5. Modern kernels define an abstract interface that contains many different back-end filesystems. • Windows - NTFS, FAT • Linux - Ext • Ext2 • Ext3 • Ext4

  6. Linux file system(History) • It has maximum size limit of 64 megabytes • There was also a filename length limit of 14 characters. • In 1991 a new file system came with addition of new file system as a layer on top of linuxkerenl that provide generic file API. Termed as VFS termed as ext. • But has problems like allowed 2 gigabytes of data and filenames of up to 255 characters. with problems like there was no support for separate access, inode modification and data modification with timestamps.

  7. Ext2:- • Introduced in 1993 by Rémy Card. • maximum filename length of 255 characters • has variable length block size(maximum data size of 2047 gigabytes). • Maximum individual file size can be from 16 GB to 2TB • Overall ext2 file system size can be from 2 TB to 32 TB

  8. Ext3:- • Introduced in 2001 by Stephen Tweedie • The main benefit of ext3 is that it allows journaling. • Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling. • maximum filename length of 255 characters • Maximum individual file size can be from 16 GB to 2 TB • Overall ext3 file system size can be from 2 TB to 32 TB

  9. Ext4 • It was introduced in 2008. • Starting from Linux Kernel 2.6.19 ext4 was available. • Supports huge individual file size and overall file system size. • Maximum individual file size can be from 16 GB to 16 TB • Overall maximum ext4 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). • 1 PB = 1024 TB (terabyte).

  10. Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3) • You can also mount an existing ext3 filesystem as ext4 filesystem (without having to upgrade it). • Several other new features are introduced in ext4: • multiblock allocation, • delayed allocation, • journal checksum. fast fsck, etc. • All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3

  11. Filesystem Hierarchy Standard • Started by Dennis Ritchie, 1993 • Defines the main directories and their contents in most Linux-based systems

  12. FHS • There is no any drive C:, D:, … • All directories are under “/” • “/” is the root directory • It is possible • to have multiple partitions • to multiple filesystems

  13. The “/” • The primary hierarchy in FSH • The root of tree of filesystem • All paths start form here • There is only one “/” in filesystem

  14. Pathname • What is Path • Path Types • Setting Path

  15. What is path • A path is a unique location to a file or a directory in a file system of an OS. • A path to a file is a combination of / and alpha-numeric characters • Ex. • /home/fedora/abc.txt • /etc/passwd • /proc/partitions • /etc/yum.d/yum.conf

  16. Path Types in Linux • Absolute path -An absolute path is defined as the specifying the location of a file or directory from the root directory(/). -In other words we can say absolute path is a complete path from start of actual filesystem from “ / “directory • Relative path -Relative path is defined as path related to the present working directory(pwd).

  17. Examples of relative path and absolute path • Example1: Present location is /abc/xyz, remove /abc/xyz/read/hello.txt file. Using relative path: rm read/hello.txt Using absolute path: rm /abc/xyz/read/hello.txt

  18. Example2: My present location is /etc/samba and now I want to change directory to /etc. Using relative path: cd .. Using absolute path: cd /etc Note:- there should be no ‘/’ in file Name Ex:- “abc/pqr” it will be assumed that pqr is in abc directory

  19. The Organization Of The File Tree

  20. boot • Linux kernel • Boot loader configuration • vmlinuz-2.6.3.1 is a executable that loads operating system in memory.(vmlinuz is a kernel). • If you lost boot • You cannot boot your OS

  21. boot Grand Unified boot Loader Dev by Erich Stefan Boleyn

  22. bin • Essential programs • Need for system startup • Common programs, shared by the system, the system administrator and the users. • Basic commands for • Navigating in filesystem • File management

  23. bin

  24. dev • Everything is file • Hardware components (devices) are file • Hard disk • Key board • All device files are here • Direct interaction with device driver • Open the device file • Read & Write

  25. dev

  26. etc • System configuration directory • Critical startup and configuration files • All configuration file are text files • You can view and edit it manually

  27. etc

  28. home • Home directory of user • Each user has a directory • /home/xyz • /home/abc • All files of user are stored here

  29. lib • Libraries, shared libraries and parts of the C compiler • Programs need libraries • Dynamically linked libraries • All essential libraries are here • Needed for system startup

  30. lib

  31. proc • Information about all running processes • It represent current state of kernel

  32. Directories with names as numbers Do a ls -l /proc, and you’ll see lot of directories with just numbers. These numbers represents the process ids, the files inside this numbered directory correspond to the process with that particular PID Following are some file located in proc directory as • cmdline – command line of the command. • environ – environment variables. • fd – Contains the file descriptors which is linked to the appropriate files. • limits – Contains the information about the specific limits to the process.

  33. Files about the system information It contains system information such as cpuinfo, meminfo, • /proc/cpuinfo – information about CPU, • /proc/meminfo – information about memory, • /proc/partitions – partition related information, • /proc/version – linux version

  34. mounts – mount related information

  35. proc

  36. root • Home directory of root user or super user • Don’t confuse • / is the “root of Filesystem” • root is the name of system admin • /root is the admin

  37. sbin • It contains executable programs (ready to run). • They are mostly admin tool and made available to root user. • System configuration programs • Format hard disk (fdisk,fsck, ifconfig,modinfo(info for kernel module) • Halt, reboot,fasthalt(stop system without disk checking).

  38. /sbin should contain only binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.

  39. sbin

  40. tmp • Temporary directory • All temp files are created by programs • Your temp files • It is emptied regularly

  41. usr • It contains all the user binaries, their documentation, libraries, header files, etc and its supporting libraries can be found here. • Also termed as Secondary hierarchy • Very useful programs • We usually use them for • compiler, tools • Are not essential for system startup

  42. /usr/bin:- • This directory contains the vast majority of binaries on your system. • Executables in this directory vary widely. • For instance vi, gcc, gnome-session and mozilla and are all found here. • /usr/doc:- • The central documentation directory. • Documentation is actually located in /usr/share/doc and linked from here.

  43. usr

  44. var • Contains variable data like system logging files, mail and printer spool directories, and transient and temporary files. • Some portions of /var are not shareable between different systems.like • /var/log, /var/lock, and /var/run. • The shared • /var/mail, /var/cache/man, /var/cache/fonts, and /var/spool/new • The variable directory • All dynamic files, User cannot change the files

  45. var

  46. File Types • Filesystem implementation define seven types of files • Regular files • Directories • Character device files • Block domain sockets • Local domain sockets • Named pipes (FIFO) • Symbolic links

  47. How to create and remove files

  48. Regular File : • It is consist of a series of bytes, filesystems impose no structure on their contents. • Example: text files, data files, executable programs. Directories : • It contains named references to other files.

  49. Character and Block device files : • Device files let programs communicate with the system’s hardware and peripherals. • The kernel loads driver software for each of the system’s devices. • Character device files allow their associated drivers to do their own i/p and o/p buffering. Device Driver Files request Hardware Program

More Related