Back forward

Attention! Slide previews are for informational purposes only and may not represent all the features of the presentation. If you are interested this work, please download the full version.

Lesson objectives:

  • help students gain an understanding of files and file systems, file names, file paths, and give the basic concepts necessary to work on a computer.
  • nurturing students’ information culture, attentiveness, accuracy, discipline, perseverance.
  • development of cognitive interests, skills in working with a mouse and keyboard, self-control, and note-taking skills.

Equipment: board, computer, computer presentation.

Lesson plan:

  1. Org. moment. (1 min.)
  2. Testing and updating knowledge. (2 minutes.)
  3. Theoretical part. (13 min.)
  4. Practical part. (15 minutes.)
  5. D/z (2 min.)
  6. Questions from students. (5 minutes.)
  7. Lesson summary. (2 minutes.)

During the classes

I. Org. moment.

II. Greetings, checking those present.

Explanation of the lesson.

Updating knowledge.

Let's return again to the issue of files. You already know what is in the files on devices external memory All computer software and all data are stored. Any user who works on a computer has to deal with files.

Working with files on a computer is done using the file system, which is part of the operating system.

In this lesson we will look at what files and file systems are.

III. Theoretical part.

All programs and data are stored in the long-term (external) memory of the computer in the form of files.

File- This a certain amount of information (program or data) that has a name and is stored in long-term (external) memory.

The file name consists of two parts, separated by a dot: the actual file name and the extension that determines its type (program, data, etc.). The actual name of the file is given by the user, and the file type is usually set automatically by the program when it is created.

There are different operating systems various formats file names. In the MS-DOS operating system, the file name itself must contain no more than eight letters of the Latin alphabet and numbers, and the extension consists of three Latin letters, for example: proba.txt

In the Windows operating system, the file name can have up to 255 characters, and the Russian alphabet can be used, for example:

Units of information.doc

Before the introduction of the Windows 95 operating system, most IBM PC computers ran operating system MS-DOS, which had very strict rules for naming files. These rules are called convention 8.3

By convention 8.3, a file name can consist of two parts separated by a dot. The first part can be up to 8 characters long, and the second part (after the period) can be up to 3 characters long. The second part after the dot is called the name extension.

When writing a file name, you are allowed to use only English letters and numbers. The name must begin with a letter. Spaces and punctuation are not allowed, except exclamation point(!), tilde (~) and underscore (_).

After the introduction of the Windows 95 operating system, file naming requirements became significantly more relaxed. They are also valid in all subsequent versions of Windows operating systems.

  1. Up to 255 characters are allowed.
  2. It is allowed to use symbols of national alphabets, in particular Russian.
  3. Spaces and other previously prohibited characters are permitted, with the exception of the following nine: /\:*?"<>|.
  4. You can use multiple periods in the file name. The name extension is all characters after the last dot.

The role of the file name extension is purely informational, not command-oriented. If you assign the file extension TXT to a file with a picture, then the contents of the file will not turn into text. It can be viewed in a program designed for working with texts, but such viewing will not give anything intelligible.

File system. Each storage medium (floppy, hard or laser disk) can store a large number of files. The order in which files are stored on the disk is determined by the installed file system.

File system is a file storage and directory organization system.

For disks with a small number of files (up to several dozen), it is convenient to use a single-level file system, when the directory (disk table of contents) is a linear sequence of file names. To find a file on disk, you just need to specify the file name.

If hundreds and thousands of files are stored on a disk, then for ease of searching, the files are organized into a multi-level hierarchical file system, which has a “tree” structure (looks like an inverted tree).

The initial, root, directory contains subdirectories of the 1st level, in turn, in each of them there are subdirectories of the 2nd level, etc. It should be noted that files can be stored in directories of all levels.

To facilitate understanding of this issue, we will use an analogy with the traditional “paper” method of storing information. In this analogy, a file is represented as some titled document (text, drawing, etc.) on paper sheets. The next largest element of the file structure is called a directory. Continuing the “paper” analogy, we will think of the catalog as a folder into which you can put a lot of documents, i.e. files. The directory also gets its own name (think of it on the cover of a folder).

The directory itself can be part of another directory external to it. This is similar to nesting a folder inside another larger folder. Thus, each directory can contain many files and subdirectories (called subdirectories). Catalog itself top level, which is not nested within any others, is called the root directory.

Now imagine the complete picture of the file structure like this: the entire external memory of the computer is a cabinet with many drawers. Each box is an analogue of a disk; in the box there is a large folder (root directory); this folder contains many folders and documents (subdirectories and files), etc. The deepest nested folders contain only documents (files) or may be empty.

The path to the file. In order to find a file in a hierarchical file structure, you must specify the path to the file. The path to the file includes the logical name of the disk, written through the separator “\”, and a sequence of names of nested directories, the last of which contains the desired file.

For example, the path to the files in the figure can be written like this:

C:\Abstracts\

C:\Abstracts\Physics\

C:\Abstracts\Informatics\

C:\Drawings\

Full file name.

The path to the file along with the file name is called the fully qualified file name.

Example of full file names:

C:\Abstracts\Physics\Optical phenomena.doc

C:\Abstracts\Informatics\Internet.doc

C:\Abstracts\Informatics\Computer viruses.doc

C:\Drawings\Sunset.jpg

C:\Drawings\ Winter.jpg

In the Windows operating system, the concept of “folder” is used instead of directories. Folder is a Windows object designed to group files and other folders into groups. The concept of a folder is broader than the concept of a “directory”.

In Windows, at the top of the folder hierarchy is the Desktop folder. (The next level is represented by the My Computer, Recycle Bin and Network Neighborhood folders (if the computer is connected to a local network).

If we want to get acquainted with the computer's resources, we need to open the folder My computer.

You can perform a number of standard actions with files and folders.

Such actions with files as “create”, “save”, “close” can only be performed in application programs (“Notepad”, “Paint”, ...).

The actions “open”, “rename”, “move”, “copy”, “delete” can be performed in the system environment.

  • Copying (a copy of the file is placed in another directory);
  • Move (the file itself is moved to another directory);
  • Delete (the file entry is deleted from the directory);
  • Renaming (file name changes).

Graphic Windows interface allows you to perform operations on files using the mouse using the Drag&Drop method (drag and drop). There are also specialized applications for working with files, so-called file managers.

Questions and tasks:

1. Write down the full names of all files

C:\My Documents\Ivanov\QBasic.doc

C:\My documents\Petrov\Letter.txt

C:\My documents\Petrov\Drawings\Sea.bmp

C:\Movies\Interesting film.avi

2. Build a directory tree

C:\Drawings\Nature\Sky.bmp

C:\Drawings\Nature\Snow.bmp

C:\Pictures\Computer\Monitor.bmp

C:\My Documents\Report.doc

IV. Practical part.

Today in the practical part we will work with files. Let's learn how to open, copy, move, rename and delete them. For work we will use the My Computer window.

The My Computer window is used to view the contents of your computer, devices connected to it, storage devices with removable media, and to perform various operations with folders and files stored on its disks. Links to tasks in the left pane of this folder window allow you to view information about your computer, change system parameters on the control panel and perform other system management procedures.

To open the My Computer window, click the Start button and select My Computer in the right menu column. You can also use the icon on your desktop.

In the My Computer window, you can display toolbars: Regular buttons, Address bar, Links by selecting the commands of the same name in the View menu, Toolbars.

Toolbar Regular buttons

Toolbar Buttons Regular buttons allow you to perform frequently used commands without opening a menu, which reduces the time it takes to complete an operation.

Toolbar Buttons Regular buttons have the following purposes:

  • Back, Forward - Move to a previously viewed folder, document, web page, or next item in the order in which the user viewed them in the current session. From the keyboard, the Back button is duplicated by the +[left arrow] keys, the Forward button is duplicated by the +[right arrow] keys. To the right of the Back and Forward buttons there are arrows, clicking on which will open a list of previously viewed folders;
  • Up - provides navigation to the parent (encompassing) folder containing this object. This button is sometimes called the back button. It is duplicated by the Backspace key;
  • Search - displays the Search browser panel on the left side of the window, using which you can find the material of interest on your computer, on the network or on the Internet;
  • Folders - displays the Folders browser panel on the left side of the window, making it easier to navigate through folders and files;
  • View - provides quick access to commands that duplicate the View menu commands. They allow you to display the contents of folders in different modes:

Filmstrip - used to view folders with images. The images are arranged in a row in the form of miniature frames. You can scroll through them using the left and right arrow buttons. When you click on an image, a larger view of it appears on top of the other images. If you want to change the image, print it, or save it in a different folder, double-click it.

Page thumbnails - displays miniature images (thumbnails) of the contents of graphic and video files, web pages (HTML files) in the window. In this mode, the icon for the My Pictures folder and its subfolders displays thumbnail images of the four most recently modified files in that folder. After clicking the picture right click mouse and selecting the View command launches the Image and Fax Viewer, which allows you to enlarge, reduce, rotate and print the image. The information is cached in the Thumbs.db file, which eliminates the need to wait for the content to be rendered when viewing the folder again.

Tile - Displays files and folders as icons next to each other, like tiles forming a path. Under the file or folder name, data corresponding to the selected sorting method is provided;

Icons - object icons are visible in the folder window; under them are the names of folders and files;

List - objects in the folder window are sorted by their names in alphabetical order. The folder names are displayed first, then the file names. Object icons are arranged in one or more columns next to their names;

Table - displays a list of objects stored in the folder in table form. The table columns provide basic information about folders and files: Name, Size, Type, Modified. To sort table data alphabetically, click on the column header. To sort in reverse order repeat the operation;

In the My Computer window, open the folder C:\Our Lesson\Photos\. This folder contains several subfolders with photos. View their contents... Try changing the way folders and files are displayed. Select one of the files and by calling the context menu (right mouse button) view its properties (type, size, creation date, attributes...). Review the properties of the C: drive yourself.

Now find the file named C:\WINDOWS\NOTEPAD.EXE and open it. That's right, this is the Notepad program, the shortcut to which is on the desktop.

Now let's try to copy files from one folder to another.

To perform any operation with a file, folder or group of files, they must be selected. Selecting a single file or folder is done with a single mouse click. In this case, the selected object is highlighted in a dark color. Now you can do whatever you want with the selected file - “drag” it to another folder using the mouse pointer or call up its context menu (by right-clicking).

However, there are times when we need to work not with one file or folder, but with several at once! This means that we will have to select several icons at once. To select a group of files, you must first select one of them, and then, pressing and holding the key down, continue selecting the remaining files. Clicking the selected file again will deselect it. When the group is highlighted, the key can be released. To select several files one after another, you need to click on the first file in the group, and then, while holding down the key, on the last one. All files between them will become selected. You can also select files by drawing a rectangular frame around them using the mouse. This is especially useful if you don't use icon ordering.

Finally, you can select all the files in a folder by simultaneously pressing the and A (Latin) keys, or using the Edit/Select menu.

Open the folder with photos and move the window to the side (also reduce its size) so that it does not bother us. Open another My Computer window. In this window, open your folder, create in it new folder Photos.

Copy

Copy files from folder to folders (or, for example, from hard drive to a floppy disk) in several ways:

  • Call the File Context Menu and select Copy. Now go to the folder or drive where you want to place a copy of your file, call the Context Menu again and select Paste;
  • The same operation can be done using the Copy and Paste buttons on the Toolbar of the My Computer window.
  • Finally, you can simply drag the file with the mouse into a new folder while holding down a key on the keyboard (or drag with the right mouse button and select the copy command from the menu that appears).

Copy a few photos you like.

In a similar way, you can move files from one folder to another. You just need to cut the files rather than copy them; just drag with the left mouse button (if both folders are on the same disk); drag with the right mouse button and select the move command from the menu that appears.

To rename a file or folder, you can select the Rename item from the Context Menu or simply press the F2 key on your keyboard. Please note - if your Explorer (My Computer) can show not only the file name, but also its extension, be especially careful when renaming. If the file name can be changed, then its extension must remain intact.

Rename the files you copied.

To delete unnecessary files, you can use one of several methods:

  • Call the Context Menu of the file and select Delete;
  • Give the command File→Delete;
  • Press the button on the keyboard;
  • Drag a file or folder to the Trash.

And finally, complete the same task, only the source folder will be located on another computer, for example on a server. To do this, open the Network Neighborhood window, select the “Show workgroup computers” command on the left, find Server and go to the open public access photo folder on the server.

V. D/z.

Know what a file is file system, be able to find and open files, be able to copy and rename files. Students who have computers at home should continue to master the “ten-finger touch typing method.”

Additional task: find out how you can create additional panel with shortcuts to programs you frequently use.

VI. Questions from students.

Answers to student questions.

VII. Lesson summary.

Summing up the lesson. Grading.

During the lesson, we became acquainted with the concepts of file and file system, and learned how to perform basic operations with files and folders.

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, the I/O subsystem unifies the way both files and peripheral devices are accessed. 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 content, 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.

OS file systems create for users some virtual representation of external storage devices, allowing them to work not at a low level of physical device control commands, but at 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. Partitioning a disk into several logical drives may be necessary because the operating system cannot handle disks larger than a certain size. 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 a 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 by Latin letters A, B, C, D, E, ... (32 letters from A to Z).

The letters A, B are reserved for floppies.

C is the hard drive from which the OS is usually 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

File structure elements:

    starting sector (initial boot, 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. Exist 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

Material for review lecture No. 33

for specialty students

"Information Technology Software"

Associate Professor of the Department of Computer Science, Ph.D. Livak E.N.

FILE MANAGEMENT SYSTEMS

Basic concepts, facts

Purpose. Features of file systemsFATVFATFAT 32,HPFSNTFS. File systems UNIX OS (s5, ufs), Linux OS Ext2FS. System areas of the disk (partition, volume). Principles of file placement and storage of file location information. Organization of catalogs. Restricting access to files and directories.

Skills

Using knowledge of the file system structure to protect and restore computer information (files and directories). Organization of access control to files.

File systems. File system structure

Data on disk is stored in the form of files. A file is a named part of a disk.

File management systems are designed to manage files.

The ability to deal with data stored in files at the logical level is provided by the file system. It is the file system that determines the way data is organized on any storage medium.

Thus, file system is a set of specifications and their corresponding software that are responsible for creating, destroying, organizing, reading, writing, modifying and moving file information, as well as for controlling access to files and managing the resources that are used by files.

The file management system is the main subsystem in the vast majority of modern operating systems.

Using a file management system

· all system processing programs are connected using data;

· problems of centralized distribution of disk space and data management are solved;

· the user is provided with opportunities to perform operations on files (creation, etc.), exchange data between files and various devices, and protect files from unauthorized access.

Some operating systems may have multiple file management systems, giving them the ability to handle multiple file systems.

Let's try to distinguish between a file system and a file management system.

The term "file system" defines the principles of access to data organized in files.

Term "file management system" refers to a specific implementation of the file system, i.e. This is a set of software modules that provide work with files in a specific OS.

So, to work with files organized in accordance with some file system, an appropriate file management system must be developed for each OS. This UV system will only work on the OS for which it is designed.

For the Windows OS family, the file systems mainly used are: VFAT, FAT 32, NTFS.

Let's look at the structure of these file systems.

On the file system FAT The disk space of any logical drive is divided into two areas:

system area and

· data area.

System area created and initialized during formatting, and subsequently updated when the file structure is manipulated.

The system area consists of the following components:

· boot sector containing the boot record (boot record);

· reserved sectors (they may not exist);

· file allocation tables (FAT, File Allocation Table);

· root directory (ROOT).

These components are located on the disk one after another.

Data area contains files and directories subordinate to the root one.

The data area is divided into so-called clusters. A cluster is one or more adjacent sectors of a data area. On the other hand, a cluster is the minimum addressable unit disk memory allocated to the file. Those. a file or directory occupies an integer number of clusters. To create and write a new file to disk, the operating system allocates several free disk clusters for it. These clusters do not have to follow each other. For each file, a list of all cluster numbers that are assigned to that file is stored.

Dividing the data area into clusters instead of using sectors allows you to:

· reduce the size of the FAT table;

· reduce file fragmentation;

· the length of file chains is reduced Þ speeds up file access.

However, too large a cluster size leads to inefficient use of the data area, especially in the case of a large number of small files (after all, on average half a cluster is lost for each file).

In modern file systems (FAT 32, HPFS, NTFS) this problem is solved by limiting the cluster size (maximum 4 KB)

The data area map is T file allocation table (File Allocation Table - FAT) Each element of the FAT table (12, 16 or 32 bits) corresponds to one disk cluster and characterizes its state: free, busy or a bad cluster.

· If a cluster is allocated to a file (i.e., busy), then the corresponding FAT element contains the number of the next cluster of the file;

· the last cluster of the file is marked with a number in the range FF8h - FFFh (FFF8h - FFFFh);

· if the cluster is free, it contains the zero value 000h (0000h);

· a cluster that is unusable (failed) is marked with the number FF7h (FFF7h).

Thus, in the FAT table, clusters belonging to the same file are linked into chains.

The file allocation table is stored immediately after the boot record of the logical disk; its exact location is described in a special field in the boot sector.

It is stored in two identical copies, which follow each other. If the first copy of the table is destroyed, the second one is used.

Due to the fact that FAT is used very intensively during disk access, it is usually loaded into the RAM (into I/O buffers or cache) and remains there for as long as possible.

The main disadvantage of FAT is its slow processing of files. When creating a file, the rule is that the first free cluster is allocated. This leads to disk fragmentation and complex file chains. This results in slower work with files.

To view and edit the FAT table you can use utilityDiskEditor.

Detailed information about the file itself is stored in another structure called the root directory. Each logical drive has its own root directory (ROOT).

Root directory describes files and other directories. A directory element is a file descriptor.

Each file and directory descriptor includes it

· Name

· extension

date of creation or last modification

· time of creation or last modification

attributes (archive, directory attribute, volume attribute, system, hidden, read-only)

· file length (for a directory - 0)

· reserved field that is not used

· number of the first cluster in the chain of clusters allocated to a file or directory; Having received this number, the operating system, referring to the FAT table, finds out all the other cluster numbers of the file.

So, the user launches the file for execution. The operating system looks for a file with the desired name by looking at the descriptions of the files in the current directory. When the required element is found in the current directory, the operating system reads the number of the first cluster this file, and then uses the FAT table to determine the remaining cluster numbers. Data from these clusters is read into RAM, combining into one continuous section. The operating system transfers control to the file, and the program begins to run.

For viewing and editing root directory ROOT can also be used utilityDiskEditor.

File system VFAT

The VFAT (virtual FAT) file system first appeared in Windows for Workgroups 3.11 and was designed for protected mode file I/O.

This file system is used in Windows 95.

It is also supported in Windows NT 4.

VFAT is the native 32-bit file system of Windows 95. It is controlled by the VFAT .VXD driver.

VFAT uses 32-bit code for all file operations and can use 32-bit protected mode drivers.

BUT, the file allocation table entries remain 12- or 16-bit, so the disk uses the same data structure (FAT). Those. f table formatVFAT is the same, like the FAT format.

VFAT along with "8.3" names supports long file names. (VFAT is often said to be FAT with support for long names).

The main disadvantage of VFAT is large clustering losses with large logical disk sizes and restrictions on the size of the logical disk itself.

File system FAT 32

This is a new implementation of the idea of ​​using the FAT table.

FAT 32 is a completely self-contained 32-bit file system.

First used in Windows OSR 2 (OEM Service Release 2).

Currently, FAT 32 is used in Windows 98 and Windows ME.

It contains numerous improvements and additions over previous FAT implementations.

1. Uses disk space much more efficiently due to the fact that it uses smaller clusters (4 KB) - it is estimated that savings of up to 15%.

2. Has an extended boot record that allows you to create copies of critical data structures Þ increases the disc's resistance to damage to disc structures

3. Can use FAT backup instead of standard one.

4. Can move the root directory, in other words, the root directory can be in any location Þ removes the limitation on the size of the root directory (512 elements, since ROOT was supposed to occupy one cluster).

5. Improved root directory structure

Additional fields have appeared, for example, creation time, creation date, last access date, checksum

There are still multiple handles for a long filename.

File system HPFS

HPFS (High Performance File System) is a high-performance file system.

HPFS first appeared in OS/2 1.2 and LAN Manager.

Let's list main features of HPFS.

· The main difference is the basic principles of placing files on disk and the principles of storing information about the location of files. Thanks to these principles, HPFS has high performance and fault tolerance, is reliable file system.

· Disk space in HPFS is allocated not in clusters (as in FAT), but blocks. In the modern implementation, the block size is taken equal to one sector, but in principle it could be of a different size. (In fact, a block is a cluster, only a cluster is always equal to one sector). Placing files in such small blocks allows use disk space more efficiently, since the overhead of free space is on average only (half a sector) 256 bytes per file. Remember that the larger the cluster size, the more disk space is wasted.

· The HPFS system strives to arrange the file in contiguous blocks, or, if this is not possible, place it on the disk in such a way that extents(fragments) of the file were physically as close to each other as possible. This approach is essential reduces write/read head positioning time hard drive and wait time (delay between installing the read/write head on the desired track). Let us recall that in a FAT file the first free cluster is simply allocated.

Extents(extent) - file fragments located in adjacent sectors of the disk. A file has at least one extent if it is not fragmented, and multiple extents otherwise.

·Used method balanced binary trees for storing and searching information about the location of files (directories are stored in the center of the disk, in addition, automatic sorting of directories is provided), which is essential increases productivity HPFS (vs. FAT).

· HPFS provides special extended file attributes that allow control access to files and directories.

Extended Attributes (extended attributes, EAs ) allow you to store Additional information about the file. For example, each file can be associated with its unique graphic (icon), file description, comment, file owner information, etc.

C HPFS partition structure


At the beginning of the partition with HPFS installed there are three block controls:

boot block

· additional block (super block) and

· spare (backup) block (spare block).

They occupy 18 sectors.

All remaining disk space in HPFS is divided into parts from adjacent sectors - stripes(band - strip, tape). Each strip takes up 8 MB of disk space.

Each strip has its own sector allocation bitmap.The bitmap shows which sectors of a given band are occupied and which are free. Each sector of a data strip corresponds to one bit in its bitmap. If bit = 1, then the sector is busy, if 0, then it is free.

The bitmaps of the two lanes are located side by side on the disk, as are the lanes themselves. That is, the sequence of stripes and cards looks like in Fig.

Compare withFAT. There is only one “bit map” for the entire disk (FAT table). And to work with it you have to move the read/write heads across half the disk on average.

It is in order to reduce the time of positioning the read/write heads of a hard disk that in HPFS the disk is divided into stripes.

Let's consider control blocks.

Boot block (bootblock)

Contains the volume name, its serial number, BIOS parameter block and boot program.

The bootstrap program finds the file OS 2 LDR , reads it into memory and transfers control to this OS boot program, which, in turn, loads the OS/2 kernel from disk into memory - OS 2 KRNL. And already OS 2 KRIML using information from the file CONFIG. SYS loads all other necessary program modules and data blocks into memory.

The boot block is located in sectors 0 to 15.

SuperBlock(super block)

Contains

· pointer to a list of bitmaps (bitmap block list). This list lists all the blocks on the disk that contain the bitmaps used to detect free sectors;

· pointer to the list of defective blocks (bad block list). When the system detects a damaged block, it is added to this list and is no longer used to store information;

· pointer to directory band

· pointer to the file node (F -node) of the root directory,

· date of the last scan of the partition by CHKDSK;

· information about the stripe size (in the current HPFS implementation - 8 MB).

Super block is located in sector 16.

Spareblock(spare block)

Contains

· pointer to the emergency replacement map (hotfix map or hotfix -areas);

· pointer to the list of free spare blocks (directory emergency free block list);

· a number of system flags and descriptors.

This block is located in sector 17 of the disk.

The backup block provides high fault tolerance to the HPFS file system and allows you to recover damaged data on the disk.

File placement principle

Extents(extent) - file fragments located in adjacent sectors of the disk. A file has at least one extent if it is not fragmented, and multiple extents otherwise.

To reduce the time it takes to position the read/write heads of a hard disk, the HPFS system strives to

1) place the file in adjacent blocks;

2) if this is not possible, then place the extents of the fragmented file as close to each other as possible,

To do this, HPFS uses statistics and also tries to conditionally reserve at least 4 kilobytes of space at the end of files that are growing.

Principles for storing file location information

Each file and directory on the disk has its own file node F-Node. This is a structure that contains information about the location of a file and its extended attributes.

Each F-Node occupies one sector and is always located close to its file or directory (usually immediately before the file or directory). The F-Node object contains

· length,

· first 15 characters of the file name,

· special service information,

· statistics on file access,

· extended file attributes,

· a list of access rights (or only part of this list, if it is very large); If the extended attributes are too large for the file node, then a pointer to them is written to it.

· associative information about the location and subordination of the file, etc.

If the file is contiguous, then its location on disk is described by two 32-bit numbers. The first number is a pointer to the first block of the file, and the second is the extent length (the number of consecutive blocks that belong to the file).

If a file is fragmented, then the location of its extents is described in the file node by additional pairs of 32-bit numbers.

A file node can contain information about up to eight extents of a file. If a file has more extents, then a pointer to an allocation block is written to its file node, which can contain up to 40 pointers to extents or, similar to a directory tree block, to other allocation blocks.

Directory structure and placement

Used to store directories stripe located in the center of the disk.

This strip is called directoryband.

If it is completely full, HPFS starts placing file directories in other stripes.

Placing this information structure in the middle of the disk significantly reduces the average read/write head positioning time.

