Hard disk partitions and file systems. Basic concepts and basics of work


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 provides 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 are solved disk space and data management;

· 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 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 a 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 slow work with 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, 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 first cluster number of 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 new implementation ideas for 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, date last access, check sum

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. The 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 into memory all other necessary software modules and data blocks.

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 last check partition with 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, while records of each specific file located (if possible) in adjacent sectors and close to data on 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

The NTFS (New Technology File System) 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 you can work directly only 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 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 is 65 thousand various characters) and look for large and small equivalents in in this case- 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 a special file that 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 to both local registration users on computers with NT, and during 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 start of a change operation 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 structure external memory. The best known are the traditional UNIX System V (s5) file system and the UNIX family BSD(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. (Recall that the placement of this block in system device block zero is determined by the hardware, since the hardware boot loader always accesses system device block zero. 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

· the 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 it is created new element list of free blocks (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 at the 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 bytes?)

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;

For these three categories, three actions are regulated: reading from a file, writing to a file and executing a file (in the mnemonics of the R, W, X system, 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 i-node ( serial 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,
  • coordinated processing of 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 in 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 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 the setgid bit set, then created files inherit the group identifier of that directory, and subdirectories inherit the group identifier 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 optimization of 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.

Hello friends.

Do you know what in your computer is responsible for distributing and storing the information you enter? File systems hard drives. I suggest you learn more about them in order to do right choice between their types and better understand the organization of space on hard drives.

What is a file system?

This concept means the order of organization, storage and naming of files on various media, in our case on hard drives. The file system determines the format, volume and naming features of their contents.

It is the link between the hard drives and the program interface (API). When a program accesses a file, it does not know in what order its elements are located and where exactly it is located. She sees only its name, size and attributes, that is, what the FS drivers show her.

In general it can be defined as:

  • Complex hard disk contents;
  • A set of system software that manages files (reading, writing, deleting, searching, accessing, etc.);
  • Groups of service information structures (for example, directories or file descriptors, disk space allocation tables, etc.).

Let's look at the file system from the OS side. Imagine a checkered notebook. This is the HDD, and the cells are clusters - zones of at least 512 MB for data storage. Figuratively speaking, the file system represents the text of this notebook, and the files are words.

Systems come in different types. Knowing them can be useful to you when formatting a hard drive or installing an operating system. Are you using Windows? Then you will need to choose between the FAT family and NTFS.

FAT

The abbreviation stands for File Allocation Table, which translates as a file allocation table. Bill Gates and Mark McDonald released this system in 1977 for DOS and Windows operating systems.

It has 4 subspecies: 12, 16, 32 and ex. The numbers indicate the number of bits that one cluster occupies. The first subtype is used for floppy disks, and the last one is used for flash drives. Mostly 16 and 32 bit systems are installed on hard drives.

The 16-bit version is considered obsolete. She assumes maximum size files of 2 GB and a limit on the number of characters in their names. Therefore, if you are going to install a system of this family, choose FAT32. You can record files with a capacity of 4 GB, and with long names.

Minuses

FAT is supported by different operating systems, is considered the simplest, and has several disadvantages:

  • Selects free disk space from beginning to end only. What does it mean? When you create a new document, or, for example, increase the contents of a folder, the system places them in the very first free cluster in the table. But as you work, you constantly delete some files and write others, right? Consequently, clusters are released in different parts, and new documents are superimposed chaotically. Therefore, the disk has to spend more and more time searching necessary information according to your request.

  • It does not have options such as storing user information or setting access restrictions to documents.
  • Does not prevent data corruption due to incorrect termination working on a computer.

NTFS

A more modern and high-performance system than the previous one. This is inherent in the abbreviation itself, which stands for New Technology File System (from English, New Technologies). It was released on July 23, 1993 for Windows NT operating systems.

Differences between NTFS and FAT:

  • By default, there are options for separating access to data for several users;
  • There is an option to assign quotas to the maximum amount of disk space that a particular user can occupy;
  • A transaction logging system is used, so you can restore data after an incorrect session termination;
  • The main feature for many is that file sizes are not limited.

Where can I see what FS you have now?

Click right click mouse on the hard drive. A list will appear in which select the very last item - “Information”. A window will open with the “General” tab expanded. It contains the necessary information.

File systems for other operating systems

Since other operating systems are used less frequently than Windows, I will not go into detail, but will give only the main information.

Are you using Linux? You should know that this operating system supports many file systems, including those designed for Windows. But for more correct operation You should choose products designed specifically for Linux. Currently the most popular are Ext4, ReiserFS and XFS.

Do you have Mac OS X installed? In this case, file systems for Windows (FAT32, exFAT and NTFS) are also suitable. The native one is HFS+, which is the main one for Apple computers.

And in addition, I will give a small compatibility plate:

That's all.

Visit me more often to learn a lot of interesting, and most importantly useful, things about your computer.

File systems

Information on disks is recorded in fixed-length sectors, and each sector and the location of each physical record (sector) on the disk is uniquely identified by three numbers: the disk surface, cylinder, and sector numbers on the track. And the disk controller works with the disk in exactly these terms. And the user wants to use not sectors, cylinders and surfaces, but files and directories. Therefore, the operating system or other program must translate operations with files and directories on disks into actions understandable to the controller: reading and writing certain sectors of the disk. And to do this, it is necessary to establish the rules by which this translation is carried out, that is, first of all, to determine how information should be stored and organized on disks.

A file system is a set of conventions that define the organization of data on storage media. Having these conventions allows the operating system, other programs, and users to work with files and directories

The file system defines:

1. how files and directories are stored on the disk;

2. what information is stored about files and directories;

3. how can you find out which parts of the disk are free and which are not;

4. format of directories and other service information on the disk.

To use discs written with a file system, the operating system or special program must support that file system.

Information is stored mainly on disks, and the file systems used on them determine the organization of data on hard magnetic disks.

The operating systems of the MS Windows family use the following file systems - FAT, FAT 32, NTFS.

File system FAT

FAT is the simplest file system supported by Windows NT. The basis of the FAT file system is the file allocation table, which is located at the very beginning of the volume. In case of damage, two copies of this table are stored on disk. In addition, the file allocation table and root directory must be stored in a specific location on disk (to correctly determine where the boot files are located). A disk formatted with the FAT file system is divided into clusters, the size of which depends on the size of the volume. Simultaneously with the creation of the file, an entry is created in the directory and the number of the first cluster containing the data is set. Such an entry in the file allocation table signals that this is the last cluster of the file, or points to the next cluster.

Updating the file allocation table is important and time consuming. If the file allocation table is not updated regularly, it may result in data loss. The duration of the operation is explained by the need to move the read heads to the logical zero track of the disk each time the FAT table is updated. The FAT directory has no specific structure and files are written to the first available free space on the disk. In addition, the FAT file system only supports four file attribute: "System", "Hidden", "Read Only" and "Archive".

On a computer running Windows NT, you cannot undo the deletion on any supported file system. The undelete program attempts to access the hardware directly, which is not possible with using Windows N.T. However, if the file was located in a FAT partition, then by starting the computer in MS-DOS mode, deletion of the file can be canceled. The FAT file system is best for use on disks and partitions up to 200 MB in size because it runs with minimal overhead.

As a general rule, you should not use the FAT file system for disks and partitions larger than 200 MB. This is because as the volume size increases, the performance of the FAT file system degrades quickly. Permissions cannot be set for files located on FAT partitions. FAT partitions have a size limit: 4 GB for Windows NT and 2 GB for MS-DOS.

Instructions

The file system defines the way data is organized and stored on various storage media, including hard drives. There are a large number of different file systems, the most common are: FAT16, FAT32, NTFS for operating systems of the Windows family; ext2 and ext3 for Unix systems and, in particular, for the operating system systems Linux.

Find out the file type systems Can different ways. The simplest one: open “My Computer”, select the disk you are interested in, right-click it and select “Properties” from the menu. In the window that opens, the disk type and the file system used will be indicated at the top. For example, for Windows XP and Windows 7 the file type will be indicated systems NTFS.

If you have an inoperative computer that refuses to boot, you can view information about its disks using Acronis programs Dick Director. It runs directly from the CD, to select boot from the disk, press F12 after starting, a boot device selection window will appear in front of you. On some computers, the boot window may be called up using other keys.

Select boot from CD and press Enter. In the disk menu that appears, select Acronis Dick Director. After loading, a program window will open in which you will see all the computer’s disks and their partitions, indicating the file systems used. Acronis Dick Director is a very convenient utility that allows you to partition disks in the right way and format them in the required file system. It also allows you to restore disk partitions with a high degree of probability after their accidental loss - you can restore disks with all folders and files.

There is a version of the Acronis Dick Director program that runs under Windows, in which you can also view all information on file systems. But it is not recommended to perform any operations with disks in this version - after rebooting systems There is a fairly high risk that the computer will refuse to boot at all. If you need to partition your disk, use the CD version, it is very reliable.

Sources:

  • How can I find out what file system I have?

From file hard systems The disk depends on many computer operating parameters. For example, if you are going to download large-capacity files (more than four gigabytes) from the Internet, then your hard drive must be running NTFS. Also, the speed of writing files to the file system depends on the type of file system. HDD and the speed of copying information from partition to partition.

You will need

Instructions

Using this method you can find out the file type systems regardless of your Windows versions. Open My Computer. Right-click on the hard drive partition. A context menu will appear. From this menu, select Properties. Next, look for the line “File system”. The file type will be written next to it. systems this partition of the hard drive.

Also find out the file type systems you can use the PartitionMagic program. This program is suitable for both owners of Windows operating systems and those users who have the Linux operating system installed. Find it on the Internet, download and install it on your computer’s hard drive.

Launch PartitionMagic. Wait a moment until the computer scanning process is completed. In the main program window you will see a list of all partitions on your hard drive. By going to the “Properties” section, you can view the file .

You can also use the TuneUp Utilities 2011 computer monitoring and configuration program to view information. It can be easily found on the Internet. Although the program is commercial, there is a trivial period of use. Download and install the application on your computer.

Launch TuneUp Utilities. Wait a while. When the program is launched for the first time, it begins scanning your computer. After scanning, you will be prompted to fix errors and optimize the system. If you have time, you can agree. Or cancel this procedure.

After this, you will find yourself in the main menu of the program. Select the “Fix problems” section, then in the next window - “Show system information”. After a few seconds, the “System Informer” window will appear. In this window, select the “Disks” section. In it you can find information about the file system.

When choosing software for your computer you need to know type, or its bit depth. In particular, the system can be 32 or 64 bit. These terms basically refer to the way the central processing unit processes data. However, the software for 32-bit systems may be incompatible with 64-bit and vice versa. To know type systems can be found in the documentation. If documentation is missing, run the following actions.

You will need

  • Computer running Windows operating system (XP, Vista, Windows 7) or Server 2003

Instructions

In order to determine systems in the Windows XP or Server 2003 operating system, open the "Properties" information window systems"(tab in the "System" application). It's in the Control Panel folder, in the Start menu (you can also open the Run dialog box from the Start menu, "sysdm.cpl" and press Enter).

In the application that opens, explore the “Properties” tab systems" If you have a 32 OS, you won't find any mention of this. But in 64-bit systems the bit depth is indicated. For example, the name of your systems may look like this: MS XP Professional x64.

If you want to make sure that you have defined type systems, open the Run window from the Start drop-down menu, type "winmsd.exe" and press Enter. On the right side of the application that opens next, find the line “Processor”. If the line before the name says "x86", you have a 32-bit OS. If the processor name begins with ia64 or AMD64, then your system is 64-bit.

If you have Vista or Windows7 installed, then to determine type systems on these operating systems, open and explore the “System” window, which is located in the “Control Panel” directory. Open the Start button menu. In "Start Search" write "system" and then click on "System" in the "Programs" list. In the window that opens, open “Type systems" If your OS has 32, you will see a corresponding inscription starting with the phrase “32-bit...”. Accordingly for 64- systems the inscription will begin with “64-bit...”.

Apart from this, you can also explore the System Information information window. To do this, open the Start menu and enter “system” into the search. Then click System Information under Programs. In the window that opens, find “Type systems" in the "Element" subsection. Here you can type systems according to the inscriptions: “x86-based” (32-bit OS) or “x64-based” (64-bit OS).

Video on the topic

Sources:

  • how to change 64 in the system

When you work with a computer, you are always dealing with files. A file is a named volume of information. Information can be considered texts, media, and service data that the computer needs to operate.

To successfully process information, it needs to be systematized. This is what file systems do. Their purpose is to provide the ability to conveniently work with data and organize the sharing of files among several processes or users.

A person with computer experience will not store documents, movies and games in one folder, which is offered to him by default. It is more convenient to group data according to some criteria and place them in the appropriate sections. These sections are called directories.

From a file system point of view, a directory is a list that contains information about a group of files. This can be the name of the file, the name of its owner or creator, the physical address on the disk, the characteristics of “read-only”, “hidden”, “archive”, time of creation and modification, type (character, binary, temporary), etc.

One of the main tasks of the FS (file system) is the optimal placement of data on the disk. This means that disk space should be used economically, and searching and recording information should occur as quickly as possible.

The FS is written to the hard drive partition during formatting. One hard drive can contain several file systems. The choice of FS depends on which operating system will be installed on the logical disk.

For OS Windows, NTFS and, less commonly, FAT32 are used.

A logical drive larger than 32 GB cannot be formatted in FAT322 - a limitation imposed by Microsoft developers. In addition, this system can work with files no larger than 4 GB.

There is one more significant drawback: FAT32 does not log, i.e. recording data operations and system state changes.

On the other hand, the advantage of FAT32 is its relatively high performance and low hardware requirements: 32 MB of RAM is enough for it normal operation.

The size of the logical disk that can be formatted in NTFS is 2,000,000 GB. This file system is characterized by stable operation due to journaling and information processing methods. All operations with data are carried out by a transaction, i.e. the action either completes correctly or is cancelled. Failures are recorded in the event log, from where the system takes information for self-healing.

The disadvantage of NTFS is fragmentation of hard disk. The built-in defragmentation program practically does not solve the problem due to the peculiarities of recording information on the hard drive.

In the process of improving computer technology, store at different times information accounted for on different media. The modern market is dominated by the so-called hard disks. Sometimes it becomes necessary to find out the brand of the hard drive connected to your computer, the nominal capacity, free space, and so on.

You will need

  • A computer with MS Windows OS, administrator rights for your user account, connected and correctly installed disks or other removable media.

Instructions

Go to "My Computer". Click on the "Local Disk (C:)" icon and right-click. In the opened context menu select "Properties". The properties window will open local disk, containing the most basic information about its status, including free space, nominal size, file system type, and others. You can also clean up the disk using MS Windows to increase free space.

In the local disk properties window, click on the "Hardware" tab. You will see a list of your computer's available disk drives, including the hard drive, CD-DVD ROM drives, virtual drives, and floppy drives floppy disks, and the mentioned hard drive will be the first in the list. Having selected it with a mouse click, click on the "Properties" button. The physical disk properties window will open, where you can find general information about it, define the data caching policy, and also see which driver controls its operation.

note

When a free space approaches on any of the local disks At a minimum, disk cleanup starts spontaneously. This is not dangerous, but it is better to avoid such a situation.

Helpful advice

You can get to the hard drive properties from the properties of other drives; to do this, just go to the “Hardware” tab. In addition, in order to avoid destabilization of the system, sometimes the disk needs to be scanned for errors and defragmented, so do not bypass the "Service" tab.

Each type of hard drive file system is unique in its own way. The most popular types NTFS and FAT32 have a number of differences. Sometimes you need a specific file system for a hard drive partition.

You will need

  • Partition Manager, Windows disk.

Instructions

Paste installation disk Windows and start your computer. Press Del to enter BIOS. Open Boot menu Device Priority and designate your drive as a priority device. Select Save & Exit.

Run the operating system installer. Wait until the installation process reaches the partition selection menu. This is where the fun begins. If you are installing Windows XP, then select the partition on which the OS will be installed and in the next window set the “Format to type” option, where the word type means the file system type.

If you are dealing with a Windows Vista or Seven installer, then click the “Disk Setup” button. Select the partition whose file system type you want to change and click the Delete button. Now click the “Create” button, then specify the size of the future local disk and the type of its file system.

Now let's look at changing the partition file system without resorting to Windows. Download and install the Partition Manager program. In the main menu of the program, select “Launch Partition Manager”. At the top you will see a list of hard drive partitions. Right-click on the partition for which you want to change the filename system.

Select "Convert file" system" Specify the cluster size and type of future file system. Click the "Convert" button.

Video on the topic

Sources:

  • how to change disk file system to ntfs

Tip 7: How to recover files after formatting a flash drive

If you accidentally formatted external USB drive, then try to return what is important to you files. For such cases, special programs have been developed that carry out the process of searching for deleted data.

You will need

  • - Easy Recovery.

Instructions

Please note that under no circumstances should you write any information to this USB drive. The more intensively you use after formatting, the less chance you have of restoring the necessary files. Download and install the Easy Recovery application. For this purpose use system partition hard drive.

Connect the formatted USB drive to the appropriate port on your computer or . Launch the Easy Recovery program. In the quick launch menu, select Data Recovery. In the window that opens, select the Format Recovery menu. In the left window of the program, select the desired USB drive. Be sure to specify the previous file system type of this . Click Next.

Wait a while while the utility collects information about files previously stored on this USB drive. This process can take quite a long time. Much depends on the performance of your computer and the speed of the flash drive you are using. Wait for the new menu to appear.

Now check the boxes files that need to be restored. If you want to return all available information, then simply select the topmost folder in the left menu. Click Next. Specify the hard drive partition and folder into which deleted files will be restored files. Click Next again and wait for the information recovery process to complete.

If you need to restore documents of a certain type, then in the Quick Launch panel, select the File Repair menu. Select the document type from the menu that opens. It can be text documents, tables and , created using the programs included with Microsoft Office. Follow a similar algorithm to find and recover lost data.

note

Data recovery after hard formatting disk. If data is lost, many people want to perform hdd recovery or flash drive recovery. To learn how to convert the file system of a flash drive from FAT to NTFS, read the article - how to format a flash drive to NTFS. Later I will write an article about how to recover deleted files using powerful free program. so as not to miss.

Helpful advice

The R-Studio program is perfect for recovering data from a flash drive - DOWNLOAD. After launching the program, we immediately see a list of your storage devices. Select your flash drive and click on the “scan” button to start searching for lost files. Recovering data from a flash drive. And finally, here are the deleted files that the program was able to find on the flash drive. The found data will be presented in folders by file type, you just have to select required file, deleted during formatting or...

File system. Discs

A computer usually has several disks. Each disk is assigned a name, which is specified by a Latin letter with a colon, for example, A:, B:, C:, etc. It is standardly accepted that A: and B: are floppy disk drives, and drives C:, D:, etc. – hard drives, optical drives or electronic disks.

Electronic disks are a part of RAM, which to the user looks like VRAM. The speed of information exchange with an electronic disk is much higher than with an electromechanical external storage device. When electronic disks operate, there is no wear on electromechanical parts. However, after turning off the power, the information on the electronic disk is not saved.

Physically existing magnetic disks can be divided into several logical disks, which to the user will appear on the screen in the same way as physical disks. Logical drive is a part of a regular hard drive that has its own name.

The disk on which the operating system is recorded is called systemic(or boot) disk. Hard drive C: is most often used as a boot disk. When treating viruses or system failures, the operating system is often loaded from a floppy disk. Optical discs are available that can also be bootable.

In order for the new magnetic disk information could be recorded, it must be pre-formatted. Formatting- This is the preparation of a disk for recording information.

During formatting, service information is written to the disk (marking is done), which is then used to write and read information, correct the disk rotation speed, and also allocate a system area, which consists of three parts:

boot sector,

file allocation tables,

root directory.

Boot sector(Boot Record) is located on each disk in logical sector number 0. It contains data about the disk format, as well as a short program used in the operating system boot procedure.

There is an area on the hard drive called the main boot record MBR (Master Boot Record) or master boot sector. The MBR specifies from which logical drive the operating system should boot.

File Allocation Table(File Allocation Table - abbreviated FAT) is located after the boot sector and contains a description of the order of location of all files in the sectors of a given disk, as well as information about defective areas of the disk. The FAT table is followed by an exact copy of it, which increases the reliability of storing this very important table.

Root directory(Root Directory) is always behind the FAT copy. The root directory contains a list of files and directories located on the disk. Directly behind the root directory is the data.

File system is a part of the operating system that provides organization and storage of files, as well as performing operations on files.

File

Since address data also has a size and must also be stored, storing data in small units such as bytes is inconvenient. They are also inconvenient to store in larger units (kilobytes, megabytes, etc.), since incomplete filling of one storage unit leads to storage inefficiency.

Storing and retrieving information on external storage devices is important. External storage devices are a kind of information warehouses, where programs and data are stored long time, until they are needed to solve a problem. Now imagine that goods are stored in a warehouse without any system. The larger the warehouse, the more difficult it is to find the right product. Or take, for example, a cabinet in which various documents, books, reports, certificates, etc. are stored. In the absence of a specific storage organization, search necessary documents, especially if their number is significant, can be a very difficult and time-consuming task.

The unit of data storage is a variable-length object called a file.

File is a named collection of data that has a certain internal organization and occupies a certain area of ​​the information carrier.

Usually in separate file store data belonging to the same type. In this case, the data type determines file type.

Since there is no size limit in the definition of a file, you can imagine a file having 0 bytes (an empty file) and a file having any number of bytes.

The file name must be unique - without this it is impossible to guarantee unambiguous access to data. In computer technology, the requirement of name uniqueness is ensured automatically - neither the user nor the automation can create a file with a name identical to an existing one.

The file may contain: a program in machine code, program text in algorithmic language, document text, report, salary slip, article, numerical data, recording of human speech or musical melody, drawing, illustration, drawing, photograph, video film, etc.

The file is created at the user's direction or automatically, using various software systems, such as operating systems, shells, programming tools, etc. The created file is assigned a certain name, space is allocated to it on disk storage, and it is registered in the operating system in a certain way. The newly created file can be filled with some information.

Each file has a number of characteristic properties - attributes. The most important attributes of the file are:

Name,

extension,

time and date of creation.

File name, just like the name of a person, the name of a document, a book, serves to be able to distinguish one file from another, to point to the desired file. In different operating systems, file names are formed according to different rules. For example, in the MS DOS operating system, the file name is



sequence of letters of the Latin alphabet,

some special characters (~, _, -, $, &, @, %,",!,(>)> (>). #).

The name can contain from one to eight (1 ... 8) characters and is selected arbitrarily. It is advisable to select file names so that the user can easily remember what exactly is stored in this file. For example, a file containing a report for the 4th quarter can be called otchet4, a file with a salary slip can be called vedzarpl, and a file with some kind of drawing can be called picture.

In the MS DOS operating system, the file name cannot contain

spaces,

letters Russian alphabet,

In addition, it cannot contain more than eight characters. Generally speaking, these are quite significant restrictions. For example, a file containing a company’s report for the 4th quarter, which we called otchet4, would preferably be called “Report for the 4th quarter”, in extreme cases “Otchet za 4 kvartal”, using the so-called transliteration , when words of one language are written with letters of another. In operating rooms Unix systems and Windows 9.x, restrictions on the length of the name, the use of spaces and periods in the name have been removed. And in the Windows 9.x operating system, in addition, you can use Russian letters in the name. Thus, a file in Unix may be named “Report za 4 kvartal”, and in Windows 9.x the name “Report for the 4th quarter” is also allowed.

In addition to the name, each file may or may not have extension. The extension is used to characterize the contents of the file in a certain way. For example, doc extensions and txt indicate that the file contains some document or text, while the bmp extension is a file containing an image in bitmap format. The extension, if any, is separated from the file name by a dot. In the MS DOS operating system, the extension can contain from one to three characters, for example, otchet4.doc, vedzarpl.txt, picture.bmp, and in Unix and Windows 9.x systems more than three characters are allowed. If there is no extension, then there is no dot in the file name.

If a file is created using any software system, then, as a rule, it automatically receives a standard extension for this system, and the user only needs to select or specify the name. Subsequently, the software system recognizes “its” files using standard extensions. Operating systems provide a number of standard extensions (Table 3.1).

Table 3.1

Some MS DOS and Windows 9.x extensions

Files with the extension .com (common) and .exe (execute) contain programs in machine language. These files are often called program files. The differences between com files and exe files relate to their internal organization. These differences do not affect the way files are handled in any way. Files with the extension .bat (batch) contain arbitrary sequences of operating system commands. Such files are usually called batch files. Term « executable file" combines the concepts of "program file" and " batch file" In other words, an "executable file" means that the file contains either a machine language program that can be directly executed by the computer's processor (files with the .exe and .com extensions) or a sequence of operating system commands (the .bat file) that are also executed, but only by accessing the appropriate programs and operating system tools.

An important attribute of a file is its length. The file length is equal to the amount of space the file occupies on disk or tape and is therefore measured in bytes. The value of this attribute is used to determine whether a file can be placed on a free area of ​​disk media and for some other purposes.

When a file is initially written to disk, and when changes are made to the file using the system clock ( special program, included in the operating system) automatically records the time and date the file was written to the disk device. Date and time attributes are used to identify the most recent versions of a file.

In addition to the considered basic file attributes in the MS operating system DOS files have four more attributes - read-only, system, hidden and archive. Each of these attributes has exactly two states - the attribute is on or the attribute is off.

Enabling the read-only attribute means that the file cannot be modified in any way. In addition, the destruction of such a file is complicated. The system attribute is usually enabled only for the main operating system files. The hidden attribute is enabled for those files that, when viewing the list of files located on disk device, operating system commands are not included in this list.

Operating systems provide a way to make collective actions with files easier. The action that needs to be performed on a group of files is specified only once, but along with the action, not the full name of a single file is specified, but a special name that allows the operating system to recognize all the files in the group and then perform the desired action on them. This name is called a wildcard name, pattern, or mask. The group name of files is formed using the characters “*” and “?”.

The * character found in a group name is interpreted by the operating system as “any sequence of any name characters.” Thus, the group name a* corresponds to any names starting with the letter “a”: a1, azbuka, a2z4.

Symbol? is perceived by the OS as any single character, that is, it corresponds to exactly one arbitrary name character. For example, the pattern otchet?.doc matches any names with the extension .doc, in the name of which the name segment otchet is followed by exactly one character, for example, otchet1.doc, otchet4.doc, otchet%.doc, otchet#.doc, etc.

A few more examples:

Txt – files with any two-letter names and extension .txt;

*.bak – files with any names and extension .bak;

prog1.* – files with the name progl and any extension;

*.* – files with any names and any extensions.

Catalogs

To read the contents of a file, you need to know its location on the disk device. Each file occupies a specific group of sectors on the disk. Therefore, the file location can be specified by specifying sector and track numbers, busy with file. However, this method of specifying the file location is very inconvenient, since in this case the user needs to know the numbers of all disk sectors that are allocated for the file. To increase the efficiency of data exchange, several consecutive sectors are combined into cluster, and the exchange is carried out immediately by the entire group of sectors (see Fig. 2.7). This exchange organization scheme significantly increases the speed of data exchange operations with hard drives. In order not to specify three separate numbers (working surface number, track number and sector number) as the address of the sector from which the cluster begins, a single, continuous numbering has been introduced for all disk clusters. To determine the cluster in which the file begins, it is enough to specify only one number - the serial number of the cluster on the disk.

Catalog is called a disk file system table that contains a list of all files written to this disk. For each file, this table indicates the values ​​of all its attributes, as well as the number of the first cluster allocated to the file.

In terms of its purpose, a catalog can be compared to a table of contents in a book, in which the starting page number is indicated for each chapter, or to an inventory of documents stored in a filing cabinet. Just as in a book, to determine the position of a particular chapter, you can determine by the title of the chapter in the contents of the book which page it begins on, so the operating system, by the name of the file, finds in the directory the cluster in which it begins.

The analogy between the catalog and the table of contents in a book is only partial due to the fact that clusters are allocated to a file on disk not as a continuous array, but scattered, while in a book all the pages of a chapter are placed in a row. Imagine one chapter of a book taking up pages 5, 15, 16, 17, 31, 123, 124 instead of taking up pages 5, 6, 7, 8, 9, 10, 11 in a row. This non-continuous allocation of clusters to files is organized in order to optimize the use free space disk during numerous destructions and writes of files.

In order to still know which clusters and in what order are allocated for storing a file, the file system provides a file allocation table (FAT). The directory contains only the starting cluster number of the file. And the FAT table contains the numbers of all other clusters occupied by the file. In the vast majority of cases, the user does not have to work with the FAT table, since it is filled in when the file is written and analyzed automatically when it is read.

For clusters, there is linear addressing: all clusters are numbered from 1 to 2n (here n is the FAT bit capacity). For a 16-bit FAT, the number of clusters on the disk is 216 = 65536. It is not difficult to calculate that for 1 GB disks, a cluster is 32 KB.

The size of modern hard drives usually exceeds 1 GB. When writing information to such disks, a significant part of the disk space can be wasted, since, for example, in the case of 16-bit FAT, files of 31 KB and less than 1 KB each occupy the same amount of disk space - 32 KB. The unused space of a cluster is called "cluster overhang". The greater the number of small files written to the disk, the greater the loss on cluster ledges.

The most natural way to increase the efficiency of using clusters is to reduce their size. Currently the file system is FAT32, which uses 232 clusters.

Discussed above simple structure a directory in which all files form one common list can provide satisfactory operation of the operating system only in the case of small disk sizes and limits the total number of files that can be written to the disk. Thus, on a 1.44 MB floppy disk, the root directory can contain information about no more than 224 files. And when the disk space becomes large enough and, therefore, hundreds or thousands of files can be written to the disk, a simple directory structure leads to a significant slowdown in the process of searching for a file on the disk or the directory becomes full.

The directory in operating systems has a more complex structure. Arbitrary groups of directory files can be combined and form subdirectories.On some operating systems, subdirectories are called folders. In fact, subdirectories, like the root directory, are tables located on disk and containing information about the files assigned to the subdirectory. Unlike the root directory, the position of subdirectories on the disk is not tied to the system area. Therefore, the sizes of subdirectories can be quite arbitrary, which makes it possible to remove the restriction on the number of files specified in a subdirectory.

Subdirectories are created by users at their own discretion. Each subdirectory has its own name (usually without an extension), which is selected according to the same rules as the file name.

Grouping and inclusion of files in a subdirectory can be done according to any criteria. For example, in a separate subdirectory called WINDOWS (Fig. 3.3), it is advisable to collect all files related to the operating system. In the same way, it is advisable to group into a separate subdirectory all the files necessary for the operation of any text editor or game program. If several users work on a machine in turn, then it makes sense to organize separate subdirectories for each user. For example, name the subdirectories: user1, user2, user3,... (user - user), grouping the files of the first user in the user1 subdirectory, the second in the user2 subdirectory, etc. In addition to removing the quantitative restrictions associated with the use of one directory, this creates a certain orderliness when storing information on disks.

All subdirectories located in the root directory are classified as the first level. In Fig. 3.3 first-level subdirectories are the subdirectories Windows, user1, Program files. The root directory, in relation to the first-level subdirectories included in it, is called parental, and subdirectories in relation to the root are considered subsidiaries or nested.

Each first-level subdirectory, in turn, is structured exactly the same as the root one. In a first-level subdirectory, second-level subdirectories, etc., can be organized. For example, the owner of the user1 subdirectory can group within this subdirectory all the reports he has prepared into a separate subdirectory called otcheti, and, say, files containing information about business contacts, collect in the kontakti subdirectory. First-level subdirectories are considered parents to the second-level subdirectories they contain. Second-level subdirectories act as children of first-level subdirectories.

Rice. 3.3. Directory tree structure

The structure of the directory resembles a tree. The root directory can be mapped to the trunk of a tree, subdirectories act as branches, and files are the leaves of this “tree.” This directory structure is called tree-like or hierarchical.

On operating systems with graphical interface directories are displayed as folders. The figure shows the folder tree of one of the disks. From Fig. 3.4 you can see that there are four folders in the root directory: A, B, C and D. At the same time, inside folder A there are folders A1 and A2. Folder C contains folders C1 and C2. In folder A1 there is folder A11, and in the last folder there is folder A111. A cross on the tree indicates that there are other folders inside the corresponding folders (there are folders inside folders D and A12 that are not visible). This figure does not show files that can be located either in the root directory or in any folder.

Rice. 3.4. Directories as folders

The path to the file

The operating system searches for a file in a directory by its full name. This means that in principle there cannot be two different files with the same name in the same directory or subdirectory . We remind you that the name consists of the file name and its extension. It is also not allowed to have two nested subdirectories with the same names in one directory or subdirectory.

Directories or subdirectories are allowed to have files or child subdirectories with the same name. But then the file name is not enough to unambiguously indicate the desired file. In order to distinguish files with the same name, it is also necessary to indicate the subdirectories in which they are located. But in the general case, you need to specify not just one subdirectory, but the entire chain of subdirectories, which must be followed from the root directory to the subdirectory containing the file you are looking for in order to get to the desired file and determine its location.

The chain of names of subdirectories that need to be traversed, starting from the root directory and ending with the subdirectory containing the file, is called path or route to the file.

In MS DOS and Windows operating systems, the root directory in the path is indicated by the \ character. The same symbol separates the names of subdirectories in the chain from each other, as well as the file name from the name of the subdirectory in which it is located. This symbol is called back slash.

Thus, for files located in the root directory (see Figure 3.3), the path is only the root directory designator \, and the files are specified as follows:

The file in the user1 subdirectory has the path \user1:

\user1\picture.bmp.

And the path to files from the kontakti subdirectory must include the names of both subdirectories - \user1\kontakti:

\user1\kontakti\ivanov.doc,

\user1\kontakti\postavki.txt

Paths can be specified not only for files, but also for subdirectories. So, for the kontakti subdirectory the path is \user1.

Since your computer includes several different disk devices, to uniquely identify a file, you must specify which device it is located on. This can be done by specifying the name of the disk device containing the file. The name of the device is usually placed before the path to the file. Full name file (file specification) contains

ü device name,

ü path to the file,

ü file name.

<имя носителя>\<имя каталога-1>\...\<имя каталога-N>\<собственное имя файла>.

If, for example, a directory whose structure is shown in Fig. 3.3 is located on the C: hard drive, then the full specification of the postavki.txt file looks like:

C:\user1\kontakti\postavki.txt

If this directory is located on a floppy disk, that is, on disk device A:, then the specification will be written as follows:

A:\user1\kontakti\postavki.txt

A complete file specification completely and unambiguously identifies the desired file, which is what the operating system requires in order to accurately execute user commands. If the slightest mistake is made in the file specification entry, say, at least one character is missing or distorted, the operating system will not be able to find such a file.







2024 gtavrl.ru.