Description of the file structure of your home PC. PC file system. How file systems work

Sooner or later, a novice computer user is faced with such a concept as a file system (FS). As a rule, the first acquaintance with this term occurs when formatting a storage medium: logical drives and connected media (flash drives, memory cards, external HDD).

Before formatting, the Windows operating system prompts you to select the type of file system on the media, cluster size, and formatting method (quick or full). Let's figure out what a file system is and why it is needed?

All information is recorded on the media in the form, which must be located in a certain order, otherwise the operating system and programs will not be able to operate with the data. This order is organized by the file system using certain algorithms and rules for placing files on the media.

When a program needs a file stored on disk, it does not need to know how or where it is stored. All that is required of the program is to know the file name, its size and attributes in order to transfer this data to the file system, which will provide access to the desired file. The same thing happens when writing data to a medium: the program transfers information about the file (name, size, attributes) to the file system, which saves it according to its own specific rules.

To better understand, imagine a librarian giving a book to a client based on its title. Or in reverse order: the client returns the book he read to the librarian, who places it back into storage. The client does not need to know where and how the book is stored; this is the responsibility of the establishment's employee. The librarian knows the rules of library cataloging and, according to these rules, searches for the publication or places it back, i.e. performs its official functions. IN in this example a library is a storage medium, a librarian is a file system, a client is a program.

Basic File System Functions

The main functions of the file system are:

  • placement and organization on a data carrier in the form of files;
  • determining the maximum supported amount of data on the storage medium;
  • creating, reading and deleting files;
  • assigning and changing file attributes (size, creation and modification time, file owner and creator, read-only, hidden file, temporary file, archive, executable, maximum length file name, etc.);
  • determining the file structure;
  • directory organization for logical organization of files;
  • file protection in case of system failure;
  • protecting files from unauthorized access and changing their contents.

Information recorded on a hard drive or any other medium is placed there on the basis of a cluster organization. A cluster is a kind of cell of a certain size into which the entire file or part of it fits.

If the file is cluster size, then it only occupies one cluster. If the file size exceeds the cell size, then it is placed in several cluster cells. Moreover, free clusters may not be located next to each other, but may be scattered over the physical surface of the disk. This system allows you to make the most efficient use of space when storing files. The task of the file system is to distribute the file when writing into free clusters in an optimal way, and also to assemble it when reading and give it to the program or operating system.

Types of file systems

During the evolution of computers, storage media, and operating systems, a large number of file systems have come and gone. In the process of such evolutionary selection, today the following types of file systems are mainly used to work with hard drives and external storage devices (flash drives, memory cards, external hard drives, CDs):

  1. FAT32
  2. ISO9660

The last two systems are designed to work with CDs. File systems Ext3 and Ext4 work with operating systems on Linux based. NFS Plus is a file system for OS X operating systems used on Apple computers.

The most widely used file systems are NTFS and FAT32, and this is not surprising, because... they are designed for Windows operating systems, which run the vast majority of computers in the world.

Now FAT32 is being actively replaced by the more advanced NTFS system due to its greater reliability in data safety and protection. Besides latest versions Windows OS will simply not allow itself to be installed if the partition hard drive will be formatted in FAT32. The installer will ask you to format the partition to NTFS.

The NTFS file system supports disks with a capacity of hundreds of terabytes and a single file size of up to 16 terabytes.

The FAT32 file system supports disks up to 8 terabytes and a single file size up to 4GB. Most often, this FS is used on flash drives and memory cards. It is in FAT32 that they format external drives at the factory.

However, the 4GB file size limitation is already a big disadvantage today, because... Due to the distribution of high-quality video, the file size of the movie will exceed this limit and it will not be possible to record it on the media.

Share.

The computer is used to store, transform and visualize information that is stored on disk in the form separate files. File- a named memory area located on external media (floppy disk, hard disk, CD). Another definition can be given: file- this is a section of external media where data is stored.

The file can store a wide variety of data: text, calculation results, graphic images, pictures, games, programs - machine instructions in binary code. Each file has a name that consists of two parts separated by a dot. The file name includes:

Actually file name no more than eight characters long under DOS and no more than 255 characters under Windows control;

- dot;

- file name extension, indicating the type of information stored in the file; The file name extension can be any convenient for the user or absent altogether. However, there are also standard extensions. For example, files with extensions exe And com- these are ready-to-execute programs in machine codes (instructions) that can be directly launched for execution. File with extension bat- This batch file, the purpose of which is to execute a group of MS-DOS commands stored in it as text. Extensions pas, s, cpp, bas, for usually contained in the names of files with program texts in the corresponding programming languages ​​- Object Pascal, C, C++, BASIC, Fortran. Files with text information usually have an extension txt. File created using text WORD editor, the extension will be assigned doc. Extension xls assigned to files created using electronic EXCEL tables. Image files can be distinguished by their extensions gif, pcx, pic, music files- by extensions mp3 And wav, and extensions avi And dat correspond to files with video information. Hypertext page files downloaded from global network Internet, contain extensions in their names htm And html.

The following characters cannot be used in the file name and extension: \ /, : * ? >< | ". Кроме того, ряд имен файлов задействован для служебных целей: prn (имя зарезервировано для принтера), com1, com2, com3, com4 (имена зарезервированы для четырех последовательных портов), lpt1, lpt2 (имена двух параллельных портов, к ним обычно подключаются принтеры), con(устройство консоль, клавиатура при вводе, дисплей при выводе), nul (фиктивное устройство) . Never use them for any other purpose, even if they are then expanded. Names like CON.TXT are truncated to CON and treated as the device name

To determine the location of the file, you must specify the name of the drive on which it is located. The disk name consists of two characters: a Latin letter defining the disk name, and the ":" character. The first floppy drive is named A:, second (if available) - name IN:. The hard drive is usually divided into several logical drives, the first of which has the name WITH:, second - D: etc. The following letters are intended to indicate the names of the CD drives.

So the entry A:format.com indicates that there is an executable file on the floppy disk called format.com.

Disks can store thousands and tens of thousands of files. It is very difficult to remember the purpose of each of them. In connection with this problem, when developing the ideology of the file system, the concept of a directory (folder) was introduced.

Directory (folder)- a group of files united according to some logical principle.

If we are talking about a file stored on a specific disk, then, in addition to the disk name, you need to know where exactly the file is located on the disk. It can be located directly on the disk or placed in one of the directories on this disk. Inside a directory, in addition to individual files, there may be other directories. Let's look at an example. Let it be on disk D: there are catalogs TP(here are the files necessary to work with the TURBO PASCAL programming system), directory PCX(programs for working with graphic images), catalog STUD(catalogue of student works) and files abc.pas And rc.pcx. Inside the catalog TR there are catalogs BGI And BIN. Inside the catalog STUD there is a file abc.pas(Fig. 2.1).

So there are two files named abc.pas. How to understand which one we are talking about? To do this, in addition to the disk name, you must specify the name of the directory in which the file is located:

D:\STUD\abc.pas- file abc.pas located on disk D: in the catalog STUD;

D:\abc.pas- file abc.pas, located directly on the disk D:.

And in order to access the file turbo.exe, you must indicate that this file is on disk D: in the catalog TR, in a subdirectory BIN, i.e. need to know path to this file. Therefore, if we know the file name and path to it, we can write full file name.

For example, the full file name trip.chr, - D:\TP\BGI\trip.chr.

When working on a PC, there is often a need to move from one directory to another. The directory we are currently in is called the current directory. If only the file name is specified, then it is a file from the current directory. To access a file from another directory, you must specify the full file name. For example, record D:trip.chr means accessing a file from the current directory of the disk D:, A - D:\STUD\abc.pas- to a file that is located in a directory that is not the current one. If during work we do not enter any directory on the disk, then they say that we are in head directory of the disk. To specify the head directory, you must specify the "\" symbol after the disk name. (C:\;D:\). D:\rc.pcx And D:\abc.pas- files located in the head directory of drive D:.

In all the examples discussed above, we were talking about accessing a single file. What to do if you need to access a group of files? There is no point in accessing each file individually, because it is possible to access a group of files of the same type. To do this, use special wildcard characters (masks) - * and ?.

A question mark replaces one character in a file name. For example, E:a?.pas(all files in the current directory of the disk E: with extension pas, the file name consists of two characters and begins with the character a); a??b.txt(all files with extension txt, first character of the file name a, the last one is a symbol b, file name length is 4 characters, files are in the current directory of the current drive).

The * character can be used to replace multiple characters. It can be used to replace one or all characters of a file name and its extension. Starting from the position where the asterisk is entered, it replaces all remaining characters. For example: D:\TP\*.txt(all files with extension txt, located in the directory TP disk D:); C:R*.pas(all files with the pas extension whose names begin with the symbol R, located in the current directory of the disk WITH:); D:\abc.*(all files named abc root directory of the disk D:).

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

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

File system is a functional part of the operating system that performs operations on files. The file system allows you to work with files and directories (directories) regardless of their 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 kind of virtual representation of external storage devices, allowing them to work not at a low level of physical device control commands, but at a high level of data sets and 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. It is very convenient to store data and user programs separately from system programs (OS), because the OS can “fly off the computer.”

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

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

Logical drives (partitions) are designated 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 the location of the beginning and end of this section and the number of sectors in this section (location and size) are indicated.

File structure of a logical drive

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

Elements file structure:

    starting sector (bootstrap, Boot sector);

    table placementfiles (FAT – File Allocation Table);

    root directory (Root Directory);

    data area (remaining free disk space).

Boot-sector

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

The boot sector contains service information:

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

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

    FAT table size;

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

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

The boot sector contains the boot block (bootloader) - the 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 throughout 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

Subject: "File System Objects"

Lesson objectives:

    Form an idea of ​​a file as an object.

    Form an idea of ​​the file name as a means of designating this object;

    Introduce students to naming some files;

    Form an idea of ​​file name extensions.

    Consider the main categories of files.

Pedagogical objectives of the lesson:

To teach how to perform standard actions with files and folders using menu commands and toolbars, to systematize technological methods of working in the operating environment.

Requirements for the level of mastery of educational material after completion of the lesson:

Have an idea that a FILE is information stored in long-term memory as a single unit and designated by a name.

Understand that a file name consists of two parts. The name of the file is chosen by the person who creates it. The extension is usually automatically set by the program that creates the file and indicates the file type.

Understand that all files are stored in a specific system: in folders, which in turn can be nested in other folders and so on.

Key concepts: file, filename, folder

Lesson plan:

    Organizational moment (1-2 min).

    New material on the topic in the form of a heuristic conversation (9-12 minutes).

    Physical exercise (2-3 min).

    Computer workshop (10 min).

    Generalization and summing up.

    Homework (2 -3 min)

All programs and data in computer memory and on disks are stored in the form of files. A file is information stored in long-term memory as a single unit and designated by a name.

The file name consists of two parts: the name itself and the extension.

The name of the file is chosen by the person who creates it. In OS Windows name The file can have up to 255 characters, it can use letters of the Latin and Russian alphabets and some other symbols. The file name must not include the following characters:

/ \ ; * ? ‘’ |

The extension is usually automatically set by the program you are working in and indicates the file type (although the user can specify non-traditional extensions). It tells the user and the computer what information is stored in the file and what program created the file. Most often, the extension consists of three letters of the Latin alphabet. The extension is separated from the name by a dot.

There are a large number of file types:

Executable – files containing programs ready for execution; they can be recognized by the extensions com, exe;

Text documents– have extensions txt, doc, rtf;

Graphic – files containing images; their extensions are bmp, jpg, etc.