However, a significantly greater contribution to HPFS performance (compared to placing the Directory Band in the middle of a logical disk) is made by using method balanced binary trees for storing and retrieving information about the location of files.

Recall that in the file system FAT the directory has a linear structure, not ordered in a special way, so when searching for a file you need to look through it sequentially from the very beginning.

In HPFS, the directory structure is a balanced tree with entries arranged in alphabetical order.

Each entry included in the tree contains

· file attributes,

· pointer to the corresponding file node,

information about the time and date the file was created, time and date last update and appeals,

length of data containing extended attributes,

· file access counter,

file name length

· the name itself,

· and other information.

The HPFS file system looks only at the necessary branches of the binary tree when searching for a file in a directory. This method is many times more efficient than sequentially reading all entries in a directory, which is the case with the FAT system.

The size of each block in terms of which directories are allocated in the current HPFS implementation is 2 KB. The size of the entry describing the file depends on the size of the file name. If a name is 13 bytes (for 8.3 format), then a 2 KB block can hold up to 40 file descriptors. Blocks are connected to each other through a list.

Problems

When renaming files, so-called tree rebalancing may occur. Creating a file, renaming or erasing it may result in cascading directory blocks. In fact, a rename may fail due to lack of disk space, even if the file itself has not grown in size. To avoid this disaster, HPFS maintains a small pool of free blocks that can be used in the event of a disaster. This operation may require allocating additional blocks on a full disk. A pointer to this pool of free blocks is stored in SpareBlock.

Principles for placing files and directories on disk inHPFS:

· information about the location of files is dispersed throughout the disk, with records for each specific file located (if possible) in adjacent sectors and close to the data about their location;

· directories are located in the middle of disk space;

· Directories are stored as a binary balanced tree with entries arranged in alphabetical order.

Reliability of data storage in HPFS

Any file system must have a means of correcting errors that occur when writing information to disk. The HPFS system uses for this emergency replacement mechanism ( hotfix).

If the HPFS file system encounters a problem while writing data to disk, it displays an error message. HPFS then stores the information that should have been written to the defective sector in one of the spare sectors reserved in advance for this eventuality. The list of free spare blocks is stored in the HPFS spare block. If an error is detected while writing data to a normal block, HPFS selects one of the free spare blocks and stores the data there. The file system then updates emergency replacement card in the reserve unit.

This map is simply pairs of double words, each of which is a 32-bit sector number.

The first number indicates the defective sector, and the second indicates the sector among the available spare sectors that was selected to replace it.

After replacing the defective sector with a spare one, the emergency replacement map is written to the disk, and a pop-up window appears on the screen informing the user that a disk write error has occurred. Every time the system writes or reads a disk sector, it looks at the recovery map and replaces all bad sector numbers with spare sector numbers with the corresponding data.

It should be noted that this number translation does not significantly affect system performance, since it is performed only when physically accessing the disk, and not when reading data from the disk cache.

File system NTFS

File system NTFS (New Technology File System) contains a number of significant improvements and changes that significantly distinguish it from other file systems.

Note that with rare exceptions, with NTFS partitions can only be worked directly fromWindowsN.T. although there are corresponding implementations of file management systems for reading files from NTFS volumes for a number of OSes.

However, there are no full-fledged implementations for working with NTFS outside of Windows NT.

NTFS is not supported on the widely used Windows 98 and Windows Millennium Edition operating systems.

Key FeaturesNT FS

· work on large disks occurs efficiently (much more efficiently than in FAT);

· there are tools to restrict access to files and directories Þ NTFS partitions provide local security for both files and directories;

· a transaction mechanism has been introduced in which logging file operations Þ significant increase in reliability;

· many restrictions on the maximum number of disk sectors and/or clusters have been removed;

· a file name in NTFS, unlike the FAT and HPFS file systems, can contain any characters, including the full set of national alphabets, since the data is represented in Unicode - a 16-bit representation that gives 65535 different characters. The maximum length of a file name in NTFS is 255 characters.

· NTFS also has built-in compression capabilities that you can apply to individual files, entire directories, and even volumes (and subsequently undo or assign them as you wish).

Volume structure with the NTFS file system

An NTFS partition is called a volume (volume). The maximum possible volume size (and file size) is 16 EB (exabyte 2**64).

Like other systems, NTFS divides a volume's disk space into clusters—blocks of data that are addressed as data units. NTFS supports cluster sizes from 512 bytes to 64 KB; the standard is a cluster of 2 or 4 KB in size.

All disk space in NTFS is divided into two unequal parts.


The first 12% of the disk is allocated to the so-called MFT zone - space that can be occupied by the main service metafile MFT.

It is not possible to write any data to this area. The MFT zone is always kept empty - this is done so that the MFT file, if possible, does not become fragmented as it grows.

The remaining 88% of the volume is regular file storage space.

MFT(masterfiletable - general file table) is essentially a directory of all other files on the disk, including itself. It is designed to determine the location of files.

MFT consists of fixed size records. The MFT record size (minimum 1 KB and maximum 4 KB) is determined when the volume is formatted.

Each entry corresponds to a file.

The first 16 entries are of a service nature and are not available to the operating system - they are called metafiles, and the very first metafile is the MFT itself.

These first 16 MFT elements are the only part of the disk that has a strictly fixed position. A copy of these same 16 entries is kept in the middle of the volume for reliability.

The remaining parts of the MFT file can be located, like any other file, in arbitrary locations on the disk.

Metafiles are of a service nature - each of them is responsible for some aspect of the system's operation. Metafiles are located in the root directory of the NTFS volume. They all begin with the name symbol "$", although it is difficult to obtain any information about them using standard means. In table The main metafiles and their purpose are given.

Metafile name

Purpose of the metafile

$MFT

Master File Table itself

$MFTmirr

A copy of the first 16 MFT entries placed in the middle of the volume

$LogFile

Logging support file

$Volume

Service information - volume label, file system version, etc.

$AttrDef

List of standard file attributes on the volume

Root directory

$Bitmap

Volume free space map

$Boot

Boot sector (if the partition is bootable)

$Quota

A file that records user rights to use disk space (this file only started working in Windows 2000 with NTFS 5.0)

$Upcase

File - a table of correspondence between uppercase and lowercase letters in file names. In NTFS, file names are written in Unicode (which amounts to 65 thousand different symbols) and looking for large and small equivalents in this case is a non-trivial task

The corresponding MFT record stores all information about the file:

· file name,

· size;

· file attributes;

· position on the disk of individual fragments, etc.

If one MFT record is not enough for the information, then several records are used, and not necessarily consecutive ones.

If the file is not very large, then the file data is stored directly in the MFT, in the space remaining from the main data within one MFT record.

A file on an NTFS volume is identified by the so-called file link(File Reference), which is represented as a 64-bit number.

· file number that corresponds to the record number in MFT,

· and sequence numbers. This number increases whenever this number MFT is reused to allow the NTFS file system to perform internal integrity checks.

Each file in NTFS is represented by streams(streams), that is, it does not have “just data” as such, but there are streams.

One of the streams is the file data.

Most file attributes are also streams.

Thus, it turns out that the file has only one basic entity - the number in the MFT, and everything else, including its streams, is optional.

This approach can be used effectively - for example, you can “attach” another stream to a file by writing any data to it.

Standard attributes for files and directories on an NTFS volume have fixed names and type codes.

Catalog in NTFS is special file, which stores links to other files and directories.

The catalog file is divided into blocks, each containing

· file name,

basic attributes and

The root directory of the disk is no different from regular directories, except for a special link to it from the beginning of the MFT metafile.

The internal directory structure is a binary tree, similar to HPFS.

The number of files in the root and non-root directories is not limited.

The NTFS file system supports the NT security object model: NTFS treats directories and files as distinct types of objects and maintains separate (albeit overlapping) lists of permissions for each type.

NTFS provides file-level security; this means that access rights to volumes, directories and files may depend on account user and the groups to which he belongs. Every time a user accesses a file system object, his access rights are checked against the permission list of that object. If the user has sufficient rights, his request is granted; otherwise the request is rejected. This security model applies both to local user registration on NT computers and to remote network requests.

The NTFS system also has certain self-healing capabilities. NTFS supports various mechanisms for verifying system integrity, including transaction logging, which allows file write operations to be replayed against a special system log.

At logging file operations, the file management system records the changes that occur in a special service file. At the beginning of an operation related to changing the file structure, a corresponding note is made. If any failure occurs during file operations, the said operation start mark remains indicated as incomplete. When you perform a file system integrity check after rebooting the machine, these pending operations will be canceled and the files will be restored to their original state. If the operation of changing data in files is completed normally, then in this very service logging support file the operation is marked as completed.

The main disadvantage of the file systemNTFS- service data takes up a lot of space (for example, each directory element takes up 2 KB) - for small partitions, service data can occupy up to 25% of the media volume.

Þ NTFS cannot be used to format floppy disks. You should not use it to format partitions smaller than 100 MB.

OS file system UNIX

In the UNIX world, there are several different types of file systems with their own external memory structure. The best known are the traditional UNIX System V (s5) file system and the UNIX BSD family file system (ufs).

Consider s 5.

A file on a UNIX system is a collection of random access characters.

The file has a structure that is imposed on it by the user.

The Unix file system is a hierarchical, multi-user file system.

The file system has a tree structure. The vertices (intermediate nodes) of the tree are directories with links to other directories or files. The leaves of the tree correspond to files or empty directories.

Comment. In fact, the Unix file system is not tree-based. The fact is that the system has the possibility of violating the hierarchy in the form of a tree, since it is possible to associate multiple names with the same file content.

Disk structure

The disk is divided into blocks. The data block size is determined when formatting the file system with the mkfs command and can be set to 512, 1024, 2048, 4096 or 8192 bytes.

We count 512 bytes (sector size).

Disk space is divided into the following areas (see figure):

· loading block;

· control superblock;

· array of i-nodes;

· area for storing the contents (data) of files;

· a set of free blocks (linked into a list);

Boot block

Superblock

i - node

. . .

i - node

Comment. For the UFS file system - all this is repeated for a group of cylinders (except for the Boot block) + a special area is allocated to describe the group of cylinders

Boot block

The block is located in block No. 0. (Remember that placing this block in block zero system device determined by the hardware, since the hardware bootloader always accesses block zero of the system device. This is the last component of the file system that is hardware dependent.)

The boot block contains a promotion program that is used to initially launch the UNIX OS. In S 5 file systems, only the boot block of the root file system is actually used. In additional file systems, this area is present, but not used.

Superblock

It contains operational information about the state of the file system, as well as data about file system settings.

In particular, the superblock contains the following information

· number of i-nodes (index descriptors);

· partition size???;

· list of free blocks;

· list of free i-nodes;

· and other.

Let's pay attention! The free space on the disk is linked list of free blocks. This list is stored in a superblock.

List elements are arrays of 50 elements (if block = 512 bytes, then element = 16 bits):

· array elements No. 1-48 contain the numbers of free blocks of file block space from 2 to 49.

· element #0 contains a pointer to the continuation of the list, and

· V last element(No. 49) contains a pointer to a free element in the array.

If some process needs a free block to expand a file, then the system selects an array element using a pointer (to a free element), and the block with No. stored in this element is provided to the file. If the file is reduced, the freed numbers are added to the array of free blocks and the pointer to the free element is adjusted.

Since the array size is 50 elements, two critical situations are possible:

1. When we free blocks of files, but they cannot fit in this array. In this case, one free block is selected from the file system and the completely filled array of free blocks is copied into this block, after which the value of the pointer to the free element is reset, and the zero element of the array, which is located in the superblock, contains the number of the block that the system has chosen to copy the contents of the array. At this moment, a new element of the list of free blocks is created (each with 50 elements).

2. When the contents of the elements of the array of free blocks have been exhausted (in this case, the zero element of the array is zero). If this element is not equal to zero, then this means that there is a continuation of the array. This continuation is read into a copy of the superblock in RAM.

Free listi-nodes. This is a buffer consisting of 100 elements. It contains information about 100 numbers of i-nodes that are free in this moment.

The superblock is always in RAM

Þ all operations (releasing and occupying blocks and i-nodes occur in RAM Þ minimizing disk exchanges.

But! If the contents of the superblock are not written to the disk and the power is turned off, problems will arise (a discrepancy between the real state of the file system and the contents of the superblock). But this is already a requirement for the reliability of the system equipment.

Comment. UFS file systems support multiple copies of the superblock (one copy per cylinder group) to improve stability.

Inode area

This is an array of file descriptions called i -nodes (i -node).(64 byte?)

Each index descriptor (i-node) of a file contains:

· File type (file/directory/special file/fifo/socket)

· Attributes (access rights) - 10

File owner ID

· Group ID of the file owner

· File creation time

File modification time

· Time of last access to the file

· File length

· Number of links to a given i-node from various directories

File block addresses

!note. There is no file name here

Let's take a closer look at how it is organized block addressing, in which the file is located. So, in the address field there are numbers of the first 10 blocks of the file.

If the file exceeds ten blocks, then the following mechanism begins to work: the 11th element of the field contains the block number, which contains 128 (256) links to blocks of this file. If the file is even larger, then the 12th element of the field is used - it contains the block number, which contains 128(256) block numbers, where each block contains 128(256) file system block numbers. And if the file is even larger, then the 13th element is used - where the nesting depth of the list is increased by another one.

This way we can get a file of size (10+128+128 2 +128 3)*512.

This can be represented as follows:

Address of the 1st block of the file

Address of the 2nd block of the file

Address of the 10th block of the file

Indirect addressing block address (block with 256 block addresses)

Address of the 2nd indirect addressing block (block with 256 address blocks with addresses)

Address of the 3rd indirect addressing block (block with addresses of blocks with addresses of blocks with addresses)

File protection

Now let's look at the owner and group IDs and security bits.

In Unix OS it is used three-level user hierarchy:

The first level is all users.

The second level is user groups. (All users are divided into groups.

The third level is a specific user (Groups consist of real users). Due to this three-level organization of users, each file has three attributes:

1) Owner of the file. This attribute is associated with one specific user, who is automatically assigned by the system as the owner of the file. You can become the default owner by creating a file, and there is also a command that allows you to change the owner of a file.

2) File access protection. Access to each file is limited to three categories:

· owner rights (what the owner can do with this file, in the general case - not necessarily everything);

· rights of the group to which the file owner belongs. The owner is not included here (for example, a file can be read-locked for the owner, but all other group members can freely read from the file;

· all other users of the system;

These three categories regulate three actions: reading from a file, writing to a file, and executing a file (in the mnemonic R,W,X systems, respectively). Each file in these three categories defines which user can read, which can write, and who can run it as a process.

Directory organization

From the OS point of view, a directory is a regular file that contains data about all the files that belong to the directory.

A directory element consists of two fields:

1)number of the i-node (ordinal number in the array of i-nodes) and

2)file name:

Each directory contains two special names: ‘.’ - the directory itself; ‘..’ - parent directory.

(For the root directory, the parent refers to the same directory.)

In general, a directory can contain multiple entries that refer to the same i-node, but the directory cannot contain entries with the same names. That is, an arbitrary number of names can be associated with the contents of the file. It is called tying. A directory entry that refers to a single file is called communication.

Files exist independently of directory entries, and directory links actually point to physical files. A file "disappears" when the last link pointing to it is deleted.

So, to access a file by name, operating system

1. finds this name in the directory containing the file,

2. gets the number of the i-node of the file,

3. by number finds the i-node in the area of ​​i-nodes,

4. from the i-node receives the addresses of the blocks in which the file data is located,

5. reads blocks from the data area using block addresses.

Disk partition structure in EXT2 FS

The entire partition space is divided into blocks. A block can be 1, 2, or 4 kilobytes in size. A block is an addressable unit of disk space.

Blocks in their area are combined into groups of blocks. Groups of blocks in a file system and blocks within a group are numbered sequentially, starting with 1. The first block on a disk is numbered 1 and belongs to group number 1. The total number of blocks on a disk (in a disk partition) is a divisor of the disk's capacity, expressed in sectors. And the number of block groups does not have to divide the number of blocks, because the last block group may not be complete. The beginning of each group of blocks has an address, which can be obtained as ((group number - 1)* (number of blocks in the group)).

Each group of blocks has the same structure. Its structure is presented in the table.

The first element of this structure (superblock) is the same for all groups, and all the rest are individual for each group. The superblock is stored in the first block of each block group (except for group 1, which has a boot record in the first block). Superblock is the starting point of the file system. It is 1024 bytes in size and is always located at offset 1024 bytes from the beginning of the file system. The presence of multiple copies of a superblock is explained by the extreme importance of this element of the file system. Superblock duplicates are used when recovering a file system after failures.

The information stored in the superblock is used to organize access to the rest of the data on the disk. The superblock determines the size of the file system, the maximum number of files in the partition, the amount of free space, and contains information about where to look for unallocated areas. When the OS starts, the superblock is read into memory and all changes to the file system are first reflected in a copy of the superblock located in the OS and are written to disk only periodically. This improves system performance because many users and processes are constantly updating files. On the other hand, when the system is turned off, the superblock must be written to disk, which does not allow turning off the computer by simply turning off the power. Otherwise, the next time you boot, the information recorded in the superblock will not correspond to the real state of the file system.

Following the superblock is a description of the group of blocks (Group Descriptors). This description contains:

Address of the block containing the block bitmap of this group;

Address of the block containing the inode bitmap of this group;

Address of the block containing the inode table of this group;

Counter of the number of free blocks in this group;

The number of free inodes in this group;

The number of inodes in a given group that are directories

and other data.

The information stored in the group description is used to locate the block and inode bitmaps, as well as the inode table.

File system Ext 2 is characterized by:

  • hierarchical structure,
  • agreed upon processing data sets,
  • dynamic file extension,
  • protection of information in files,
  • treating peripheral devices (such as terminals and tape devices) as files.

Internal file representation

Each file in the Ext 2 system has a unique index. The index contains the information needed by any process to access the file. Processes access files using a well-defined set of system calls and identifying the file with a string of characters that acts as a qualified file name. Each compound name uniquely identifies a file, so the system kernel converts this name into a file index. The index includes a table of addresses where file information is located on disk. Since each block on a disk is addressed by its own number, this table stores a collection of disk block numbers. To increase flexibility, the kernel appends a file one block at a time, allowing the file's information to be scattered throughout the file system. But this layout complicates the task of searching for data. The address table contains a list of block numbers containing information belonging to the file.

File inodes

Each file on the disk has a corresponding file inode, which is identified by its serial number - the file index. This means that the number of files that can be created on a file system is limited by the number of inodes, which is either explicitly specified when the file system is created or calculated based on the physical size of the disk partition. Inodes exist on disk in static form and the kernel reads them into memory before working with them.

The file inode contains the following information:

- The type and access rights to this file.

File owner identifier (Owner Uid).

File size in bytes.

Time of the last access to the file (Access time).

File creation time.

Time of the last modification of the file.

File deletion time.

Group ID (GID).

Links count.

The number of blocks occupied by the file.

File flags

Reserved for OS

Pointers to blocks in which file data is written (an example of direct and indirect addressing in Fig. 1)

File version (for NFS)

ACL file

Directory ACL

Fragment address

Fragment number

Fragment size

Catalogs

Directories are files.

The kernel stores data in a directory just as it does in a regular file type, using an index structure and blocks with direct and indirect addressing levels. Processes can read data from directories in the same way they read regular files, however, exclusive write access to the directory is reserved by the kernel, ensuring that the directory structure is correct.)

When a process uses a file path, the kernel looks in the directories for the corresponding inode number. After the file name has been converted to an inode number, the inode is placed in memory and then used in subsequent requests.

Additional features of EXT2 FS

In addition to standard Unix features, EXT2fs provides some additional features not typically supported by Unix file systems.

File attributes allow you to change how the kernel reacts when working with sets of files. You can set attributes on a file or directory. In the second case, files created in this directory inherit these attributes.

During system mounting, some features related to file attributes may be set. The mount option allows the administrator to choose how files are created. In a BSD-specific file system, files are created with the same group ID as the parent directory. The features of System V are somewhat more complex. If a directory has its setgid bit set, then created files inherit the group ID of that directory, and subdirectories inherit the group ID and setgid bit. Otherwise, files and directories are created with the primary group ID of the calling process.

The EXT2fs system can use synchronous data modification similar to the BSD system. The mount option allows the administrator to specify that all data (inodes, bit blocks, indirect blocks, and directory blocks) be written to disk synchronously when they are modified. This can be used to achieve high data recording capacity, but also results in poor performance. In reality, this function is not usually used because, in addition to degrading performance, it can lead to the loss of user data that is not flagged when checking the file system.

EXT2fs allows you to select the logical block size when creating a file system. It can be 1024, 2048 or 4096 bytes in size. Using larger blocks results in faster I/O operations (since fewer disk requests are made), and therefore less head movement. On the other hand, using large blocks leads to wasted disk space. Typically, the last block of a file is not completely used for storing information, so as the block size increases, the amount of wasted disk space increases.

EXT2fs allows you to use accelerated symbolic links. When using such links, file system data blocks are not used. The destination file name is not stored in the data block, but in the inode itself. This structure allows you to save disk space and speed up the processing of symbolic links. Of course, the space reserved for a handle is limited, so not every link can be represented as an accelerated link. The maximum length of a file name in an accelerated link is 60 characters. In the near future it is planned to expand this scheme for small files.

EXT2fs monitors the state of the file system. The kernel uses a separate field in the superblock to indicate the state of the file system. If the file system is mounted in read/write mode, then its state is set to "Not Clean". If it is dismantled or remounted in read-only mode, then its state is set to “Clean”. During system boot and file system status checks, this information is used to determine whether a file system check is necessary. The kernel also places some errors in this field. When the kernel detects a mismatch, the file system is marked as "Erroneous". The file system checker tests this information to check the system, even if its status is actually Clean.

Ignoring file system testing for a long time can sometimes lead to some difficulties, so EXT2fs includes two methods for regularly checking the system. The superblock contains the system mount counter. This counter is incremented each time the system is mounted in read/write mode. If its value reaches the maximum (it is also stored in the superblock), then the file system test program starts checking it, even if its state is "Clean". The last check time and the maximum interval between checks are also stored in the superblock. When the maximum interval between scans is reached, the state of the file system is ignored and its scan is started.

Performance optimization

The EXT2fs system contains many features that optimize its performance, which leads to increased speed of information exchange when reading and writing files.

EXT2fs actively uses the disk buffer. When a block needs to be read, the kernel issues an I/O operation request to several adjacent blocks. Thus, the kernel tries to make sure that the next block to be read has already been loaded into the disk buffer. Such operations are usually performed when reading files sequentially.

The EXT2fs system also contains a large number of optimizations for information placement. Block groups are used to group together corresponding inodes and data blocks. The kernel always tries to place the data blocks of one file in the same group, as well as its descriptor. This is intended to reduce the movement of the drive heads when reading the descriptor and its corresponding data blocks.

When writing data to a file, EXT2fs pre-allocates up to 8 contiguous blocks when allocating a new block. This method allows you to achieve high performance under heavy system load. This also allows files to be placed in contiguous blocks, which speeds up their subsequent reading.

The file system determines how data will be stored on the disk, and what principles of access to stored information can be used when reading it.

We are accustomed to perceiving information on our PC in the form of specific files, neatly (or not so :)) arranged in folders. Meanwhile, your computer works with data on a completely different principle. There are no solid files for it on the hard drive. It “sees” only clearly addressed sectors with bytecode. Moreover, the code of one file is not always stored in adjacent sectors (so-called data fragmentation).

How does a computer “understand” where, for example, it should look for our Text Document, which lies, say, on the Desktop? It turns out that he is responsible for this file system hard drive. And today we will find out what file systems there are and what their features are.

What is a file system

To understand what a file system is, it is best to use the method of analogies. Let's imagine that HDD- this is a kind of box in which multi-colored cubes are stored. These cubes are parts of different files stored in limited-sized cells called clusters. They can be simply piled up in a heap or have a certain order of placement. So, if these conditional cubes are stored not in a chaotic pile, but in accordance with some kind of logic, we can talk about the presence of some kind of analogue of a file system.

The file system determines the order in which data is stored on the disk and the principles for accessing it; however, the type of file system largely depends on the type of media. For example, it is obvious that for a magnetic tape that supports recording only sequential blocks of data, only a single-level file system with sequential access to clusters of information is suitable, and for a modern SSD drive - any multi-level with random access:

Based on the principle of the sequence of storing data blocks, file systems, as we have already seen, can be divided into those that store clusters with file fragments sequentially or arbitrarily. As for the levels, the FS can be divided into single-level And tree-like(multi-level).

In the first case, all files are displayed as a single flat list, and in the second - as a hierarchical list. In this case, the level of investments is, as a rule, unlimited, and branching comes either from only one ("root" in UNIX) or from several root directories (logical drives in Windows):

Features of file systems also include the presence of various mechanisms that protect the data structure from failures. One of the most modern mechanisms for ensuring FS fault tolerance is logging. It allows you to record all actions performed with files in special service files (they are called “logs” or “logs”).

Logging can be complete, when for each operation a backup is created not only of the state of the clusters, but also of all recorded data. Such logging is often used for various databases, but it significantly slows down the system and increases the size of the logs (in fact, the logs store a complete backup of the entire file system with all its data).

Logged much more frequently only logical operations and (optionally) the state of the file system clusters. That is, the log only records that, say, a file named "file.txt" with a size of 52 KB was written to such and such clusters. The contents of the file itself do not appear in the log. This approach allows you to avoid duplication of data, speeds up the process of working with files and significantly reduces the size of the log itself. The only drawback with this method of journaling is that if a failure occurs, the data being written may be lost (since there is no copy of it), but the state of the file system itself will remain operational.

Formatting

Since we are talking about file systems in the context of modern computers with their hard or SSD drives, we will pay more attention to multi-level file systems with random access to clusters. Most popular in computer world today are: FAT32, NTFS, exFAT, ext3/ext4, ReiserFS and HFS+.

Changing the file system on the disk is achieved by formatting. It provides for the creation at the hard disk level in its initial sector of special service labels that define the principles of data access. In this case, clusters with existing data during formatting are usually cleared or marked as empty and available for overwriting. Exceptions are special cases file system conversion(for example, from FAT32 to NTFS), in which the entire data structure is preserved.

For formatting, you can use standard operating system tools (for example, console commands Linux or context menu disk in Windows), functions available during the preparatory stage of OS installation, or special programs. The only thing to consider with a software solution is that your operating system may not support the file system you choose without installing additional drivers (for example, ext3/4 in Windows):

There is also a concept low level formatting. Initially, it implied cleaning the disk and writing special service information to its clusters to align the read heads. For modern hard drives, this function is program level is no longer provided (this can only be done with the help of special equipment), however, the concept of low-level formatting has been preserved, although it has been slightly transformed.

It is now carried out using special software (HDD Low Level Format Tool for Windows) or commands (DD for Linux). When using it, all hard disk clusters are overwritten with zeros and any markup is completely destroyed. After this, the file system essentially disappears and appears in Windows as RAW. To access the drive after this formatting, you need to format it with one of the available higher-level traditional file systems.

Features of file systems

Well, now let's look at some features of the most common file systems.

FAT32

One of the oldest disk file systems that is still widely used today is FAT32(abbreviated English: “File Allocation Table” - “file allocation table”). Due to its prevalence, it is supported by the maximum number of all kinds of equipment, from car radios to powerful modern computers. Most flash drives sold today are also formatted in FAT32.

This FS first appeared in Windows 95 OSR2 in 1996, becoming a logical development of the even earlier FAT16 (1983). One of the main reasons for the transition to a new file system was the emergence of capacious (at that time) hard drives with a capacity of more than 2 GiB (gibibyte - a more accurate version of gigabyte (109) - 230 bytes) (the maximum possible partition size in FAT16). FAT32 allowed up to 268,435,445 clusters of a maximum of 32 KB, which is equivalent to 8 TiB per volume. However, if the cluster size is standard (512B), then the maximum volume size will be only slightly more than 127 GB.

The basis of FAT32, as its name suggests, is a file table. It stores records of existing files, as well as the time they were created and last accessed. There is no journaling, so reading/writing processes in this file system are faster than, for example, in NTFS, which keeps more complete logs. It is precisely because of its good performance that FAT32 is still widely used today.

The main disadvantage of FAT32 at the moment is the limitation on the maximum file size - 4 GiB. Files exceeding this threshold must be split into parts, which in turn makes them difficult to access. In addition, FAT32 has some other limitations in Windows environment. For example, using standard tools you will not be able to create partitions larger than 32 GB. Therefore, flash drives of 64 GB or more will have to be formatted either using special software or on Linux.

However, in this case, although access to the media will be preserved, it will be hampered by “brakes” both when reading and writing data. Therefore, when using drives larger than 32 GB, it is better to format them in other file systems, such as exFAT or NTFS.

NTFS

If the Windows 95/98 line continued the traditions of the already outdated DOS operating system at that time, then the new NT line was initially aimed at innovation. Therefore, with the advent of Windows NT 3.1 in 1993, a new file system was created specifically for it NTFS(abbreviated English: "New Technology File System" - "new technology file system").

This file system is still the main one for all modern versions of Windows, since it provides good operating speed, supports drives with a capacity of up to 16 EiB (exbibyte - 260) (with a maximum cluster size of 64 KB) without restrictions on file sizes and has in its arsenal pretty good functionality. For example, NTFS is a journaling file system and also supports the distribution of user roles for access to individual data, which was not the case in FAT32.

Like FAT32, NTFS is based on a table, but it is a more advanced database and is called MFT(abbreviated English: "Master File Table" - "master file table"). The rows in this table correspond to files stored on a particular partition, and the columns contain the attributes of these files (creation date, size, access rights, etc.).

In addition, to increase fault tolerance in NTFS, USN magazine(abbreviated English "Update Sequence Number" - verbatim "update order number"). This log, similar to the FAT32 table, records data about changes to a particular file. However, if the FAT32 table only recorded the time of the last access to the data, which did not provide any special practical benefits, then the USN can save the previous state of the file system, which allows it to be restored in case of failures.

Another feature of NTFS is its support alternative data streams(English: "Alternate Data Streams" - ADS). They were originally conceived to delimit execution various processes. Then (in Windows 2000) they were used to store some file attributes (author name, icon, etc.), similar to how it was done in HFS from MacOS. In modern Windows alternative streams can store almost any information. Some viruses even use this to hide their presence in the system.

The fact is that alternative flows are not direction finding Windows Explorer and are essentially invisible to users and most programs. However, you can view them and even use them, for example, to hide any data using special software. It is convenient to view data in alternative streams using the NTFS Stream Explorer program, and use them to hide files using Xp-lore:

Additional features that deserve mention for NTFS are support for encryption, data compression, “soft” and “hard” links to files (alas, there is no such option for folders), disk quotas for different system users, and also, of course, differentiation of access rights to files.

NTFS was originally created exclusively for Windows, however, today it is supported by most media players (flash drives can also be formatted in it), operating systems Linux systems and MacOS (albeit with some recording restrictions). It is worth noting, however, the weak support for NTFS on popular game consoles. Of these, only Xbox One has support for it.

exFAT

With the increase in the volume of flash drives in the second half of the 2000s, it became clear that the commonly used FAT32 file system would soon exhaust its potential. Using journaled NTFS for flash drives with their limited number of rewrite cycles and slower operation turned out to be not entirely advisable. Therefore, in 2006, the same Microsoft corporation released a new file system exFAT(abbreviated "Extended FAT" - "extended FAT") bundled with the Windows Embedded CE 6.0 operating system:

It became a logical continuation of the development of FAT32, which is why it is sometimes also called FAT64. The main trump card of the new file system was the removal of restrictions on file sizes and an increase in the theoretical limit for a disk partition to 16 E&B (as in NTFS). At the same time, due to the lack of journaling, exFAT retained high speed data access and compactness.

Another advantage of exFAT was the ability to increase the cluster size to 32 MB, which significantly optimized storage large files(for example, video). In addition, data storage in exFAT is organized in such a way as to minimize the processes of fragmentation and rewriting of the same clusters. All this was done, again, for the sake of optimizing the operation of flash drives, for which the file system was originally developed.

Due to the fact that exFAT is a relatively new file system, there are some restrictions on its use. IN Windows full its support appeared only in Vista SP1 (although there is an update for Windows XP SP2 - ). MacOS supports exFAT since version 10.6.5, while Linux requires a separate driver to be installed (some distributions have it built-in, some are read-only).

ext2, ext3 and ext4

If in the Windows environment NTFS has been ruling the roost for decades, then in the Linux camp there has traditionally been a very wide variety, including among the file systems used. True, there is one line of them that is used by most distributions by default. These are file systems of the family ext(English abbreviation "Extended File System" - "extended file system"), which since 1992 were initially created specifically for Linux.

The second version is the most widely used ext2, which, like NTFS, appeared back in 1993. True, unlike NTFS, ext2 is not a journaling file system. This is both its plus and minus. The advantage is that it is one of the fastest file systems for writing data. Also, the lack of logging makes it preferable to use it on flash drives and SSD drives. The price for performance is low fault tolerance.

In order to improve the stability of ext2, an improved version was developed in 2001 ext3. It introduced journaling, which can operate in three modes: “writeback” (only file system metadata is written), “ordered” (logging is always done BEFORE changing the FS) and “journal” (a full backup of metadata and the files themselves being changed).

Otherwise, there were no special innovations. And the speed of work, compared to previous version, decreased significantly, so already in 2006 a prototype of the next stage of file system development appeared ext4, the final release of which took place in 2008. The fourth extended file system retained journaling, but significantly increased data reading speed, which was even higher than in ext2!

Other innovations worth noting include an increase in the maximum volume of a disk partition to 1 EiB (from 32 TiB in ext2 and ext3), an increase in the maximum file size to 16 TiB (from 2 TiB in earlier versions) and the appearance of an extent mechanism (from the English "extent" - "space"). The latter allows you to access not single blocks, as is implemented in other file systems (and in ext3 in particular), but to combined disk spaces from sequential clusters, with a total volume of up to 128 MB, which significantly increases performance and reduces data fragmentation.

Today, support for file systems of the ext family of one version or another is present by default in almost all Linux systems. Of these, almost all systems released in 2010 and older support ext4. To access ext partitions in Windows and MacOS, you need to install special software and/or drivers.

ReiserFS

Another young and promising file system “originally” from the world of Linux is ReiserFS. Thanks to the efforts of the team of American developer Hans Reiser, it became the first journaled file system, which was added to the Linux kernel version 2.4.1 in 2001, just before ext3 support was added.

In fact, like ext3 that followed it, ReiserFS made it possible to use full or partial journaling on Linux. However, unlike ext3, it had a larger allowable file size (up to 8 TiB versus 2) and a maximum file name length of 255 characters, not bytes (4032 bytes).

Also, one of the features of ReiserFS for which users fell in love with it was the ability to change the size of a partition without unmounting it. ext2 did not have such a function, but later it appeared in ext3, although ReiserFS was also the first in this regard.

Despite a number of advantages over alternative file systems of its time, ReiserFS was also not without its drawbacks. The most significant of them include rather weak fault tolerance in case of damage to the metadata structure and an ineffective defragmentation algorithm. Therefore, since 2004, work began to improve the file system, which became known as Reiser4.

True, despite a number of innovations, improvements and corrections, the new file system remained the preserve of a few enthusiasts. The fact is that in 2006, Hans Reiser committed the murder of his own wife and was taken into custody and later imprisoned. Accordingly, his company Namesys, which was developing Reiser4, was disbanded. Since then, support and modification of the file system has been carried out by a group of developers under the supervision of Russian developer Eduard Shishkin.

Ultimately, support for Reiser4 has not yet been added to the Linux kernel, but ReiserFS is available. Therefore, many continue to use it in various assemblies as the default file system.

HFS

Speaking about file systems characteristic of various operating systems, one cannot fail to mention MacOS with its HFS(abbreviated English: "Hierarchical File System" - "hierarchical file system"). The first versions of this system appeared back in 1985 along with the Macintosh System 1.0 operating system:

By modern standards, this file system was very ineffective, so in 1998, along with MacOS 8.1, its improved version called HFS+ or Mac OS Extended, which is maintained to this day.

Like its predecessor, HFS+ divides the disk into 512 KB blocks (by default), which are combined into clusters responsible for storing certain files. However, the new FS has 32-bit addressing (instead of 16-bit). This allows you to avoid restrictions on the size of the written file and provides support for a maximum volume size of up to 8 E&B (and in the latest revisions up to 16 E&B).

Other advantages of HFS+ include journaling (an entire hidden volume called HFSJ is allocated for it), as well as multithreading. Moreover, if in NTFS alternative streams do not have particularly clear regulations on the types of stored information, then in HFS+ two streams are specifically distinguished: a data stream (stores the main data of files) and a resource stream (stores file metadata).

HFS+ is almost ideal for traditional HDDs, however, like the ReiserFS discussed above, it does not have the most effective algorithms for combating data fragmentation. Therefore, with the spread of SSD drives and their introduction into Apple equipment, it is increasingly being replaced by the file system developed in 2016 APFS(abbreviated as “Apple File System”), which appeared in desktop macOS High Sierra (10.13) and mobile iOS 10.3.

In many ways, APFS is similar to exFAT in terms of optimizing read/write processes, however, unlike it, it has journaling, supports the distribution of data access rights, has improved data encryption and compression algorithms, and can also work with volumes up to 9 YB in size (don't laugh - "yobibyte") due to 64-bit addressing!

The only disadvantage of APFS is that it is only supported by modern Apple technology and is not yet available on other platforms.

Comparison of file systems

Today we looked at many different popular file systems, so it wouldn’t hurt to summarize all the data about them into a single table:

Characteristics / FS FAT32 NTFS exFAT ext2 ext4 ReiserFS HFS+ APFS
Year of implementation 1996 1993 2008 1993 2006 2001 1998 2016
Scope of application Windows removable drives, Linux removable storage, Windows Vista+, Linux Linux, removable storage Linux Linux MacOS MacOS
Maximum file size 4 GiB 16 E&B 16 E&B 2 TiB 16 TiB 8 TiB 16 E&B 9 YiB
Maximum volume size 8 TiB 16 E&B 64 ZiB (zebibyte) 32 TiB 1 E&B 16 TiB 16 E&B 9 YiB
Logging - + - - + + + +
Access rights management - + - - + + + +

conclusions

As you can see, each operating system has its own optimal file system, which allows you to work with data most efficiently. For example, for Windows it is NTFS, for MacOS it is HFS+ or APFS. The only exceptions to the rule can be considered numerous Linux distributions. There are more than a dozen file systems, each with its own advantages and disadvantages.

Most Windows users It’s worth remembering only the three most common FS: FAT32 - for small flash drives and old equipment, NTFS - for most computers and exFAT - for capacious flash drives and external SSD drives (about the relevance of formatting system disk exFAT is still controversial due to the lack of journaling and greater susceptibility to failures).

P.S. Permission granted to freely copy and quote. this article provided that an open active link to the source is indicated and the authorship of Ruslan Tertyshny is preserved.

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. Therefore, there are different types of file systems. Each of them is optimized for use on a specific OS or for working with certain types of data.

Adapting disk media for use through algorithms of a specific 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 recently in the global electronics market there has been some unification of standards in terms of OS operation 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 of the OS, as a rule, are able to recognize not only file systems that are typical for themselves, 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 there are quite a large number of types of file systems, 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. In this and other OSs based on its principles - such as Android - logical drives are not used. 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 they are 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 the music file Dance.mp3 as an example. 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 of data management systems, then the first thing you should pay attention to is 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. The maximum length, however, 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 is the most important element of the 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.

The file system designed to replace FAT 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 is highlighted by IT experts, is thus, 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.

Another popular 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 when 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 the key advantages of NFTS is reliability. For example, in cases where the hard drive suddenly loses power, the likelihood of files being damaged is minimized due to the data duplication algorithms provided in NTFS.

One of the newest file systems from Microsoft is exFAT. It is best adapted for flash drives. The basic principles of operation are the same as in FAT32, but there are also significant modernizations 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, you need to install the WPD file system driver ( Windows Portable Devices - technology used when working with portable devices). Sometimes the user may not have it at hand, and as a result, the external OS media may not recognize it. The WPD file 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, typical file systems should be distinguished hard drives, 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 computer market is Apple's Macintosh. PCs in this line run the Mac OS operating system. What are the features of organizing work with files in Mac computers? Most modern Apple PCs use the Mac OS Extended file system. Previously, Mac computers managed data using 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 code, can be modified with the prospect of 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 of the required file may 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 you cannot (unless you use special software) change the size of logical drives in Windows. It must be fixed.

Another one 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. Update related procedure system area media 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 the form of Android). 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.