Home  >  Article  >  What is the main purpose of a file system in an operating system?

What is the main purpose of a file system in an operating system?

青灯夜游
青灯夜游Original
2020-11-12 11:51:1543532browse

In the operating system, the main purpose of the file system is to "implement name-based access to files." The file system is the method and data structure used by the operating system to identify the files on the storage device or partition; the file system implements "access by name", and you can access files as long as you know the file name, regardless of whether the file is stored on the disk. Where.

What is the main purpose of a file system in an operating system?

#In the operating system, the main purpose of the file system is to "implement name-based access to files."

The file system is the method and data structure used by the operating system to identify files on storage devices (commonly disks, but also solid-state drives based on NAND Flash) or partitions; that is, the method of organizing files on storage devices .

The software organization responsible for managing and storing file information in the operating system is called the file management system, or file system for short.

The file system specifies the rules for naming files. These rules include the maximum number of characters in a filename, what kinds of characters can be used, and how long a filename suffix can be on some systems. File systems also include formats for specifying paths to find files through a directory structure.

The file system consists of three parts: the file system interface, a collection of software for object manipulation and management, and objects and attributes.

The file system is a part of the software system. Its existence allows applications to conveniently use abstract named data objects and variable-sized spaces.

From a system perspective, the file system is a system that organizes and allocates the space of file storage devices, is responsible for file storage, and protects and retrieves stored files. Specifically, it is responsible for creating files for users, modifying files, accessing files, transferring files, deleting files that users do not need from the disk, etc.

From the user's perspective, the file system implements "access by name". As long as you know the file name, you can access the file without having to consider where the file is stored on the disk.

The functions of the file system include:

Manage and schedule the storage space of files, provide the logical structure, physical structure and storage method of files; realize the transformation of files from identification to actual Address mapping realizes file control operations and access operations, realizes the sharing of file information, provides reliable file confidentiality and protection measures, and provides file security measures.

The logical structure of a file is to organize the file structure according to the logical relationship of the file content. The logical structure of files can be divided into streaming files and recorded files.

  • Streaming file: The data in the file is a stream of characters without structure.

  • Record file: It is composed of several logical records, and each record is composed of the same data items. The length of the data items can be determined or uncertain.

Common file system types

  • FAT

    Under Win 9X, FAT16 is supported The maximum partition size is 2GB. We know that computers store information on the hard disk in areas called "clusters." The smaller the clusters used, the more efficiently information can be saved. In the case of FAT16, the larger the partition, the larger the cluster, and the lower the storage efficiency, which will inevitably cause a waste of storage space. And with the continuous improvement of computer hardware and applications, the FAT16 file system can no longer adapt well to system requirements. In this case, the enhanced file system FAT32 was introduced.

  • NTFS

    NTFS file system is a security-based file system. It is a unique file system structure adopted by Windows NT. It is built on protecting files and An advanced file system that saves storage resources and reduces disk usage based on directory data. The widely used Windows NT 4.0 uses the NTFS 4.0 file system. I believe that the powerful system security it brings must have left a deep impression on the majority of users. Win 2000 uses an updated version of the NTFS file system NTFS 5.0. Its introduction allows users to not only operate and manage computers as conveniently and quickly as Win 9X, but also enjoy the system security brought by NTFS.

  • exFAT

    The full name is Extended File Allocation Table File System, extended FAT, which is the extended file allocation table, is Microsoft’s version of Windows Embeded 5.0 and above (including Windows CE 5.0, 6.0 , Windows Mobile5, 6, 6.1) A file system suitable for flash memory introduced in order to solve the problem that FAT32 and other files do not support 4G and larger files.

  • RAW

    RAW file system is a file system produced by unprocessed or unformatted disks. Generally speaking, there are several possibilities that may cause normal files The system becomes a RAW file system: there is no formatting, the formatting operation is canceled midway, bad sectors appear on the hard disk, unpredictable errors occur on the hard disk, or it is caused by viruses.

    The fastest way to solve the problem of RAW file system is to format it immediately and use anti-virus software to completely disinfect it. Of course, if the files are very important, you can use MiniRabbit Data Recovery software to rescue the data first, and then format and disinfect it.

  • Ext

    Ext2: Ext is the standard file system in the GNU/Linux system. It is characterized by excellent performance in accessing files, especially for small and medium-sized files. This is mainly due to the excellent design of its cluster cache layer. .

    Ext3: It is a log file system, an extension of the ext2 system, and it is compatible with ext2. The advantage of a journaled file system is that since the file system has a cache layer involved in its operation, the file system must be unmounted when not in use so that the data in the cache layer can be written back to the disk. Therefore, whenever the system needs to be shut down, all its file systems must be shut down before shutting down.

    Ext4: The Linux kernel officially supports the new file system Ext4 since 2.6.28. Ext4 is an improved version of Ext3, which modifies some important data structures in Ext3, not just adding a logging function like Ext3 did to Ext2. Ext4 can provide better performance and reliability, as well as richer features.

  • HFS

    Hierarchical File System (HFS) is a file system developed by Apple Computer and used on Mac OS. Originally designed for use with floppy disks and hard disks, it can also be found on read-only media such as CD-ROMs.

The above is the detailed content of What is the main purpose of a file system in an operating system?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn