File system not recognized flash drive what to do. Windows error "The file system of the volume is not recognized." What to do? Why is the USB flash drive not recognized? Possible reasons

The hard disk of a normally functioning computer device is always formatted in the NTFS or FAT file system. If one of the HDD partitions starts to work incorrectly, a record about converting its format to RAW appears in the properties of the disk. This means that the standard file system is damaged and needs to be restored. In practice, you can find out about such damage as follows. When accessing a disc, the disc does not open, and a message appears on the monitor to format it.

What does this message mean:

  • The structure of the filesystem being used has been destroyed.
  • There is no access to the contents of the hard disk.
  • Writing invalid or corrupted data to the boot sector of the disk.

When you open the properties of the hard disk, you will notice that the section supposedly does not contain any information. In any case, it is necessary to perform a file system restore in order to recover the data on the disk.

What causes the failure?

The reasons for the appearance of such a failure can be:

  • The impact of a virus that has penetrated the computer.
  • Fatal operating system failure.
  • A malfunctioning program that replaces the original system files with its own files. This also includes "crooked" drivers.
  • User errors when shutting down the computer. This is how often the file system on flash media gets damaged.
  • External factors, as a result of which the file system can be damaged. In particular, frequent power outages can provoke a similar problem.

How can you restore the file system and information on the hard drive?

Despite the fact that the operating system will prompt you to format the damaged partition, it is better not to agree with such actions. However, if you were in a hurry and gave the command to format, all is not lost. However, in this case, it will be much more difficult to completely restore the contents of this section. First, you should restore all the information available on the faulty partition, and then restore the file system itself.

It is recommended to restore data and logical partition performance using RS Partition Recovery.

This program allows you to:

  • Recover files from the HDD on which the file system was changed. That is, with RAW.
  • Recover data from the hard drive that you formatted.
  • Getting the most complete information from a logical partition that has been deleted.
  • Full recovery of damaged partitions.
  • Copying data from damaged partitions to other media.
  • The program does an excellent job with the assigned tasks on any medium.

Working with RS Partition Recovery

The program interface is quite simple. The main menu is divided into three main parts. On the left you can see a list of hard drives and logical partitions. The center shows the filling of disks with information, as well as information about the sizes of all disks. The files we have selected appear in the right column. The program even displays hidden files, as well as sections under control of other operating systems.

It's time to move on to direct data recovery using this wonderful program. To do this, just click on the upper left button labeled "Wizard". The wizard's menu will open in front of the user. The selected disk will be analyzed.

The program divides all partitions into three categories: logical, removable and hard drives. To restore data, you must select the appropriate section. Specify it and then click Next. You will be prompted to select the type of analysis.

The choice consists of two options:

  • Fast scanning.
  • Complete analysis.
  • 1 filter will detect NTFS files. Most of the internal sections work in this space.
  • 2 the filter will process files belonging to the FAT system. This formatting is more typical for removable media, but there are such files on the computer's hard drive. Linux OS also works with the FAT system.
  • Deep analysis works independently of the file system. In the course of its work, the program simply finds on the disk all the files that were there at one time or are present at the moment. However, it is undesirable to use only in-depth analysis, as part of the information may be lost. It is best to parse a section using all three filters.

If you select a quick scan, some of the files will simply not be found. Only whole files will be found, with no signs of damage.

After the analysis is complete, the program will inform you how many folders and individual files were found in this section.

To view all the files found during the analysis, you need to go to the main program menu by clicking the "Finish" button.

Modern flash drives have large volumes and high read / write speeds thanks to the new USB 3.0 data transfer protocol. They have practically supplanted other external storage media, as they are convenient and easy to use. Flash drives do not require additional devices or adapters to connect to a personal computer, and drivers for working with them are included in all operating systems. One of the drawbacks of drives of this type is instability in operation, which appears rather rarely, but causes a lot of unpleasant moments for the user. If the volume file system of the flash drive is not recognized, then further work with it is impossible, and you have to look for a solution to this problem.

The Windows operating system works with two types of file systems - FAT (and its varieties, for example, exFAT) and NTFS. The drives out of the box already have a specific partition table prepared by the manufacturer. If the disk on the flash memory works correctly, the software environment automatically recognizes the USB device connected to the port and mounts it. After the completion of these operations, the flash drive becomes part of the PC disk subsystem with an assigned partition letter and it becomes possible to carry out read-write operations with it.

Checking disk mount

If the flash drive does not appear in the system as a drive with a specific letter designation, it is necessary to check the drive's performance. First of all, you need to make sure that the device is recognized by the operating system. In Windows, you can use the Disk Management snap-in to do this, which is launched through the context menu when you right-click on the Computer icon, the Management item. It happens that the system detects an external flash drive and assigns a letter designation to its section, but it may be occupied by some network resource. In this case, you just need to change it by right-clicking on the disk device and selecting the "Change drive letter or drive path" pop-up menu item and assigning it a free system letter.

On Linux operating systems, the physical connection of a flash device can be verified using the fdisk –l command, run as root. All detected disk devices will be displayed and their characteristics will be listed. If the flash drive is in this list and has the correct file system, then you need to mount it manually.

Unlike distributions of the Linux family, which support a large number of file systems, their support on Windows is limited. Therefore, even if the external drive is defined as a device, the unknown file system of the flash drive may become an obstacle to working with it due to the lack of necessary drivers. In this case, the volume of the media will be marked as a partition with an undefined partition table, although the disk itself will be in a healthy state.

On Linux, Windows file system drivers may not be installed out of the box. In this case, it is necessary to install them. For ntfs, there is a special ntfs-3g package, and programs for working with exFAT have also been developed. The latter is widely used in various digital devices for high-volume storage devices.

Reasons for the appearance of the RAW file system

The cases of notification of operating system drivers about the presence of a RAW system on the disk stand apart. This happens when the file system of the flash drive cannot be recognized. There may be several reasons why this happens. The main ones are as follows:


Why is the flash drive not mounted?

The above cases of inoperability of drives are not fatal, and they can be fixed in one way or another. If, when installing the device, not only it is not possible to correctly recognize the file system of the flash drive, but also to mount it, then this may indicate that the drive is out of order. The reasons can be very different: from factory defects to contact breakdowns. Unfortunately, the design features of flash drives are such that this equipment requires careful handling, especially during installation and removal. Failure to comply with the rules of accuracy can lead to trivial damage.

In addition, the number of write cycles of drives on non-volatile memory is limited due to the peculiarities of the data storage technology itself. Therefore, the service life of such disks is limited in principle, and sooner or later the moment comes when the memory simply stops working. And this happens the earlier, the more intensively the drive is used.

File system recovery

With the final breakdown of the flash drive, everything is clear, and practically nothing can be done here. Even broken contacts are not so easy to re-solder, and without special equipment, nothing can be repaired here. Let's take a look at what to do if the file system of the flash drive is not recognized.

How to fix it when working in Windows

Let's start with Windows. The drive's partition table may be of a type unknown to the Microsoft operating system kernel. For example, a flash drive with an ext4 partition (widely used in Linux) will be detected as working, but the volume type will not be displayed in the Disk Manager, and when such a drive is mounted, the system driver will prompt the user to format it. But in this case, all data on the healthy file system will be lost. Therefore, the best way out is to take into account the limitations of Windows with "non-native" partition tables and use drives with NTFS or FAT for data exchange.

If the file system type is detected as RAW, then first you can try to restore it. To do this, you should use the standard chkdsk utility of the operating system. It runs from the command line. The whole procedure takes several steps:

  1. Press the Start button, select the "Run" item from its menu;
  2. Enter the cmd command in the window and then click the OK button;
  3. The Windows command shell will start. We type in the window the command chkdsk H: / F / R

/ F - fix file system errors. / R flag - fix bad sectors.

IMPORTANT. Running a file system check on a flash drive does not mean that it will be restored after it. In case of critical errors, the partition table cannot be restored.

If the file system could not be restored, you will have to recreate it. On Windows, several paths can be used. The first is to use the Disk Management snap-in. Select the corresponding flash drive, right-click to open the context menu for it and select the item "Delete volume". After that, the disk will go into the "Not allocated" state, and it will be possible to create the partition table on it anew. Again, call the pop-up menu, and in it the item "Create simple volume". This will launch a wizard that will create a new file system in a few simple steps. The user chooses its type, label, assigned letter, and formatting method.

In addition to system capabilities, there is a huge selection of third-party utilities that allow you to work with the partition tables of flash drives. The actions performed with their help are similar to those performed by the built-in Windows snap-ins.

After rebuilding the file system, you can try to recover the lost data. For this, there are also special software packages developed for Microsoft systems, for example, RS Partition Recovery. The disadvantage of such programs is their cost, although when it is not possible to recognize the file system of an important USB flash drive, the cost of recovery may not be critical.

How to fix a system in Linux

Linux distributions have several tools for dealing with damaged filesystems. All of them require root privileges to run and certain skills and knowledge, since in the overwhelming majority they are launched in the command shell. The most efficient tool is fsck, which is used with many options.

For ordinary users of distributions, it is recommended to use the GParted program, which runs in the graphical subsystem and has a graphical interface (GUI). It also requires privileged rights, but it is intuitive and does not require much knowledge of creating partition tables.

Conclusion

The described methods of recovering the file systems of external drives can be used for any type of rewritable digital media. The same methods are used to recover data on hard drives, including solid-state drives (SSD). Still, the main rule of saving important files is to back them up regularly. Not everyone and not always managed to completely recover data from damaged file systems.

Today, flash drives and removable memory cards have a fairly large capacity and are used almost everywhere. Unfortunately, they are more susceptible to physical damage than internal drives and hard drives, but they can equally exhibit software glitches. So it turns out that when you try to connect the device to the computer, the system displays a message stating that the file system of the volume is damaged or not recognized. How to fix such failures will now be described.

Why is the USB flash drive not recognized? Possible reasons

The most likely reasons why the operating system cannot recognize the drive or its file system can be roughly divided into two broad categories: physical damage and software failures.

Physical reasons associated with malfunctions of microcontrollers, external and internal damage, overheating or hypothermia, and many more negatively influencing factors will not be considered. In this case, the USB flash drive will simply have to be thrown away. Even replacing a microcontroller is much more expensive than a new flash drive or memory card. Sometimes there may be malfunctions in the operation of USB ports, but here the way out is obvious: you just need to connect the flash drive to another port.

Therefore, we will focus on software failures. Among the most likely reasons that the file system of the volume is not recognized when mounted, and if it is visible, then it is not possible to work with it), the following are distinguished:

  • exposure to viruses;
  • software failures in the microcontroller;
  • incorrect or incomplete formatting;
  • incorrect removal of the device from the port;
  • power surges;
  • unsupported file system;
  • outdated device drivers;
  • inconsistency in the standards of the USB flash drive and port.

As for the last point, the problem is that a USB 3.0 flash drive is connected to a 2.0 port. This problem is solved by simply reconnecting to the desired port.

Signs of damage to a removable device

Determining that a removable device is inoperative is straightforward. When connected, the system begins to issue warnings that the location is unavailable, the file system of the volume is not recognized, a proposal is made to format the device, etc.

In passing, it should be noted that the drive itself may be visible or not. In the first case, fixing the problem is somewhat easier. In the second, you will have to use additional utilities.

When a warning is issued about an unavailable location, the reason may also be that an incorrect volume label (disk letter) is assigned to the flash drive or removable card, for example, X instead of F. In this situation, you just need to change it, having previously used the disk management section, where the right by clicking on the device, select the appropriate command.

RAW format: what is it?

In the usual sense, such a structure is a modified format, which is simply incompatible with most known operating systems. Therefore, a notification appears on the screen that the file system of the volume is not recognized (although the RAW-format flash drive is visible, but the files on it are not visible, even if you enable the display of hidden objects).

Format change is most often associated with software glitches due to incorrect formatting, improper shutdown of the device, and exposure to viruses. However, it is quite easy to convert the format to readable, which will be discussed a little later.

The main directions in solving problems

If the volume cannot be recognized by the file system, there may be several solutions to fix the situation, depending on the cause of the failure:

  • converting the format to any other compatible with the system;
  • removal of viruses and threats;
  • fast or full formatting;
  • if you need to recover data, you need to use special utilities.

Just in case, you can make sure that the correct driver is installed for the device. This can be done in the standard "Device Manager", which can be accessed either from the "Control Panel", or call the command devmgmt.msc from the "Run" console.

Typically, if a device is not working or is not working properly, it will be highlighted in yellow. In this case, you should either update the driver (command from the context menu) from the system's own database, or install it manually from removable media, or apply an automatic update using programs like Driver Booster (of course, with the flash drive turned on). Sometimes it may be necessary to update the driver directly on the USB controller itself.

Basic testing and recovery

Now let's consider the situation when the file system of the volume is not recognized (the memory card is visible in the system) from the point of view of a regular disk. For removable drives, you can use the standard commands for checking their status, which are originally intended for hard drives. This is about

To perform this operation, you need to call the command console (cmd) from the Run menu (Win + R), then write the chkdsk X / f line in it, where X is the letter assigned to the flash drive (most often it is F). Even if the drive is in RAW format, this procedure works in terms of recovering the file system or converting it to NTFS.

Virus check

Some viruses can deliberately change the structure of the file system of removable drives (and not only). In this case, a message will also be displayed notifying that the file system of the volume is not recognized. The SD flash drive, however, will be visible in the system. This simplifies the task.

The easiest way to solve a situation that has arisen is to fully check it. You can use standard or portable utilities. But even here, unfortunately, there is no complete guarantee of the "cure" of the device. This is due to the presence on the media of a seemingly standard autorun file autorun.inf, which in some cases may be hidden (to see it, you need to set the display of hidden objects in the view menu of the standard "Explorer").

If possible, it must be removed manually, but most often it is protected from such procedures. Here you should use the command line again.

Removing components from the command line

So, the system reports that the file system of the volume is not recognized (the USB flash drive is detected in the system). For example, suppose that the volume label of the flash drive has the letter Z. To delete the desired file, write the following commands sequentially, after each of them press the Enter key:

  • cd F: /;
  • attrib -a -s -h -r autorun.inf;
  • del autorun.inf.

Only in this case is the complete deletion of this object guaranteed, because even on actions in Explorer, due to its close integration with Windows, viruses can set some restrictions, and the command line works using the principles of DOS systems.

Fixing the file system by formatting

Now, another example, when an SD card is inserted into the card reader (the file system of the volume is not recognized, but the system “sees” the device, even if it does not display formatting messages).

In principle, you can look at its format in the section, but why do this if the problem is only that information cannot be written to it? The easiest way to do this is formatting.

Many users mistakenly think that the easiest option is to quickly clear the table of contents. Absolutely wrong! Even if you install something from the drop-down list for your preferred system (FAT32 NTFS, etc.), there is no guarantee that you can work with it. Therefore, it is better to do full formatting. It will take more time, but after that the user will receive a clean drive, as they say, from scratch. And there won't be any problems with him. But this method is applicable only if there is no important information on the device that cannot be destroyed.

Is it possible to recover information on a damaged device?

For many, the issue of information recovery is an unambiguous criterion in favor of choosing special utilities that are able not only to recover boot sectors and records on devices of any type, but also to extract information previously present on them, which for some reason has become inaccessible.

You can restore the data. But such advertised programs like Recuva, when the same removable media is not visible in the system, are useless. Here professional utilities come to the rescue. Below we will consider two of them: the TestDisk application and the unique R.Saver program (both utilities are portable).

Recovery using the TestDisk utility

Now let's look at the situation when the file system of the volume is not recognized (the flash drive is not visible even in Explorer, although we must say right away that the solution given below can be used for removable memory cards of any standard.

The program is free and does not require installation. True, many may be upset by the lack of a Russian-language interface and work in DOS mode. But the utility is very powerful, as it can first restore the file system, and then - and the necessary information.

We launch the utility, in the window that appears, select the Create item. Next, a list of all available disks will appear, including the flash drive invisible by the system. As a rule, in the list it is designated as Disk / dev / sdc with an indication of the capacity (in addition, there may be a description like Generic-Multi-Card). If there is no description, you can determine that this is the desired flash drive simply by the size or by the letter of the disk.

Next, we activate the analysis process (Proceed), after which we select Intel Partition in the partition table. Next, go to the extended file system (Advanced item), press the enter key, and then at the bottom of the window use the restore command (Undelete). We are waiting for the end of the scanning process, and then red lines appear in the window, corresponding to all deleted files. Do not be surprised that even those files that you do not remember about may be found here (the program finds them with ease).

Now use the arrows to move through the list, select the desired object and press the C key to restore. Next, select the directory in which the files will be saved, press "Enter". After selecting the folder, press C again. When the restore is complete, you will be informed that the copy is ready.

Universal program R.Saver

Finally, one more utility that can be used if the file system is not recognized (the flash drive is visible or not visible in the system - it doesn't matter). It is best suited for recovering sectors and data on SD cards.

After starting the application, select the flash drive and start the scanning process (agree with sector-by-sector scanning). Next, the procedure for restoring sectors (reconstruction of the file system) and information contained in them starts (this can take quite a long time).

In the list of detected objects, select the necessary ones, indicate the destination folder on the hard drive and confirm the selection with the corresponding button. When finished, you can work with the flash drive without any problems.

Instead of an afterword

As you can see, in some cases, troubleshooting processes can be quite time-consuming (this concerns the simultaneous recovery of the drive's file system and data on it). However, if such procedures are not required, a flash drive or removable memory card can be quite simple. What is the preferred method? Everyone decides for himself, based on the current situation.

Today, removable memory cards and flash drives have a fairly large capacity and are used almost everywhere. However, they are more susceptible to serious physical damage than hard drives and internal storage. However, software failures in them can manifest themselves equally. Thus, it turns out that when the system tries to connect the device to the computer, the system will display a message stating that the file system of the volume was damaged or not recognized. The following will describe how to fix such failures.

Flash Drive Not Recognized: Possible Causes

The most likely reasons why the operating system refuses to recognize the drive and the file system are the following two broad categories of causes: physical damage and software failures. Physical damage, as a rule, is associated with malfunctioning of microcontrollers, internal and external damage, hypothermia or overheating, as well as many other negative factors, which we will not dwell on in detail. In the event of physical damage, the USB drive will most likely simply have to be thrown away. Replacing a microcontroller is much more expensive than a new memory card and flash drive. In some cases, there may be problems with the operation of the USB ports. However, in this case, the way out is quite obvious: you just need to connect the flash drive to another port.

Let's take a closer look at software glitches. The most likely reasons why the file system of the volume may not be recognized (the flash drive is not displayed when connected, and if it is displayed, then it is impossible to work with it), include the following:

- the impact of viruses;

- software failures arising in the operation of the microcontroller;

- incomplete or incorrect formatting;

- incorrect removal of the device from the USB port;

- voltage surges;

- outdated device drivers;

- unsupported file system;

- mismatch between the port and standards of the USB flash drive.

If we talk about the last point in more detail, then most often the problem is that a USB 3.0 flash drive is connected to a USB 2.0 port. This problem can be solved by simply reconnecting to the desired port.

Damage to the removable USB device

Determining that a USB device is defective is fairly straightforward. When connected, the system starts displaying warning messages that the file system is not recognized, the location is unavailable, or a suggestion appears to format the device. It is also worth noting in passing that the drive itself may or may not be visible. It is somewhat easier to fix the problem in the first case. In the second case, you will have to use special utilities for this purpose. If you receive a warning about an unavailable location, then most likely the reason lies in the fact that the removable card or flash drive has been assigned an incorrect volume label, for example, X instead of F. In this situation, you can simply try changing it. For this purpose, you must first use the disk management section, where by right-clicking on the device, you must select the appropriate command.

RAW format: what is it?

Such a structure in the usual sense is a modified format that is simply incompatible with most of the known operating systems. For this reason, a notification appears on the screen quite often that the file system of the volume cannot be recognized. A RAW flash drive can be visible, but files on it cannot be seen, even if you enable the display of hidden objects. Most often, format change is associated with software failures resulting from incorrect formatting, exposure to viruses, or improper shutdown of the device. It is quite easy to convert this format into a readable one. This will be discussed a little later.

Basic ways to solve problems

If the file system of the volume cannot be recognized, there are several ways to resolve the problem, depending on the cause of the failure. Possible solutions to this problem include:

- conversion from one format to another, compatible with the system;

- removal of threats and viruses;

- full or quick formatting of the drive;

- the use of special utilities in the event that it is necessary to recover data.

First of all, you need to make sure that the correct driver is installed for the device, just in case. For this purpose, you can use the standard "Device Manager". It can be accessed either from the Control Panel or by calling the special command devmgmt.msc from the Run console. In the event that the device does not work or does not work properly, it will be marked in yellow. In this case, you must either update the driver from the operating system's own database using a special command of the context menu, or install the driver manually from removable media, or use automatic update using a program such as Driver Booster. With the included flash drive. In some cases, it may be necessary to update the driver directly on the USB controller itself.

Testing and recovery

Consider a situation in which the file system is not recognized from the point of view of a regular disk. For removable media, you can use special commands to check their status, which are originally intended for hard drives. In this case, we are talking about checking the disk. To perform this operation in manual mode, you need to call the command console from the Run menu, and then write the chkdskX / f line in it, where the letter X denotes the letter assigned to the flash drive (usually the letter F). Even if the drive is in RAW format, this procedure will work in terms of restoring the file system or converting it to NTFS format.

Virus check

Some malicious objects and viruses can deliberately change the structure of the file system of removable drives. In this case, a message will also appear notifying you that the file system of the volume was not recognized. However, in this case, the drive will be visible in the system. This greatly simplifies the task. The easiest way to solve this problem is to perform a complete drive check. You can use portable utilities or a standard anti-virus program for this purpose. However, unfortunately, there is no guarantee of a complete "cure" of the device. This is due to the presence of the standard autorun file autorun.inf on the media, which may be hidden in some cases. To see it, it is necessary in some cases to set the display of hidden objects in the view menu of the standard program "Explorer". If possible, you need to remove it manually, but most often it is protected from such procedures. Here again you need to use the command line.

How to remove components from the command line

Let's assume that the file system of the volume was not recognized, but the flash drive is detected in the system. For example, we can assume that the volume label of the flash drive has the letter Z. To delete the file you are looking for, you must write the following commands: cdF: /; attrib –a –s –h –rautorun.inf; delautorun.inf. After each of these commands, you must press the "Enter" button. Only in this case will the complete removal of this object be guaranteed. Due to the close integration of Explorer with the operating system, viruses can impose certain restrictions on actions in this program. The command line works like DOS systems.

How to fix the file system by formatting

Another example of problems with a drive is a situation when an SD card is inserted into a card reader, and the file system of the volume is not recognized, but the system "sees" the device and does not display a message about formatting the system. You can basically look at the format of the card in the disk management section. However, why do this if the problem is that information cannot be written to the card? The easiest way to solve this problem is by formatting. Many users mistakenly believe that the easiest solution to the problem in this case is to quickly clear the table of contents. But this is completely wrong. Even if you install something from the drop-down list for your preferred system, there is no guarantee that you can continue working with it. Therefore, it is best to do full formatting. It will take more time, but after that the user will have at his disposal a completely clean drive, which is called from scratch. There shouldn't be any problems with him. However, this method is applicable only if there is no important information on the device that cannot be destroyed in any case. Can I try to recover information on a damaged device? For many, the question of information recovery is an unambiguous criterion in favor of choosing special programs that are able not only to recover boot sectors and records on devices of any type, but also to extract information that was previously present on them, which has become inaccessible for some reason. However, you can still recover the data. But popular programs like Recuva will be completely useless if the removable media is not recognized by the system. Then professional utilities can come to the rescue. We will consider two such utilities: the unique R.Saver program and Test Disk. Both of these utilities are portable.

Data recovery using the Test Disk utility

Consider a situation in which the file system of the volume is not recognized. It should be noted right away that the solution below can be used for memory cards of any standard. This program is free and does not require installation. Many people may be upset by working in DOS mode and the lack of a Russian-language interface. This utility is quite powerful, since it is able to first restore the file system itself, and then - the necessary information. You need to run this utility and select the Create item in the window that appears. Next, a list of all available disks will appear, including the invisible flash drive system. In the list, it is usually referred to as Disk / dev / sdc with an indication of the volume. Additionally, there may be a description of the Generic-Multi-Card type. If there is no description, then you can determine that this is the desired flash drive by the letter or size of the disk. After that, you need to activate the Proceed analysis process and select the Intel Partition item in the partition table. Next, you need to go to the Advanced item and press the enter key. After that, at the bottom of the window, you need to use the Undelete recovery command. Now you just have to wait for the scanning process to finish. As a result, red lines corresponding to the deleted files will appear in the window. You shouldn't be surprised that even files you don't remember about may be found here. Now you need to move through the list using the arrows, select the desired object and press the C button to restore. Next, you need to select the directory in which the files will be saved and press the "Enter" button. After selecting the folder, you must press the C button again. When the restore process is completed, a message will appear stating that the copy is ready.

Universal program R.Saver

Let's consider another utility that can be used if the file system is not recognized. It is best suited for recovering data and sectors on SD cards. After starting the application, you need to select a flash drive and start the scanning process. After that, the procedure for restoring the sectors and the information contained in them will begin.

Hello, dear visitors, readers, friends and foes, regular customers and other personalities of the site.

We continue the series of articles devoted to Linux systems. Today we will talk about such important (maybe not quite simple) concepts such as:

  • Linux file system;
  • The main directories of the root file system;
  • Console commands for working with files and directories.

So, let's begin.

Linux root filesystem

It's hard to imagine an operating system (even one like Linux) without a file system. It has a system-wide order. The file system strictly monitors the organization, storage, and naming of data. For example, when a program accesses a file, it knows nothing about where the information about this file is located, on what physical medium it is recorded. The only thing that the program knows is the name of the file it is accessing, its size and other parameters that distinguish the searched file from many other files (the date and time of the file creation, the name of the file owner, permissions and method of access to the file, etc. .). It receives all this data from the file system. It is the file system that determines where and how the file will be written to the physical medium (for example, a hard disk or removable device). All directories collected in one place (in another way, folders), subdirectories, as well as files are the data of the file system. Moreover, one of these directories in Linux-systems is the most important, namely the "top" (in other words - "root") of the file system - it contains all the other directories and files.

In order for you to understand what is at stake, I opened the directories of the Linux file system through the file manager Midnight Commander (MC). The top of the file system (root directory) is indicated with a red arrow - and that's exactly where all other file systems are mounted. Next, we will try to describe in a more accessible way everything that you see in the figure at the moment (in the text we will dwell on certain concepts so that it is clear what is at stake, and you, having looked at the figure, were able to orient yourself).

If the hard disk is divided into partitions, then each of them has separate file systems with its own root and with its own directory structure. Any operating system supports multiple file systems, for example, Windows supports such well-known file systems as FAT, FAT32, NTFS, etc. Linux is no exception. However, it is important to distinguish between file systems that can be used as the root file system and file systems that simply support the operating system, but are not used to install Linux or Windows (these include, for example, ISO9660 (this model provides media compatibility under different operating systems). systems), UDF (and this is a special file system format for storing files on optical media), etc.). We will not consider the Windows file systems, we will not dwell on the file systems that are not used to install operating systems, but just give a brief overview and get acquainted with some of the most famous root filesystems Linux.

  • ext - Extended File System (extended file system) the first filesystem designed specifically for operating systems based on the Linux kernel.
  • ext2 - Second Extended File System (literally: "second extended file system") is a standard but outdated Linux file system. In terms of speed and performance, it can serve as a benchmark in file system performance tests. Its only drawback is that it is not a journaling file system. (A journaled file system is a system that records a journal and stores a list of changes, which in turn helps preserve the integrity of the file system in the event of a crash)... This flaw was eliminated in the next ext3 filesystem.
  • ext3 - Third Extended File System (third version of the extended file system) an improved version of the ext2 file system with support for journaling, which undoubtedly increases its reliability.
  • ext4 - Fourth Extended File System (the fourth version of the extended file system) is the latest Linux file system. Since Linux kernel 2.6.28 (released on 25.12.2008) the filesystem is already considered stable and is used by default in many Linux distributions.
  • The ext4 filesystem is seen as a transitional step towards the next-generation Btrfs filesystem, which is now claiming to be the main Linux filesystem in the future.

Attention! There are several other file systems, for example, ReiserFS, JFS, XFS, etc., but it is not advisable to use them at home, because ReiserFS is sensitive to crashes and needs to be defragmented regularly, JFS does not work well with large files (for example, with a video), it is better to use this file system for a database server, and XFS is good for graphics workstations for video processing.

Let's repeat (repetition is the mother of learning) :). When you install Linux, a root file system is created on the hard disk partition of your choice, and it is the most important file system for Linux. It is to it that all other file systems on other devices will be mounted. The root file system is also mounted, but not to another file system, but to "Linux itself", and the root directory serves as the mount point. Therefore, when the system boots, the root filesystem is first mounted, and when finished, it is unmounted last. (we will talk about the very concept of mounting and unmounting in the following articles - this is a separate and also important topic)... The root file system contains a set of standard directories and utilities, without which Linux cannot work. In Linux, the root directory is designated as “/” (forward slash). Full names (differently - paths) all other directories are obtained from “/”, to which the names of sequentially nested directories are appended to the right. Directory names in the path are also separated by the “/” character. For example, / home is the “home” directory in the root directory (“/”), and / home / Sonikelf is the “Sonikelf” directory in the “home” directory, which in turn is located in the root directory. The directories listed in this way, ending with the file name, make up full path to the file.

In Linux, in addition to the full path, there is also relative path, which is built in exactly the same way as the full one - by listing through a slash (“/”) all the names of directories encountered when moving to the desired directory or file. There is only one important difference between a full path and a relative path: a relative path starts from the current directory, and a full path always starts from the root directory. Linux distinguishes between full and relative paths simply: if an object name begins with “/”, it is a full path, otherwise it is a relative path.

Main directories of the root filesystem
In different Linux distributions, directories may also be different: some will have additional files / configuration directories, and some configuration files, it is quite possible, will be named somehow differently. I will list the names of the directories that come with the Fedora distribution. So let's go:

/ - root directory

  • / bin - contains standard Linux utilities. Or, let's say - this directory contains the main executables (on Windows, such files have the extension .exe) available to all users, and also contains symbolic links to executable files. A symbolic link is a special file in the file system, inside of which there are only one or two lines indicating the full path that should be opened when trying to access this link (file).
  • / boot - contains the GRUB bootloader configuration files, kernel images (the last three are stored by default), Initrd files. To make it clear what these mythical files are, a disk that contains a temporary root file system, with which, in turn, the Linux kernel is launched. The initrd file is an image of this temporary root system that is stored on the boot device.
  • / dev - contains device files. In Linux, a device is a piece of hardware that connects to the system during the kernel boot process or while the system is running. These devices represent methods for inputting or outputting information. For example, a hard disk is a device for input (writing) and an output (reading), a mouse is an input device. Each movement or click of the mouse buttons sends a character to the / dev / mouse device, the keyboard is also an input device. Most Linux devices are files in a special filesystem. (except for network cards)... And these files are stored in the / dev directory, where the system calls them to perform I / O tasks.
  • / etc - Contains configuration files for the operating system and all network services. This directory can be compared to the Windows registry, but in Windows, system-wide settings are stored in one large binary file, and in Linux, in different configuration files that can be edited with a regular text editor.
  • / home - the name of the directory speaks for itself. This contains the home directories of all users who are registered with the system. Users' home directories store user files as well as custom settings for various programs. As we mentioned in the previous article, and therefore each user has his own unique and inimitable directory for his personal, personal files. This directory is called the user's Home directory and is denoted, as we said a little earlier, / home / UserName. This separation of user directories and operating system files simplifies data storage and improves the reliability of the operating system itself.
  • / lib - This is where various libraries and kernel modules are located. During the installation of various programs in Linux (including drivers), (we have already talked about them) for the program to work correctly. These dependencies, in most cases, are libraries - a set of specially assembled files that are connected during installation to the program being installed.
  • / lost + found - this directory is needed to store damaged files in case of problems with the file system that were recovered after, for example, an incorrect unmounting of the file system. This is a very valuable directory, you cannot delete it (it will reappear anyway).
  • / misc - can contain anything.
  • / mnt and / media - These directories usually contain mount points. On modern Linux distributions, this process usually happens automatically. In this case, a subdirectory is created in the / mnt or / media directories, the name of which coincides with the name of the volume to be mounted.
  • / opt - this is usually where installed programs with a large disk space are placed, or auxiliary packages, for example, I have only two programs in this directory - these are Adobe Reader and Google Chrome
  • / proc is not quite a regular directory, it is the directory of the procfs pseudo-filesystem, which is used to provide information about processes (in other words, it is a virtual file system that provides communication with the kernel and is mounted in the / proc directory)... Yes, Linux has a virtual file object called the / proc directory. It exists only while the system is running in the computer's RAM. The catalog is also of interest from a security point of view. Many of the utilities that print information about the system (for example ps command), take their source data from this directory.
  • / root - user directory (who this is, we mentioned in one of the previous articles).
  • / run is a brand new directory that has just appeared. And it was created (as conceived by the developers) to store data that were launched by applications that are required in the process of work (these can be services launched by the system itself, and programs that you launch yourself).
    This includes:
    • Process identifiers PID (each process running in a Linux environment has its own unique identifier - in other words, this is the address (in numerical form) of the process with which other running processes will interact while running);
    • Information about interprocessor communication (in other words, this is the exchange of data between running processes);
    • Locked files (if the application either does not start during operation, or is unstable? This may mean that some files of this application are locked by other processes and this happens when several applications try to use one shared resource at once); - well, and other data required during work.
  • / sbin - a set of utilities for system administration, contains the executable files needed to boot the system and restore it in various delicate situations. Only root can run these utilities.
  • / tmp is the directory where temporary files are stored. Linux, unlike Windows, keeps this directory clean and regularly cleans up this directory.
  • / usr - contains user programs, documentation, source codes for programs and kernels. It is one of the largest directories in the file system in size. Almost all programs are installed in this directory. And it (this directory) can hardly be compared with the Program Files directory in Windows.
  • / var - contains the files that are most frequently modified. For example, caches of various programs; lock files for the inadmissibility of the simultaneous use of one program by several users; system log files; temporary files (when the computer is turned off, the contents are cleared); information about various programs; general information about the state of the system since the last boot, login, etc .; print queue, faxes, and users' inboxes, etc.

Conclusion. A file system in Linux is an inseparable whole, starting from the root directory (the so-called "top"), and inside the directory there can be whole disks or their partitions (with other file systems), which can be easily mounted (attached) and also easily unmounted (detached ) from the only, single, indivisible, whole wood. I specially highlighted these words to make it clear the difference from the Windows file system. If anyone is not in the know, in Windows, each logical drive is a root directory. For example, if there are three logical drives - C, D, F, then there will be three root directories.

Essential commands you need to know to work with files and directories

Now that Linux has a good graphical interface, the console is used less and less often (which personally dishears me). In any case, knowledge of a simple basis, namely, simple and useful commands, is necessary for any user (for example, your X server crashed (roughly speaking, this is the so-called graphical interface in Linux - this is not an entirely accurate definition, but at the moment , we will not delve into the jungle of terminology) or you needed to install the program from the source code, or something else). You cannot do without a console (or terminal). And to work effectively in the console, you need to know the Linux commands. In general, there are a lot of commands, so it will be simply unrealistic to cover them all (at least within the framework of this article), so for now we will restrict ourselves to commands for working with files and directories.

Note:
Please note that all file names and command names must be entered in the correct case, i.e. Linux names are "case sensitive". For example, the cd command is not at all the same as the Cd or CD command. The same applies to the names of files and directories.

The cd command is used to navigate the directory tree. If you enter this command without arguments (i.e. just write cd - see the first line in the figure), you will be taken to your home directory, and to get to any other directory, you must specify the path to it. By default, you are always initially located in your home directory (/ home). The first line contains the relative path, the second - the full one. If you need to move to any other directory, then enter cd, necessarily a space and the directory where you need to go, for example cd / usr. The fourth line of the figure in square brackets indicates that we have changed to the usr directory. You can specify the entire path at once, for example, cd / usr / games. You will be taken to the games directory, which is located in the usr directory, which in turn is located in the system root directory. To go back to your home directory, you just need to specify the relative path cd ~.

Now that you, with a little practice, already know how to move from directory to directory, it's time to learn how to view the contents of the directory. And the ls command will help us with this. With its help you can display a list of files and directories in the current directory. The ls command has many options. The ls command by itself (no key) will not show all the files in the directory. Some files are hidden and can be seen only by specifying an additional key (option) to the ls command. If we type ls -a, then our gaze will be presented with a list of all files in the directory (even hidden ones will open).

It is not necessary to be in the directory whose contents you want to find out with the ls command. For example, to see what is in the / etc directory while in your home directory, type:

ls -al / etc

Here we have specified two keys - this is to show hidden files (a) and display information (l). Please note that we can specify several keys at once to get all the information about a directory or file.

Here are the most commonly used options for the ls command:

A (all) - displays a list of all files in the directory, including hidden files;

L (long) - will display information about the contents of the directory, including access rights (first column), owner (second column), group (third column), size (fourth column), creation time (fifth column), whether the file is a symbolic link to another file and which one (sixth column);

R (reverse) - will list the contents of the directory in reverse order;

S (size) - sort files by size.

The next useful and useful command is pwd. Moving through various directories, you can find yourself in a rather awkward situation when you do not know or do not remember the name of the current directory - in other words, you are lost in the file system :). Indeed, by default in Linux, the command line prompt displays only the name of the current directory, not the full path to it. In this case, the pwd command will be of invaluable service to you.

Take a look at the first line. The square brackets indicate that I am in the services directory. But where it is located, in which or which directory is completely incomprehensible. By entering the above command, I was presented with the full path to this directory (second line). With this command, you will definitely not get lost in the Linux file system.

Mkdir command - create a new directory. In the user's home directory - / home, as in any other, you can create an unlimited number of subdirectories, in them - your own subdirectories, etc. In other words, you own a filesystem "subtree" whose root is the user's home directory.
To organize such a subtree, you will need to create directories inside your home. This is what the mkdir utility is for. It is used with one required parameter: the name of the directory to be created. By default, a directory will be created in the current directory.

Let's create a globus directory (first line in the picture). Let's enter the command mkdir globus. To make sure that the directory has been created, issue the ls command with the -F switch (add a "/" suffix for each directory name). The catalog has been created.

Next. You can move files and directories with this command. Mv has two required parameters: first - the file or directory to be moved must be specified, the second - the destination file or directory (destination) must be specified. The names of files and directories can be specified in any valid form: using a full or relative path. In addition, mv allows you to move not only one file or directory, but several at once (files / directories are listed separated by a space).

Let's do a little practice: create two directories in your home directory - Globus and Dos and create a file - dokument. Now let's get down to practice:

1) Rename one file to another. To rename, for example, the dokument file to dokument.old, enter:

mv dokument dokument.old

2) Now let's move one directory to another. To move the Globus directory from the current working directory to the Dos directory, enter:

mv Globus Dos

If the Dos directory already exists (as in our case), mv will put Globus inside Dos. And if you have not created the Dos directory, then mv will RENDER (overwrite) Globus in Dos

3) To move a file or directory that is not in the current directory, specify its full name and path as an option.

For example, to move the file / usr / tmp / dokument to the current working directory, enter:

mv / usr / tmp / dokument txt.txt

The dokument file was originally in / usr / tmp /, we moved it to the home directory by renaming it to txt.txt

4) Now, to move the txt.txt file from the current working directory to the / usr / tmp directory, type:

mv txt.txt / usr / tmp

There can be a lot of files in the tmp directory, so I divided and reduced the picture for convenience. The second line means that in order to make sure that our file is moved, we must change to this directory, which we did with the cd command. And using the ls command, we opened the tmp directory for viewing and made sure that the move was successful.

The next useful and useful command is cp.
It creates a copy of the file. The cp utility also requires the presence of two required parameters: the first is what we want to copy (file or directory), the second is where we want to copy it (destination). For example, you need to copy the dokument file to the Globus directory - enter the command

cp dokument Globus

and a dokument file will appear in the Globus directory (this will be a copy of the dokument file that is in our home directory)