The hard drive of one computer can store a huge number of files – tens and even hundreds of thousands. To avoid confusion, all files are stored in a specific system: in folders, which, in turn, can be contained in other folders (be nested) and so on. Suppose there are several games recorded on the computer’s hard drive. The game is a collection of files. Each game is stored in a separate folder, while all folders with games can be nested in one for convenience shared folder with the name Games.

File storage systems are reminiscent of storing a large number of books in a library:

Open a folder by double-clicking on its icon. Double-clicking on the files icon opens the corresponding file.

While working on a computer, operations with files such as modification, copying, deleting, moving are most often carried out. Here you can also draw an analogy with books in a library:

When working with files you should not:

Delete a file without determining whether it is necessary to do so.

Give a file a name that does not explain its contents.

Save the file in a folder where it will be difficult to find later.

Delete or move files located in application program folders - this may cause the programs to stop working.

Conclusion:

A file is information stored in long-term memory as a single unit and identified by a name.

The file name consists of two parts. The name of the file is chosen by the person who creates it. The extension is usually automatically set by the program that creates the file and indicates the file type.

To avoid confusion, all files are stored in a specific system: in folders, which in turn can be nested in other folders and so on.

Questions and tasks:

    What is a file?

    What parts does a file name consist of?

    What rules should you follow when writing a file name?

    Describe the disk file storage system.

    What operations can be performed with files?

    What actions should I avoid when working with files?

