• File system. Types of file systems. File operations. Catalogs. Operations with directories. (5)

    The file system is the system that is used by the Windows operating system. It is necessary for organizing and storing data on any disk. It is she who is responsible for storing data on the hard drive. Let's look at what a file system is and what types of such systems exist.

    Why do we need a file system?

    You can understand what file system is used on your computer by going to the folder called “My Computer”. Then you need to right-click and select “properties”. In the information window that appears, you can read the following inscription: File system: (name).

    It is not at all necessary that each disk will have the same file system. To find out, you need to look at each disc.

    Exactly from the right choice file system and will depend on the security of your personal computer, and operating system will not get confused and lose data. Let's look at what file systems can be found in Windows.

    Types of file systems

    FAT

    The first thing we'll look at is a file system called FAT. Today it is extremely rare, so it is not worth dwelling on it in detail. Its biggest drawback is the maximum disk capacity, which is only 2 GB, which is practically never found in modern hardware. Thus, if your disk has a larger capacity, then it stops working. A few years ago, 2 GB was the standard hard drive capacity, and this file system was used perfectly there. But today it has outlived its usefulness and has taken an honorable place in the dustbin of history.

    The next file system is the famous FAT 32. 32 is the system bit size. This version is an updated version of the previous file system. If you are using an earlier version of Windows, you may have some problems formatting the drive. However, this system is much more stable than its predecessor, and working with files will proceed much faster.

    NTFS

    Now let's look at what the NTFS file system is. This system file storage appeared relatively recently and is more modern than the previous two. However, despite the huge number of advantages, it is not without its disadvantages. Most disks produced by commercial companies today have just such a file system. It stores data much better, but is quite demanding on your computer's resources.

    In addition, in the case where the logical disk has full load to 90 percent, file system performance drops sharply. Also, if the operating system is older than Windows XP, then such a file system will simply refuse to work on it. Once you insert the disk into the drive, your computer simply will not be able to recognize it or will be marked as an unknown partition. Speaking about the advantages, it can be noted that the work of such a file system with small files is much faster and of better quality. Most large size, which a disk can have is 18 TB. There is also such a thing as file fragmentation. With it, the file system will not slow down, but will continue to work normal mode. Also, when using NTFS, you can be completely and completely sure that the file will not be damaged. The system uses disk space very economically and allows you to compress files to a minimum size without damaging them at all. By the way, it was thanks to this system that it became possible to restore data in case of loss. Accordingly, if we compare this system with FAT, then all the advantages are obvious. The most important thing that it can offer you is safety.

    UDF

    Now it’s time to look at what the UDF file system is. This is a file system that is independent of the computer's operating system and is used to save data stored on optical media. Unlike previous systems,UDF allows you to additionally write information to an already full floppy disk. This file system can also selectively erase certain files on the disk without damaging other information. Metadata such as the root territory is located chaotically inside the disk, but the basis of this data has three places: sector 256, 257 and N-1, in in this case N is the track size.

    For DVD discs, UDF is the most successful file system because it has absolutely no restrictions on file sizes. You can record both large and small videos.

    It was thanks to UDF that we learned what the final file system is and how to choose it correctly for your computer.

    File systems. Types of file systems. File operations. Catalogs. Operations with directories.

    File is a named area of ​​external memory that can be written to and read from.

    Main purposes of using the file.

      Long-term and reliable storage of information . Durability is achieved through the use of storage devices that do not depend on power, and high reliability is determined by means of protecting access to files and the general organization of the OS program code, in which hardware failures most often do not destroy the information stored in files.

      Sharing information . The files provide natural and easy way separation of information between applications and users due to the presence of a human-readable symbolic name and the constancy of the stored information and file location. The user must have convenient tools for working with files, including directories that combine files into groups, tools for searching files by characteristics, a set of commands for creating, modifying and deleting files. A file can be created by one user and then used by a completely different user, and the file's creator or administrator can determine the access rights of other users. These goals are implemented in the OS by the file system.

    File system (FS) is a part of the operating system that includes:

      the collection of all files on the disk;

      sets of data structures used to manage files, such as file directories, file descriptors, free and used disk space allocation tables;

      complex system programs n tools that implement various operations on files, such as creating, destroying, reading, writing, naming and searching for files.

    Thus, the file system plays the role of an intermediate layer that screens out all the complexities of the physical organization of long-term data storage, and creates a simpler logical model for this storage for programs, as well as providing them with a set of easy-to-use commands for manipulating files.

    The following file systems are widely known:

      file system operating system MS - DOS , which is based on file allocation table - FAT ( File Allocation Table ).

    The table contains information about the location of all files (each file is divided into clusters Clusters of the same file are not necessarily located next to each other, depending on the availability of disk space). The MS-DOS file system has significant limitations and disadvantages, for example, under Name The file is allocated 12 bytes; working with a large hard drive leads to significant file fragmentation;

    The main functions in such a FS are aimed at solving the following tasks:

      file naming;

      application programming interface;

      display logical model file system on the physical organization of data storage;

      file system resilience to power failures, hardware errors and software.

      OS /2 , called HPFS ( High - Performance File System - fast file system).

    Provides the ability to have a file name of up to 254 characters. Files written to disk have minimal fragmentation. Can work with files written in MS DOS;

    A new task is added to the tasks listed above sharing a file from multiple processes. The file in this case is a shared resource, which means that the file system must solve the whole range of problems associated with such resources. In particular, the FS must provide means for blocking a file and its parts, preventing races, eliminating deadlocks, reconciling copies, etc.

    In multi-user systems, another task appears: protecting one user's files from unauthorized access by another user.

      operating system file system Windows 95

    It has a level structure, which allows you to support several file systems simultaneously. The old MS-DOS file system is directly supported, but file systems not developed by the company Microsoft, are supported using special modules. It is possible to use long (up to 254 characters) file names.

      operating system file systems Unix

    They provide a unified way to access I/O file systems.

    File permissions practically determine access rights to the system (the owner of the file is the user who created it).

    File types

    File systems support several functionally different file types, which typically include regular files, directory files, special files, named pipes, memory-mapped files, and others.

    Regular files , or simply files, contain arbitrary information that is entered into them by the user or that is generated as a result of the operation of system and user programs. Most modern operating systems (for example, UNIX, Windows, OS/2) do not restrict or control the contents and structure of a regular file in any way. The contents of a regular file are determined by the application that works with it. For example, text editor creates text files consisting of strings of characters represented in some code. These can be documents, program source codes, etc. Text files can be read on the screen and printed on a printer. Binary files do not use character codes, they often have a complex internal structure, such as executable program code or archive file. All operating systems must be able to recognize at least one file type - their own executable files.

    Catalogs - this is a special type of file that contains system background information about a set of files grouped by users according to some informal criterion (for example, files containing documents of the same agreement, or files that make up one software package are combined into one group). On many operating systems, a directory can contain any type of file, including other directories, creating a tree structure that is easy to search. Directories establish a mapping between file names and file characteristics that are used by the file system to manage files. Such characteristics include, in particular, information (or a pointer to another structure containing this data) about the type of file and its location on the disk, access rights to the file, and the dates of its creation and modification. In all other respects, directories are treated by the file system as regular files.

    Special files - These are dummy files associated with I/O devices, which are used to unify the mechanism for accessing files and external devices. Special files allow the user to perform I/O operations using normal commands for writing to a file or reading from a file. These commands are processed first by file system programs, and then at some stage of the request execution they are converted by the operating system into control commands for the corresponding device.

    Modern file systems support other file types, such as symbolic links, named pipes, and memory-mapped files.

    Hierarchical file system structure

    Users access files by symbolic names. However, human memory limits the number of object names that a user can refer to by name. The hierarchical organization of the namespace allows us to significantly expand these boundaries. This is why most file systems have a hierarchical structure, in which levels are created by allowing a lower-level directory to be contained within a higher-level directory (Figure 7.3).

    The graph describing the directory hierarchy can be a tree or a network. Directories form a tree if a file is allowed to be included in only one directory (Fig. 7.3, b), and a network - if the file can be included in several directories at once (Fig. 7.3, c). For example, in MS-DOS and Windows, directories form a tree structure, while in UNIX they form a network structure. In a tree structure, each file is a leaf. Catalog itself top level called root directory, or root ( root ).

    With this organization, the user is freed from remembering the names of all files; he only needs to have a rough idea of ​​which group a particular file can be assigned to in order to find it by sequentially browsing directories. The hierarchical structure is convenient for multi-user work: each user with his files is localized in his own directory or subtree of directories, and at the same time, all files in the system are logically connected.

    A special case of a hierarchical structure is a single-level organization, when all files are included in one directory (Fig. 7.3, a).

    File names

    All file types have symbolic names. Hierarchically organized file systems typically use three types of filenames: simple, compound, and relative.

    A simple, or short, symbolic name identifies a file within a single directory. Simple names are assigned to files by users and programmers, and they must take into account OS restrictions on both the range of characters and the length of the name. Until relatively recently, these boundaries were very narrow. Thus, in the popular FAT file system, the length of names was limited to scheme 8.3 (8 characters - the name itself, 3 characters - the name extension), and in the s5 file system, supported by many versions of the UNIX OS, a simple symbolic name could not contain more than 14 characters. However, it is much more convenient for the user to work with long names because they allow you to give the files easy-to-remember names that clearly indicate what is contained in the file. Therefore, modern file systems, as well as improved versions of pre-existing file systems, tend to support long, simple symbolic file names. For example, on the NTFS and FAT32 file systems included with the Windows NT operating system, a file name can contain up to 255 characters.

    In hierarchical file systems, different files are allowed to have the same simple symbolic names, provided they belong to different directories. That is, the “many files - one simple name” scheme works here. To uniquely identify a file in such systems, the so-called full name is used.

    The full name is a chain of simple symbolic names of all directories through which the path from the root to the given file passes. Thus, the full name is a compound one in which simple names separated from each other by the separator adopted in the OS. Often a forward or backslash is used as a delimiter, and it is customary not to specify the name of the root directory. In Fig. 7.3, b two files have the simple name main.exe, but their compound names /depart/main.exe and /user/anna/main.exe are different.

    In a tree file system, there is a one-to-one correspondence between a file and its full name: one file - one full name. In file systems that have a network structure, a file can be included in several directories, and therefore have several full names; here the correspondence “one file - many full names” is valid. In both cases, the file is uniquely identified by its full name.

    A file can also be identified by a relative name. The relative file name is determined through the concept of "current directory". For each user, at any given time, one of the file system directories is the current directory, and this directory is selected by the user himself upon an OS command. The file system captures the name of the current directory so that it can then use it as a complement to relative names to form the fully qualified file name. When using relative names, the user identifies the file by the chain of directory names through which the route from the current directory to of this file. For example, if the current directory is /user, then the relative file name /user/anna/main.exe is anna/main.exe.

    Some operating systems allow you to assign multiple simple names to the same file, which can be interpreted as aliases. In this case, just as in a system with a network structure, the correspondence “one file - many full names” is established, since each simple file name corresponds to at least one full name.

    And although the full name uniquely identifies the file, it is easier for the operating system to work with the file if there is a one-to-one correspondence between the files and their names. For this purpose, it assigns a unique name to the file, so that the relationship “one file - one unique name” is valid. The unique name exists along with one or more symbolic names assigned to the file by users or applications. The unique name is a numeric identifier and is intended only for the operating system. An example of such a unique file name is an inode number on a UNIX system.

    File attributes

    The concept of “file” includes not only the data and name it stores, but also its attributes. Attributes - This is information describing the properties of the file. Examples of possible file attributes:

      file type (regular file, directory, special file, etc.);

      file owner;

      file creator;

      password to access the file;

      information about permitted file access operations;

      times of creation, last access and last modification;

      current file size;

      maximum size file;

      read-only sign;

      “hidden file” sign;

      sign “system file”;

      sign “archive file”;

      "binary/character" attribute;

      attribute “temporary” (remove after process completion);

      blocking sign;

      file record length;

      pointer to the key field in the record;

      key length.

    The set of file attributes is determined by the specifics of the file system: different types of file systems may use different sets of attributes to characterize files. For example, on file systems that support flat files, there is no need to use the last three attributes in the list that are related to file structuring. In a single-user OS, the set of attributes will lack characteristics relevant to users and security, such as the owner of the file, the creator of the file, the password for accessing the file, information about authorized access to the file.

    The user can access attributes using the facilities provided for this purpose by the file system. Typically, you can read the values ​​of any attribute, but only change some. For example, a user can change the permissions of a file (provided they have the necessary permissions to do so), but they are not allowed to change the creation date or current size of the file.

    File attribute values ​​can be directly contained in directories, as is done in the MS-DOS file system (Fig. 7.6a). The figure shows the structure of a directory entry containing a simple symbolic name and file attributes. Here the letters indicate the characteristics of the file: R - read-only, A - archived, H - hidden, S - system.

    Rice. 7.6. Directory structure: a - MS-DOS directory entry structure (32 bytes), b - UNIX OS directory entry structure

    Another option is to place attributes in special tables, when the catalogs contain only links to these tables. This approach is implemented, for example, in the ufs file system of the UNIX OS. In this file system, the directory structure is very simple. The record for each file contains a short symbolic file name and a pointer to the file index descriptor, this is the name in ufs for the table in which the file attribute values ​​are concentrated (Fig. 7.6, b).

    In both versions, directories provide a link between file names and the files themselves. However, the approach of separating the file name from its attributes makes the system more flexible. For example, a file can easily be included in several directories at once. Entries for this file in different directories may have different simple names, but the link field will have the same inode number.

    File Operations

    Most modern operating systems treat a file as an unstructured sequence of variable-length bytes. Standard POSIX The following operations are defined on the file:

      int open ( char * fname , int flags , mode _ t mode )

    This operation ``opens'' a file, establishing a connection between the program and the file. In this case the program receives file descriptor- an integer identifying this connection. In fact, this is an index in the system table of open files for a given task. All other operations use this index to reference the file.

    The char * fname parameter specifies the file name. int flags is a bit mask that determines the file's opening mode. The file can be opened read-only, write-only, or read-write; in addition, you can open an existing file, or you can try to create new file zero length. The optional third parameter mode is used only when creating a file and specifies the attributes of that file.

      off _ t lseek ( int handle , off _ t offset , int whence )

    This operation moves the read/write pointer in the file. The offset parameter specifies the number of bytes by which to offset the pointer, and the whence parameter specifies where to start the offset from. It is assumed that the offset can be counted from the beginning of the file (SEEK_SET), from its end (SEEK_END), and from current pointer position (SEEK_CUR). The operation returns the pointer position measured from the beginning of the file. Thus, calling lseek(handle, 0, SEEK_CUR) will return the current position of the pointer without moving it.

      int read(int handle, char * where, size_t how_much)

    Read operation from a file. The where pointer specifies the buffer where the read data should be placed; the third parameter specifies how much data to read. The system reads the required number of bytes from the file, starting at the read/write pointer to that file, and moves the pointer to the end of the read sequence. If the file ends early, as much data is read as was left until its end. The operation returns the number of bytes read. If the file was opened for writing only, calling read will return an error.

      int write(int handle, char * what, size_t how_much)

    A write operation to a file. The what pointer specifies the beginning of the data buffer; the third parameter specifies how much data to write. The system writes the required number of bytes to the file, starting at the read/write pointer to that file, replacing the data stored at that location, and moving the pointer to the end of the written block. If the file ends earlier, its length increases. The operation returns the number of bytes written.

    If the file was opened read-only, calling write will return an error.

      int ioctl(int handle, int cmd, ...) ; int fcntl ( int handle , int cmd , ...)

    Additional operations on the file. Initially, it seems that ioctl was intended to be operations on the file itself, and fcntl was intended to be operations on an open file handle, but then historical developments have somewhat mixed up the functions of these system calls. Standard POSIX defines some operations both on the handle, for example duplication (as a result of this operation we get two handles associated with the same file), and on the file itself, for example, the truncate operation - trim the file to a given length. In most versions Unix The truncate operation can also be used to cut data from the middle of a file. When reading data from such a cut area, zeros are read, and this area itself does not take up physical space on the disk.

    An important operation is to block sections of the file.Standard POSIX offers a library function for this purpose, but in systems of the family Unix This function is implemented through the fcntl call.

    Most implementations of the standard POSIX offers its own additional operations. So, in Unix SVR4 With these operations you can set synchronous or delayed recording, etc.

      caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int handle, off_t offset)

    Mapping a section of a file into the virtual address space of the process. The prot parameter specifies access rights to the mapped section: read, write, and execute. The mapping can occur to a specified virtual address, or the system can select the address to map itself.

    Two more operations are performed not on the file, but on its name: these are the operations of renaming and deleting the file. In some systems, for example in systems of the family Unix, a file can have multiple names, and there is only a system call to delete a name. The file is deleted when the last name is deleted.

    It can be seen that the set of operations on a file in this standard is very similar to the set of operations on an external device. Both are considered as an unstructured byte stream. To complete the picture, it should be said that the main means of interprocess communication in systems of the family Unix (pipe) is also an unstructured data stream. The idea that most data transfers can be reduced to a byte stream is quite old, but Unix was one of the first systems where this idea was brought to its logical conclusion.

    Approximately the same model of working with files is adopted in C.P./ M, and a set of file system calls MS DOS actually copied from calls Unix v7 . In turn, OS/2 And Windows NT inherited the principles of working with files directly from MS DOS.

    On the contrary, in systems without Unix in a pedigree, a slightly different interpretation of the concept of a file may be used. Most often, a file is treated as a set of records. Typically, the system supports both constant-length and variable-length records. For example, a text file is interpreted as a file with variable length records, and each line of text corresponds to one record. This is the model for working with files in VMS and in OS line OS/360 -MVS IBM company.

    The file system allows you to organize programs and data and organize orderly management of these objects.

    For operating systems personal computers The concept of the file system underlying the Unix OS left a deep imprint. In Unix OS, the I/O subsystem unifies the way to access both files and peripheral devices. A file is understood as a set of data on a disk, terminal or some other device.

    File system is a functional part of the operating system that performs operations on files. The file system allows you to work with files and directories (directories) regardless of their contents, size, type, etc.

    File system is a data management system.

    A data management system is a system in which users are freed from most physical file manipulation and can focus primarily on the logical properties of the data.

    File systems OS creates for users some virtual representation of external storage devices, allowing them to work with not at a low level of control commands physical devices, and on high level sets and data structures.

    File system (purpose):

    • hides the picture of the real location of information in external memory;
    • ensures the independence of programs from the specific configuration of the computer (logical level of working with files);
    • provides standard responses to errors that occur during data exchange.

    File structure

    The entire collection of files on the disk and the relationships between them is called the file structure. Developed operating systems have a hierarchical - multi-level file structure, organized in the form of a tree.

    A tree directory structure is used − directory tree. Borrowed from Unix. Hierarchical structure – the structure of a system, the parts (components) of which are connected by relations of inclusion or subordination.

    The hierarchical structure is represented by an oriented tree, in which the vertices correspond to components, and the arcs correspond to connections.

    G drive directory tree

    A directed tree is a graph with a selected vertex (root), in which there is a unique path between the root and any vertex. In this case, two orientation options are possible: either all paths are oriented from the root to the leaves, or all paths are oriented from the leaves to the root.

    Trees are used to describe and design hierarchical structures.

    The root is the starting position, the leaves are the final position.

    Sections

    During the formatting process, any hard or magneto-optical disk can be divided into several parts and treated as separate (independent) disks. These parts are called sections or logical drives. Splitting the disk into several logical drives may be necessary because the OS cannot handle disks larger than a certain size. It is very convenient to store data and user programs separately from system programs (OS), because the OS can “fly off the computer.”

    Chapter– disk area. Under logical disk (partition) In computer we mean any storage medium with which the operating system works as a single whole object.

    Drive name– designation of the logical drive; entry in the root directory.

    Logical drives (partitions) are designated in Latin letters A, B, C, D, E, ... (32 letters from A to Z).

    The letters A, B are reserved for floppies.

    WITH - hard drive, usually from which the OS is loaded.

    The remaining letters are logical drives, CDs, etc. The maximum number of logical drives for Windows OS is infinite.

    IN partition table indicates the location of the beginning and end of this section and the number of sectors in this section (location and size).

    File structure of a logical drive

    To access information on the disk contained in a file, you need to know the physical address of the first sector (surface number + track number + sector number), the total number of clusters occupied by this file, the address of the next cluster if the file size is larger than the size of one cluster

    Elements file structure:

      starting sector (bootstrap, Boot sector);

      table placementfiles (FAT – File Allocation Table);

      root directory (Root Directory);

      data area (remaining free disk space).

    Boot-sector

    Boot-sector – the first (initial) sector of the disk. Located on the 0-side, 0-track.

    The boot sector contains service information:

      disk cluster size (cluster is a block that combines several sectors into a group to reduce the size of the FAT table);

      location of the FAT table (in the boot sector there is a pointer to where the FAT table is located);

      FAT table size;

      number of FAT tables (there are always at least 2 copies of the table to ensure reliability and security, since destruction of FAT leads to loss of information and is difficult to recover);

      the address of the beginning of the root directory and its maximum size.

    The boot sector contains the boot block (bootloader) - boot record Boot Record.

    The loader is a utility program that places the executable program in RAM and brings it into a state of readiness for execution.

    FAT (File Allocation Table)

    FAT (File Allocation Table) – file allocation table. It defines which areas of the disk belong to each file. The data area of ​​the disk is represented in the OS as a sequence of numbered clusters.

    FAT is an array of elements addressing clusters of the disk data area. Each data area cluster corresponds to one FAT element. FAT elements serve as a chain of references to file clusters in the data area.

    File allocation table structure:

    FAT consists of 16/32/64 bit elements. In total, the table can contain up to 65520 such elements, each of them (except the first two) corresponds to a disk cluster. A cluster is a unit that allocates space in a data area on a disk for files and directories. The first two table elements (numbered 0 and 1) are reserved, and each of the remaining table elements describes the state of the disk cluster with the same number. The element may indicate that the cluster is free, that the cluster is defective, that the cluster belongs to the file and is the last cluster in the file. If a cluster belongs to a file and is not its last cluster, then the table element contains the number of the next cluster in this file.

    FAT– an extremely important element of the file structure. Violations in FAT can lead to complete or partial loss of information on the entire logical drive. That is why two copies of FAT are stored on the disk. There are special programs, which monitor the status of FAT and correct violations.

    Required for different OS different versions FAT

    Windows 95 FAT 16, FAT 32

    Windows NT (XP) NTFS

    Novell Netware TurboFAT

    UNIX NFS,ReiserFS

    Logical structure of the storage medium

    A file system is a way of organizing data storage on storage media. The file system also determines the length of file names, the maximum file and partition size, and file attributes. In this article we will talk about what file systems are.

    Tasks that the file system must solve:

    • file naming.
    • software interface for running user programs.
    • Protecting data from power failures and hardware and software errors.
    • storing file parameters.

    Modern file systems can be divided into several groups, according to their purpose:

    • File systems for random access storage media (for flash drives): FAT32, HPFS, ext2 and many others.
    • File systems for sequential access media (magnetic tape): QIC, etc.
    • File systems for optical disks: ISO9660, HFS, UDF, etc.
    • Virtual file systems: AEFS, etc.
    • Network file systems: NFS, SSHFS, CIFS, GmailFS, etc.
    • File systems designed exclusively for: YAFFS, exFAT, ExtremeFFS.

    Popular file systems:

    FAT is a file system developed by Bill Gates and Mark McDonald in the 70s of the last century. Due to its simplicity, it is still used in flash drives. There are three versions of the FAT file system: FAT12, FAT16 and FAT32. These versions of the FAT file system differ in the bit depth of the records (the number of bits that are allocated for storing the cluster number). That is, the larger the bit depth, the larger the disk space with which the FAT file system can work. So, for FAT32 the maximum disk size is 127 gigabytes.

    NTFS– a new generation file system from Microsoft. This file system is used for all operating systems Microsoft systems Windows NT. NTFS was first released in 1993, along with the Windows NT 3.1 operating system. Compared to FAT, the NTFS file system has received a large number of improvements. Thus, the limitation on the maximum file and disk size has practically disappeared. In addition, there is support for hard links, encryption and compression.

    ext– a file system developed specifically for operating systems based on the Linux kernel. The development was first presented in 1992. Now there are several versions of this file system: ext, ext2, ext3, ext3cow and ext4. File system ext4 on at the moment is the newest and current version ext, this is the version used by most modern Linux distributions.

    Files on a computer are created and placed based on system principles. Thanks to their implementation, the user gets the opportunity to comfortably access necessary information, without thinking about complex algorithms for accessing it. How are file systems organized? Which ones are the most popular today? What are the differences between PC-friendly file systems? And those used in mobile devices - smartphones or tablets?

    File Systems: Definition

    According to a common definition, a file system is a set of algorithms and standards used to organize effective access for a PC user to data located on the computer. Some experts consider it part of Other IT experts, recognizing the fact that it is directly related to the OS, believe that the file system is an independent component of computer data management.

    How were computers used before the file system was invented? Computer science, as a scientific discipline, has recorded the fact that for a long time data management was carried out through structuring within the framework of algorithms embedded in specific programs. Thus, one of the criteria for a file system is to have standards that are the same for most programs that access data.

    How file systems work

    The file system is, first of all, a mechanism that involves the use of computer hardware resources. As a rule, we are talking about magnetic or laser media - hard drives, CDs, DVDs, flash drives, floppy disks that have not yet become obsolete. In order to understand how the corresponding system works, let’s define what the file itself is.

    According to the generally accepted definition among IT experts, this is a data area of ​​a fixed size, expressed in basic units of information - bytes. The file is located on disk media, usually in the form of several interconnected blocks that have a specific access “address”. The file system determines these same coordinates and “reports” them, in turn, to the OS. Which clearly transmits the relevant data to the user. Data is accessed in order to read it, modify it, or create new one. The specific algorithm for working with file “coordinates” may vary. It depends on the type of computer, OS, specifics of the stored data and other conditions. Because there is various types file systems. Each of them is optimized for use on a specific OS or for working with certain types of data.

    Adaptation disk media to be used through the algorithms of a particular file system is called formatting. The corresponding hardware elements of the disk - clusters - are prepared for subsequent writing of files to them, as well as reading them in accordance with the standards laid down in a particular data management system. How to change the file system? In most cases, this can only be done by reformatting the storage medium. As a rule, the files are erased. However, there is an option in which, using special programs, it is still possible, although this usually requires a lot of time, to change the data management system, leaving the latter untouched.

    File systems do not work without errors. There may be some failures in the organization of work with data blocks. But in most cases they are not critical. As a rule, there are no problems with how to fix the file system or eliminate errors. In Windows OS, in particular, there are built-in software solutions, accessible to any user. Such as, for example, the Check Disk program.

    Varieties

    What types of file systems are the most common? Probably, first of all, those used by the most popular PC OS in the world - Windows. The main Windows file systems are FAT, FAT32, NTFS and their various modifications. Along with computers, smartphones and tablets have gained popularity. Most of them, if we talk about the global market and do not consider differences in technology platforms, are controlled by Android and iOS OS. These operating systems use their own algorithms for working with data that are different from those that characterize Windows file systems.

    Standards open to all

    Note that in lately in the global electronics market there is some unification of standards in terms of operating OS with various types data. This can be seen in two aspects. Firstly, on different devices Two dissimilar types of OS often use the same file system, which is equally compatible with each OS. Secondly, modern versions Operating systems, as a rule, are able to recognize not only their typical file systems, but also those that are traditionally used in other operating systems - both through built-in algorithms and using third-party software. For example, modern Linux versions, as a rule, recognize marked file systems for Windows without problems.

    File system structure

    Despite the fact that the types of file systems are presented in quite a few large quantities, they generally work according to very similar principles (we outlined the general scheme above) and within the framework of similar structural elements or objects. Let's look at them. What are the main objects of a file system?

    One of the key ones is - It is an isolated data area in which files can be placed. The directory structure is hierarchical. What does it mean? One or more directories may reside within another. Which, in turn, is part of the “superior” one. The most important thing is the root directory. If we talk about the principles on which the Windows file system works - 7, 8, XP or another version - the root directory is a logical drive, designated by a letter - usually C, D, E (but you can configure any that is in English alphabet). As for, for example, the Linux OS, the root directory there is the magnetic medium as a whole. This operating system and other operating systems based on its principles - such as Android - do not use logical disks. Is it possible to store files without directories? Yes. But this is not very convenient. Actually, comfort in using a PC is one of the reasons for introducing the principle of distributing data into directories in file systems. By the way, they can be called differently. IN Windows directories are called folders, in Linux - basically the same. But the traditional name for directories in this OS, used for many years, is “directories”. As in previous Windows and Linux OS - DOS, Unix.

    Among IT specialists, there is no clear opinion as to whether a file should be considered a structural element of the corresponding system. Those who believe that this is not entirely correct argue their point of view by saying that the system can easily exist without files. Even if this is a useless phenomenon from a practical point of view. Even if no files are written to the disk, the corresponding system may still be present. Typically, magnetic media sold in stores does not contain any files. But they already have a corresponding system. Another view is that files should be considered an integral part of the systems they are managed by. Why? But because, according to experts, the algorithms for using them are adapted primarily to work with files within the framework of certain standards. The systems in question are not intended for anything else.

    Another element present in most file systems is a data area containing information about the placement of a specific file in a specific location. That is, you can place a shortcut in one place on the disk, but it is also possible to provide access to the desired data area, which is located in another part of the media. You can consider that shortcuts are full-fledged objects of the file system if you agree that files are also such.

    One way or another, it will not be a mistake to say that all three types of data - files, shortcuts and directories - are elements of their respective systems. At least this thesis will correspond to one of the common points of view. The most important aspect that characterizes how a file system works is the principles of naming files and directories.

    File and directory names on different systems

    If we agree that files are still components of the systems corresponding to them, then it is worth considering them basic structure. What is the first thing to note? For the convenience of organizing access to them in most modern systems data management provides a two-level file naming structure. The first level is the name. The second is expansion. Let's take for example music file Dance.mp3. Dance is the name. Mp3 - extension. The first is intended to reveal to the user the essence of the contents of the file (and for the program to be a guide for quick access). The second indicates the file type. If it is Mp3, then it is easy to guess that we are talking about music. Files with the extension Doc are, as a rule, documents, Jpg are pictures, Html are web pages.

    Directories, in turn, have a single-level structure. They only have a name, no extension. If we talk about the differences between different types data management systems, then the first thing you should pay attention to is precisely the principles of naming files and directories implemented in them. Regarding Windows OS, the specifics are as follows. In the world's most popular operating system, files can be named in any language. Maximum length, however, it is limited. The exact interval depends on the data management system used. Typically these values ​​range from 200-260 characters.

    A general rule for all operating systems and their corresponding data management systems is that files with the same names cannot be located in the same directory. In Linux, there is a certain “liberalization” of this rule. There may be files in the same directory with the same letters, but in different case. For example, Dance.mp3 and DANCE.mp3. This is not possible on Windows OS. The same rules are also established in terms of placing directories within others.

    Addressing files and directories

    Addressing files and directories - essential element corresponding system. On Windows, its custom format might look like this: C:/Documents/Music/ - this is access to the Music directory. If we are interested in a specific file, then the address may look like this: C:/Documents/Music/Dance.mp3. Why "custom"? The fact is that at the level of hardware and software interaction between computer components, the structure of file access is much more complex. The file system determines the location of file blocks and interacts with the OS in largely hidden operations. However, it is extremely rare for a PC user to need to use other “address” formats. Almost always, files are accessed in the specified standard.

    Comparison of file systems for Windows

    We have studied general principles functioning of file systems. Let us now consider the features of their most common types. The most commonly used file systems in Windows are FAT, FAT32, NTFS, and exFAT. The first in this series is considered obsolete. At the same time, for a long time it was a kind of flagship of the industry, but as PC technology grew, its capabilities no longer met the needs of users and the resource needs of software.

    Designed to replace FAT file the system is FAT32. According to many IT experts, it is now the most popular if we talk about the PC market for Windows control. It is most often used when storing files on hard drives and flash drives. It can also be noted that this data management system is quite regularly used in memory modules of various digital devices- phones, cameras. The main advantage of FAT32, which IT experts highlight, is therefore its versatility. Despite the fact that this file system was created by Microsoft, most modern operating systems, including those installed on the specified types of digital equipment, can work with data within the framework of the algorithms embedded in it.

    The FAT32 system also has a number of disadvantages. First of all, we can note the limitation on the size of one taken file - it cannot be more than 4 GB. Also, the FAT32 system cannot have built-in using Windows specify a logical disk whose size would be greater than 32 GB. But this can be done by installing additional specialized software.

    Other popular system The file management system developed by Microsoft is NTFS. According to some IT experts, it is superior to FAT32 in most parameters. But this thesis is true if we are talking about a computer running Windows. NTFS is not as versatile as FAT32. The peculiarities of its functioning make the use of this file system not always comfortable, in particular on mobile devices. One of key advantages NFTS - reliability. For example, in cases where hard drive If the power suddenly turns off, the likelihood that files will be damaged is minimized thanks to the data access duplication algorithms provided in NTFS.

    One of the newest file systems from Microsoft is exFAT. It is best adapted for flash drives. Basic principles The work in it is the same as in FAT32, but there is also a significant modernization in some aspects: for example, there are no restrictions on the size of a single file. At the same time, the exFAT system, as many IT experts note, is among those that have low versatility. On non-Windows computers, file handling may be difficult when using exFAT. Moreover, even in some versions of Windows itself, such as XP, data on disks formatted using exFAT algorithms may not be readable. You will need to install an additional driver.

    Note that due to the use of a fairly wide range of file systems in Windows OS, the user may experience periodic difficulties in terms of compatibility various devices with a computer. In some cases, for example, it is necessary to install the WPD (Windows Portable Devices - technology used when working with portable devices) file system driver. Sometimes the user may not have it at hand, resulting in external media The OS may not recognize it. File WPD system may require additional software adaptation to the operating environment on a specific computer. In some cases, the user will be forced to contact IT specialists to solve the problem.

    How to determine which file system - exFAT or NTFS, or maybe FAT32 - is optimal for use in specific cases? The recommendations of IT specialists in general are as follows. Two main approaches can be used. According to the first, one should distinguish between typical hard drive file systems, as well as those that are better adapted to flash drives. FAT and FAT32, according to many experts, are better suited for flash drives, NTFS - for hard drives (due to the technological features of working with data).

    In the second approach, the size of the carrier matters. If we are talking about using a relatively small volume of a disk or flash drive, you can format it in the FAT32 system. If the disk is larger, you can try exFAT. But only if the media is not intended to be used on other computers, especially those that are not equipped with the most latest versions Windows. If we are talking about large hard drives, including external ones, then it is advisable to format them in NTFS. These are approximately the criteria by which the optimal file system can be selected - exFAT or NTFS, FAT32. That is, you should use any of them, taking into account the size of the media, its type, as well as the version of the OS on which the drive is primarily used.

    File systems for Mac

    Another popular software and hardware platform in the global market computer equipment- Macintosh from Apple. PCs in this line run the Mac OS operating system. What are the features of organizing work with files in Mac computers? Apple's most modern PCs use a file-based Mac system OS Extended. Previously in Computers Mac work data was managed in accordance with HFS standards.

    The main thing that can be noted in terms of its characteristics is that a disk managed by the Mac OS Extended file system can accommodate very large files - we can talk about several million terabytes.

    File system in Android devices

    The most popular OS for mobile devices - a form of electronic technology that is not inferior in popularity to PCs - is Android. How are files managed on devices of the corresponding type? Let us note first of all that this operating system is actually a “mobile” adaptation of the Linux OS, which, thanks to the open source program code, can be modified for use on a wide range of devices. Therefore, file management in mobile devices under Android control carried out generally according to the same principles as in Linux. We noted some of them above. In particular, file management in Linux is carried out without dividing the media into logical drives, as happens in Windows. What else interesting does the file contain? Android system?

    The root directory in Android is usually a data area called /mnt. Accordingly, the address the desired file might look something like this: /mnt/sd/photo.jpg. In addition, there is another feature of the data management system that is implemented in this mobile OS. The fact is that the flash memory of a device is usually classified into several sections, such as, for example, System or Data. At the same time, initially given size Each of them cannot be changed. An approximate analogy regarding this technological aspect can be found by remembering that it is impossible (unless you use special software) to change the size of logical drives in Windows. It must be fixed.

    One more interesting feature organizing work with files in Android - the corresponding operating system, as a rule, writes new data to a specific area of ​​the disk - Data. Work, for example, with the System section is not carried out. Therefore, when the user uses the function of resetting the software settings of a smartphone or tablet to the “factory” level, in practice this means that those files written to the Data area are simply erased. The System section, as a rule, remains unchanged. Moreover, the user, without having specialized software, cannot make any adjustments to the contents in the System. The procedure associated with updating the system storage area in an Android device is called flashing. This is not formatting, although both operations are often performed simultaneously. As a rule, flashing is used for the purpose of installation on mobile device more new version Android OS.

    Thus, the key principles on which the Android file system operates are the absence of logical drives, as well as strict differentiation of access to system and user data. It cannot be said that this approach is fundamentally different from that implemented in Windows, however, according to many IT experts, in Microsoft's OS users have somewhat greater freedom in working with files. However, as some experts believe, this cannot be considered a clear advantage of Windows. The “liberal” mode in terms of file management is used, of course, not only by users, but also computer viruses, to which Windows is very susceptible (unlike Linux and its "mobile" implementation in Android form). This, according to experts, is one of the reasons that there are so few viruses for Android devices - from a purely technological point of view, they cannot fully function in an operating environment that operates on the principles of strict file access control.