1 / 23

CSIT-300 Systems Administration

CSIT-300 Systems Administration. File Types and File Systems. Regular Files. A simply definition of a regular file would be that it is a one dimensional assortment of bytes that are stored on a disk or other mass storage devices. Stream of bytes. No structure imposed by OS.

vernon
Download Presentation

CSIT-300 Systems 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. CSIT-300 Systems Administration File Types and File Systems

  2. Regular Files • A simply definition of a regular file would be that it is a one dimensional assortment of bytes that are stored on a disk or other mass storage devices. • Stream of bytes. • No structure imposed by OS. • Programs need to know the structure of file. • EOF is not typed in but size is used as offset.

  3. Types of Regular Files • Text • Binary • Exe etc. • Linux maintain a database for its files. • A regular file is referenced by its Inode number.

  4. Directory Files • A simple definition of a directory is that it is a file that provides a mapping mechanism between the names of files and the files (datablocks) themselves. • Also called a file. • Maintain a good structure. • Holds inode numbers and file names. • Deletion of a file zeros its entry in list. Inode is shadow inode, finally freed.

  5. Device Files • A device file refers to a device driver and these are important to the kernel. • The files in /dev are used to ensure that we can access hardware such as the printer, cdrom, network etc. • Linux can either see or not see a non-standard piece of hardware.

  6. Device Files • Read and write directly to the device. • User issues a system call. • Kernel performs a successful open. • If busy read/write cant operate. • If not busy direct read/write to device.

  7. Types of Device Files • Character device files: Writes to and from a device a character at a time. “c” is indicated in the first field. Request goes directly to the device • Block device files: a block is buffered in kernel. “b” is indicated in the first field. A file system is an example. • Block devices have character device associated with them. Example is formatting or backing up a diskette.

  8. Interprocess Communication Devices • Linux set up some device files to allow interprocess communication. • Important to have an understanding of these as System Administrator. • These are Pipes, Semaphores, and shared memory devices. • These are not purely device files but handled in very much the same manner.

  9. Pipes • Named pipe • In a named pipe situation the processes are being run by the same process group and by the same user. • Un-named pipe. • Used when processes run within different process groups. • Output from one process become input for another process.

  10. Semaphore • A data structure used by processes to control and synchronize operation on one resource. • Request for a record by several processes from a database. Semaphore comes in action.

  11. Shared Memory • This type of file is indicated by an "m" in the first field. • A piece of user-memory is allocated as a work-space, where it is possible for a process to read the data at the same time as another writes it.

  12. Major and Minor Device Numbers • Each device has a reference number. • Kernel uses it when needs to access it. • Numbers are categorized as Major and Minor. • Major numbers refer to device drivers. • Minor numbers are refer to device itself.

  13. Inodes • As a file is created a unique number is ascribed to that file and this is called an inode number. • Holds specific information about file.

  14. Information held by Inode • Permission mode. • Number of links in place for the file. • File owners UID number • Group GID number. • File size in bytes. • Address of data blocks. • Time last modified. • Time last accessed. • Time any part of the Inode was changed.

  15. Inode status • Residing on disk is known as disk inode. • File opened, kernel put it in generic inode table so known as generic inode. • Inodes are stored in generic table • Table has a link to hash queue and this stored in a table referenced by kernel each time it opens a file to make sure file is not opened already.

  16. File System • A filesystem is a logical division within a physical partition. • There can only be one of the physical partitions active at any one time • This will be the partition that you boot up with by default when the machine is switched on.

  17. File System (Linux) • We can divide on the basis of following criteria • Size of hard drive • Security issues • Swap • User requirements

  18. Types of File System • ext2, ext3, Reiserfs and XFS and many more. • ext2 is the only one supported by Debian • ext3 filesystem is the next generation of the Extended Filesystem, and allows for larger filesystems and files, as well as improving performance. • Reiserfs and XFS filesystems allow for improved performance when using large filesystems

  19. Layout of File System • Boot Block • Super Block • Inode Table • Data Blocks.

  20. Super Block • Contains general information about file system like : • File System size. • Condition of the file system • A list of some of the free inodes and blocks available

  21. Inode Table • contains the number of inodes allocated to that filesystem. • elastic in Linux and will expand if you require more inodes • create a new file the kernel will allocate an inode from the free list held in super block.

  22. Data Blocks • Contains: • File data • Fixed in size. • kernel can only access the data blocks via the information held in the inode of that file.

  23. Mount and Unmount File System • All files in one big tree. • File hierarchy is rooted at /. • mount is used to attached a file system to this big tree. • /dev directory • mount /cdrom

More Related