Using the cp command, you can copy not only one file or directory at a time - you can, by listing everything that you want to copy, indicate this to the cp command. For example, we need to copy two files dokument and dokument.old to the Dos directory, nothing is easier - list all files or directories separated by a space:

cp dokument dokument.old Dos

You can not only copy, but also delete files and directories, and the rm commands (deletes files) will help us with this ..

And rmdir (removes directories). rmdir will only agree to delete a directory if it is empty, i.e. there are no files or subdirectories in it.

You can delete a directory along with all its contents using the rm command with the "-r" switch. The command rm -r the name of the directory (s) is a very convenient way to lose all files overnight: it recursively (this term means roughly the same as running the uninstaller for Windows) bypasses the entire directory, deleting everything that comes across - files, subdirectories, etc. etc., and the "-f" (force) switch makes its work even more inevitable, since it suppresses requests like "delete a write-protected file", so that rm works silently and non-stop. Be careful when using this command.

The cat command - allows you to display the contents of any file, but in this form this command is almost never used. If the file is too large, then its contents are scrolled on the screen, and you will see only the last lines of the file. With this command, you can combine and merge copies of files, and create new files. If you just type cat at the command line and press Enter, then you can enter (and accordingly see) text on the screen. Pressing the Enter key again will double the line and start the next one. When the text is typed, press the Ctrl and d keys at the same time.