Computer workshop:

    Take yours workplace at computer.

    Double-click the left mouse button to open the My Computer window.

    Make sure that the View menu has the Large icons checkbox turned on.

    Double-click on the hard drive C: icon and view its contents.

    Find the My Documents folder and open it by double-clicking on the corresponding icon.

    In the My Documents folder, find the Beginning.doc file. Open it by double clicking. Read and follow the instructions contained in the file (close the window by clicking the close button).

    Find the My Documents folder on your Desktop and open it.

    Open the 6th grade folder, nested in the My Documents folder. Consider its contents.

    Open the Blanks folder, nested in the 6th grade folder. Execute the command View – Table. Review the information provided for each file.

    Place file icons in alphabetical order. To do this, place the mouse pointer in a blank area of ​​the Preparations window and right-click (call the context menu). Run the command (arrange icons by name).

    Arrange file icons in ascending order of file size (arrange icons by size)

    Organize icons by file type.

    In the 6th grade folder, create your own folder in which all your work will be stored. To do this, move the mouse pointer to a clean area of ​​the 6th grade window and right-click (call the context menu). Run the Create – folder command and enter your last name as the name of the new folder. Make sure your last name is spelled correctly and press Enter.

    Go to the My Documents folder. Close the My Documents folder window

    • Now we can:

      Open and close folders;

      Organize the contents of a folder - files and subfolders.

      Files and file system

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

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

      File name. The file name consists of two parts, separated by a dot: the actual file name and the extension that determines its type (program, data, and so on). 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 (Table 4.2).

      Different operating systems have different filename formats. In the MS-DOS operating system, the file name itself must contain no more than 8 letters of the Latin alphabet, numbers and some special characters, and the extension consists of three Latin letters, for example: proba.txt

      In the operating room Windows system The file name can be up to 255 characters long, and you can use the Russian alphabet, for example: Information units.doc


      File system. On each storage medium (flexible, rigid or laserdisc) a large number of files can be stored. The order in which files are stored on disk is determined by the file system used.

      Each disk is divided into two areas: a file storage area and a directory. The directory contains the name of the file and an indication of where it begins on disk. If we draw an analogy between a disk and a book, the file storage area corresponds to its contents, and the directory corresponds to the table of contents. Moreover, a book consists of pages, and a disk consists of sectors.

      For disks with a small number of files (up to several dozen) can be used single-level file system, when the directory (disk table of contents) is a linear sequence of file names (Table 4.3). Such a catalog can be compared to the table of contents of a children's book, which contains only the titles of individual stories.

      If hundreds and thousands of files are stored on the disk, then for ease of searching, use multi-level hierarchical file system, which has a tree structure. Such a hierarchical system can be compared, for example, with the table of contents of a given textbook, which is a hierarchical system of sections, chapters, paragraphs and points.

      The initial, root directory contains subdirectories of the 1st level, in turn, each of the latter can contain subdirectories of the 2nd level, and so on. It should be noted that files can be stored in directories of all levels.

      For example, the root directory may contain two 1st level subdirectories (Directory_1, Directory_2) and one file (File_1). In turn, in the 1st level directory (Directory_1) there are two subdirectories of the second level (Directory_1.1 and Directory_1.2) and one file (File_1.1) - fig. 4.21.

      File system is a file storage and directory organization system.

      Let's look at a hierarchical file system using a specific example. Each disk has a logical name (A:, B: - floppy disks, C:, D:, E: and so on - hard and laser disks).

      Let the root directory of drive C: have two 1st level directories (GAMES, TEXT), and the GAMES directory have one 2nd level directory (CHESS). At the same time, in the TEXT directory there is a file proba.txt, and in the CHESS directory there is a file chess.exe (Fig. 4.22).

      The path to the file. How to find existing files (chess.exe, proba.txt) in a given hierarchical file system? To do this, you need to 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 required file. The paths to the above files can be written as follows:

      The path to the file along with the file name is sometimes called full name file.

      Example of a full file name:

      With \GAMES\CHESS\chess.exe

      Presentation of the file system using a graphical interface. The MS-DOS hierarchical file system containing directories and files is represented in the Windows operating system through a graphical interface in the form of a hierarchical system of folders and documents. A folder in Windows is analogous to an MS-DOS directory

      However hierarchical structure These systems are somewhat different. In the MS-DOS hierarchical file system, the top of the object hierarchy is the root directory of the disk, which can be compared to the trunk of a tree on which branches (subdirectories) grow, and on the branches are leaves (files).

      In Windows, at the top of the folder hierarchy is the folder Desktop. The next level is represented by folders My computer, Trash And network(if the computer is connected to local network) - rice. 4.23.

      2. By selecting one of the menu items View (Large Icons, Small Icons, List, Table), you can customize the presentation form of the folder contents.

      Folder network contains folders of all computers connected to this moment to the local network.

      Folder Basket temporarily contains all deleted folders and files. If necessary, removed and stored in Cart folders and documents can be restored.

      3. To permanently delete files, you must enter the [File-Empty Trash] command.

      Operations on files. While working on a computer, the following operations are most often performed on files:

      • copying (a copy of the file is placed in another directory);
      • moving (the file itself is moved to another directory);
      • deletion (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, the so-called file managers : Norton Commander, Windows Commander, Explorer, etc.

      In some cases it becomes necessary to work with the interface command line. Windows provides a mode for working with the MS-DOS command line interface.

      Command Line Interface

      1. Enter the command [Programs-MS-DOS Session]. The application window will appear MS-DOS session.

      When prompted by the system, you can enter MS-DOS commands from the keyboard, including:

      • commands for working with files (copy, del, rename, etc.);
      • commands for working with directories (dir, mkdir, chdir, etc.);
      • commands for working with disks (format, defrag, etc.).

      2. There are dozens of MS-DOS commands, and each command has its own format and parameters, which are quite difficult to remember. In order to receive background information by command, you must enter the /? key after the command name.

      For example, to get help with the format command, at the system prompt you would type: C:\WINDOWS>format/?


      Questions to Consider

      1. Which element is the top of the hierarchy in the MS-DOS file system? IN graphical interface Windows?

      Practical tasks

      4.11. Copy files using the command line interface and file manager.

      4.12. View the capacity of your computer's disks, as well as the amount of used and free space.

      4.13. Familiarize yourself with the format of the dir command. View the root directory of drive C.