This is because you enter the first line yourself, and the second is copied to the screen by the cat command. If you redirect (i.e. write) the output to a txt file, then no doubling will occur, but a new file with the typed text will appear in the working directory, which can be easily viewed through this command:

cat> txt

This command will be able to read and open any file, not only a text file, but there will be no sense in opening, for example, a graphic file. A stupid set of characters will appear on the screen.

Some options that can be used with this command:

  • -A shows all invisible characters;
  • -E shows end-of-line characters;
  • -e shows non-printable characters plus end-of-line character;
  • -b numbers non-blank lines;
  • -n numbers all lines.

Let's try to concatenate the two files into one using the cat command:
We have two files - dokument and txt, we will combine them into one galina by entering the command

cat dokument txt> galina

That's all - our two files are merged into one with saving both the first and second files in one common file :)

If the file is too large, then to view it on the screen you need to use with the more and less commands.

  • more displays the contents of the file on the screen one page at a time, just the size of the whole screen. In order to see the next page, you must press the space bar. You can exit view mode with the Q key.
  • less contains all the functions and commands for controlling the output available in more and additional, for example, to move through the text, you can use the Up Arrow, Down Arrow, PgUp, PgDown keys.
  • Locate command - Searches for a file. With this command you can see all files or directories whose names contain the desired pattern. For example, to search for a file that contains the word dokument.old in its name, type

locate dokument.old

The locate command found all the dokument.old files. There were three of them in the system. You can also specify a more advanced search, for example, if instead of dokument.old you specify a "piece" of the name, for example "doku". All files containing this letter combination will be found.

There is another similar command for finding files - find. This command has many options, but the most commonly used option is -name - it searches for all files and directories that contain the combination of letters you specified in the name.

Another useful command is which. It shows the position of the executable files. This command is useful when creating a launch button for an application.

To create a launch button, you need to know the command to launch the application for which you want to create a launch button on the desktop. This figure shows that ls run command is / usr / bin / ls

The clear command (as well as the Ctrl + L keyboard shortcut) - clears the terminal window. This is useful when you move through directories, files, as the terminal window is filled with a bunch of commands or just some information. In this case, the command line prompt will be shifted down - which is not always convenient. In order not to exit the command line and re-enter it, you need to use the clear command.

And finally, I would like to note two more useful and very necessary commands.

The first is history. The very name of the team speaks for itself. This is the history of the commands that you entered in the terminal window. For beginners or even advanced users, it is rather tedious to remember how this or that command is written (I'm not talking about one-word commands, but about commands containing 2-3-4 words, for example, system-config-authentication). This command will display a list of previously entered commands (the list of these commands can also be viewed in the .bash_history file. It is located in your user's home folder). Just type:! "History command number", for example! 847.

And we will end our acquaintance with perhaps the most important command in Linux. This man command is short for "manual". It can be used to call the documentation pages about the purpose and use of commands in the system. By typing man, a space and the name of any command, you will see the documentation page for the selected command, for example, type man clear

Exit Help - q

Like any other help system, the man system has its own man page. Type man man for detailed documentation on the man command itself.

Afterword.

Something like this. As always, we are waiting for your comments, additions and all that stuff.

This concludes our next lecture :). There will be next ones, I hope they will be interesting and exciting. If you have something to add (add), you are welcome, add in your comments.

P.S. Thanks to a member of the Pantera team for the existence of this article.

Any operating system supports multiple file systems, for example, Windows supports such well-known file systems as FAT, FAT32, NTFS, etc. Linux is no exception.

Did you like the article? To share with friends: