•  Do I need to use “Safely Remove Hardware” (remove the flash drive). Disconnecting USB devices without using the Safely Remove Hardware function

    Have you thought every time after USB usage flash drive, disk, floppy drive, etc. devices over the question “Does it need to be safely removed?” or do you pull it out without thinking or, on the contrary, just pull it out?
    And what should you do if this same tray icon disappears?
    Now disputes are still flaring up between both experienced users, and newbies on this matter.
    Let's figure it out now!
    I’ll also show you how you can get this back Safe removal devices.
    And for dessert - small tricks with, allowing you to remove devices in almost one click.

    First of all, you need to find out why this is needed at all? What is the reason?
    And the reason lies in caching.

    Caching is the accumulation of data in some storage for the purpose of quick subsequent access to it as needed. The caching process speeds up many data processing processes.


    In other words, before writing data to a flash drive, the OS places it in the cache (block RAM), and then writes it down after a while (this is also called delayed write). This is done for speed - after all, RAM is called that for a reason.

    So What could be the consequences of yanking the device without safe removal?
    Nothing like that, the data will just not be written correctly.
    It happens that the copying process has already been completed, but you need to run, and Windows gives the message “The device cannot be stopped because it is busy with something” (sorry, I don’t remember verbatim what the message is). And you still pull out the flash drive and run about your business.
    So this is where it turns out that the data was written to the cache, but was not written to the flash drive yet. Although sometimes there may already be a file with the same properties and size as the original.
    But when you open, for example, a picture, it turns out that it will either open halfway or access will be denied altogether. Also, if this is an archive, there may be a message about an unexpected end damaged archive or SRC error. Also due to incorrect completion of copying.

    When you select “Safely remove device”, the system “understands” you and prepares the flash drive - it completes the pending recording.

    But here's the most important thing - extracting only makes sense when file caching is enabled!

    If you forget or neglect Secure Removal, and you don’t want to lose your data, you can simply Disable caching. As a result, copying will be slower, but you will not lose data (unless you pull it out during copying).

    So, plug in the flash drive and follow the path

    Start - Control Panel - Device Manager


    Finding the section Disk devices , open it and double-click on your flash drive and go to the tab Policy. Here we put Quick removal and click OK.

    but in fact (despite what it says) when the "Quick Delete" mode is enabled, caching is not disabled at all - Windows uses the so-called "pass-through caching" - it allows the device to work with write commands as if there was no cache.

    What to do if the arrow icon disappears - safely remove the device in the tray?
    Right-click on the Taskbar - Properties - Notification Area - Configure


    We look for “Safely remove hardware” in the list and configure it as you need.

    Another option:
    Keyboard shortcut win+r -> paste there

    rundll32 shell32.dll,Control_RunDLL hotplug.dll


    this will open a window safe shutdown USB devices.

    For Windows XP, the following registry tweak will help. Download and launch. Don't be afraid, I don't give bad things

    And finally - interesting option icon solutions - it will appear in context menu by pressing RMB.

    go to the Registry Editor (win+r - Enter regedit) and go to the branch HKEY_CLASSES_ROOT\DesktopBackground\Shell\


    RMB on Shell and create new section with title Safely Remove Hardware(safe removal of equipment).


    We create a new string parameter in it with the name Icon


    double click on the newly created parameter and in the field Meaning enter hotplug.dll, -100

    Do you often think about correct operation flash drives? Indeed, in addition to such rules as “do not drop”, “protect from moisture and mechanical damage”, there is one more important rule. It sounds like this: you need to safely remove the drive from the computer connector.

    There are users who consider it unnecessary to manipulate the mouse to safely remove a flash device. But if you remove removable media from your computer incorrectly, you can not only lose all your data, but also break it.

    In order to properly remove a USB drive from your computer, you can use several methods.

    Method 1: USB Safely Remove

    This method is suitable for those users who constantly work with flash drives.

    With this program you can quickly, conveniently and safely remove such devices.


    Method 2: Through “This PC”


    Method 3: Through the notification area

    This method involves the following actions:



    Your data remains intact and this is the most important thing!

    Possible problems

    We mentioned above that even with such a seemingly simple procedure, some problems may arise. People on forums quite often write about a variety of problems. Here are just a few of them and ways to solve them:


    If you don't stick to these simple rules operation, then there comes a time when the next time you open a flash drive, files and folders disappear on it. This happens especially often with removable storage media with file NTFS system. The fact is that the operating system creates a special place for such disks to store copied files. Therefore, information does not get to the drive immediately. And if this device is removed incorrectly, there is a possibility of failure.

    Therefore, if you do not want to lose your data, then do not forget to safely remove your USB drive. An extra couple of seconds to properly close work with a flash drive gives you confidence in the reliability of storing information.

    The question is still relevant: is it necessary to use the option to safely remove the device before removing the flash drive from the computer. To find out what the operating system itself thinks about this, you can go to Control Panel -> Hardware and Sound -> Device Manager.

    Here we find the “Disk devices” tab, expand it and right-click on our expensive flash drive (naturally, the flash card must be connected at this moment). From the menu that appears, select “Properties”.

    In the window that appears, select the “Policies” tab. Here are options for working with a flash drive when it is disconnected.

    As you can see from the screenshot, Windows has 2 removal policies: by default, the quick removal mode is enabled, which involves removing the device at any time without the need to use the option safe removal. The second mode uses data caching before writing, which increases performance, that is, in this case recording speed to the device, but requires mandatory use safe removal.

    It turns out that if you do not change the extraction policy, you can remove flash drives without additional manipulations. Not really. The fact is that a flash card can work in different modes. For example, you simply copy some files from your computer to removable media. In this case, access to the flash drive will stop after copying is complete, but there are also situations when you work directly from the flash card. You can run the program from removable media, and here it is possible that the program writes some data to the media at some intervals. It may also be that some programs installed on the computer periodically write data to the flash drive. The easiest way to determine this is on flash drives with a light indicator for writing and reading data. It happens that it blinks at moments when, it would seem, you are not doing anything with the removable media.

    In any case, regardless of the policy used, it is recommended to remove the flash drive safely. This will avoid data corruption. In addition, the extraction process itself is carried out in literally 2 clicks and does not take much time.

    This advice applies to both Windows and other operating systems.

    While the debate about safely removing devices (flash drives) continues, I decided to describe my argument in favor of refusal from safely remove devices. Of course, I’m sure that there will be many critics who will not really object: “I didn’t remove it and my flash drive burned out!”, “I didn’t remove it and absolutely all the data on my flash drive was deleted,” etc... I hope that our reader , a prudent person and will be able to analyze and draw appropriate conclusions for himself. Of course, I do not encourage anyone to refuse to safely remove drives, but I do encourage them to be safely removed I won't. I will describe my point of view on the problem, and then let everyone decide for themselves.

    First, a short introduction, read it - it will allow you to understand the essence...

    Increased performance through caching

    Caching- this is the accumulation of data in some storage for the purpose of quick subsequent access to it as needed. The caching process speeds up many data processing processes.

    So, the operating room Windows system(with which you work), roughly speaking, has two policies working with storage devices (which is a flash drive).

    1) ON advanced caching

    2) OFF advanced caching.

    When caching records included, data directly to disk are not recorded, but end up in the cache (some intermediary area). And the actual recording (physical recording) to the flash drive occurs after some time, this behavior is also commonly called - delayed write. This achieves increased productivity.

    In some cases, it is more appropriate to record immediately, bypassing the cache. This prevents loss or data corruption in case of failures. In the case of a flash drive, the main failure is a power loss (when you simply unplug the flash drive).

    So in case caching active and you having written down files on portable usb storage device turned it off(drive), then most likely it is will lead to loss recorded (in at the moment) information. Because really data recording process Not completed to the end, and the so-called delayed write despite the fact that you saw how the copying of data to the flash drive was completed successfully.

    Arguments for not safely removing a device

    A short introduction to the topic of caching is necessary so that you understand the operating principles of the operating system in this aspect.

    I think everyone has at least understood in general terms how the caching subsystem works. And now many have wondered, is caching enabled on my computer? And many will think that this is exactly the case, since they were advised to do a safe extraction...

    In fact, by default (i.e. if specially do not change) the policy with cache DISABLED is enabled, this screenshot is proof

    Figure 1. Removal Policy

    Read the text carefully and you will see that Microsoft has already taken care of quick removal devices.

    Unnecessary fears

    So what are you afraid of and so diligently trying to avoid, each time safely disconnecting the flash drive?

    Surely you have heard about terrible rumors when you burn out USB ports allegedly due to the fact that the flash drive was not safely removed, that the drives themselves are burning, that the information stored on the disk is being damaged, and many other horror stories. The latter will probably be the most realistic, since after recording with caching enabled, if you quickly pull out the flash drive (without waiting for the recording to finish), the file you are writing will not be written completely, i.e. damaged - that's all!

    This means that if you connected a flash drive for the purpose of copying from it (i.e., the operation of reading data from a flash drive), then you can safely not remove it.

    Still think that your flash drive might burn out?

    Then let's turn to USB interface specifications and common sense.

    Here GND is the “case” circuit for power supply peripheral devices, and VBus - +5 V, also for power circuits. Is data transmitted on the D+ and D wires? differentially (states 0 and 1 (in the terminology of the official documentation diff0 and diff1, respectively) are determined by the potential difference between the lines of more than 0.2 V and provided that on one of the lines (D? in the case of diff0 and D+ in the case of diff1) the potential is relative to GND above 2.8 V. The differential transmission method is the main one, but not the only one (for example, during initialization, the device informs the host about the mode supported by the device (Full-Speed ​​or Low-Speed) by pulling one of the data lines to V_BUS through a 1.5 resistor kOhm (D? for Low-Speed ​​mode and D+ for Full-Speed ​​and High-Speed ​​modes.).

    I didn’t say anything new or shocking here, I just wanted to emphasize the fact that the USB interface is powered by a voltage of +5 V. The supply voltage is set by the official specification, and no safe removal of devices can affect the size of the supply voltage output.

    I think that you understand that an electrical device (which is a flash drive) can and does burn out (by the way, quite often) only due to voltage surges, surges, or short circuits. The cause of which is a faulty or low-quality power supply, the computer is “developed” USB connector or conductive debris stuck in the port, but not the safe removal function of the Windows operating system.

    If any of the experts disagree, I will be glad if you correct me, I will definitely make your correction to the text of the article.

    Regardless of the operating system, when removing a flash drive, it is always recommended to disconnect it from the system programmatically before physically removing the device from the computer. Is this really so important and necessary?

    In this article we will try to figure out why you need to safely remove a flash drive and whether it is really necessary. Although the article is focused more on Linux, this task is common to all operating systems, so it will also be useful to MacOS and Windows users.

    If I ask you to remove the flash drive from the computer while data is being written to it, then most likely you will refuse to do this. You know that now data is being written to the disk and if you turn it off, then with a 100% probability the data on the flash drive will be damaged and will definitely not be written.

    However, even if your flash drive is not in an active state, accidentally removing it can lead to data corruption. This is due to caching, which is used in all operating systems. When copying, information is not immediately written to USB disk Instead, to speed up the operation of the device, part of it is stored in RAM and recorded when the system is freer or when you want to remove the flash drive.

    The system does not always transfer data directly to the disk, so if you unexpectedly pull the flash drive out of the connector, it is possible that not all data will be written correctly. The probability of such an outcome is lower than with active work flash drives, but it is there.

    Why do Linux, MacOS and Windows behave differently?

    Operating systems behave almost the same when working with any disk. This applies not only to flash drives, but also to hard drives built into the case. The data that needs to be written first goes into memory and remains there for some time. Also, the read data is cached in RAM, in case it is needed again.

    Thanks to this, the system works faster. After all, at one point in time with hard drive or the flash drive can only perform one write or read operation, and perhaps the system has more than one important tasks than to write your file.

    Safely removing a flash drive is even more necessary on Linux and MacOS than on Windows with default settings. Why is this so? operating system Windows does not use caching for drives that it considers removable. This is the default behavior of the system, but it can be changed for better performance. To do this, open Device Manager > Disk Devices > Disk Name > Properties > Policies:

    On the other hand, Linux and Mac use caching for all disks by default, including removable ones. Windows will behave exactly the same way if you select the option Better performance . Linux gives you full control over disk management, including whether you want to cache data. To do this, just create an entry for mounting the flash drive in /etc/fstab and add the mount option sync. For example:

    /dev/sdb1 /run/media/flash users,noatime,sync 0 0

    If you use the sync mount option, then all data that is sent to the disk will be written immediately. But note that the sync option does not override the safe USB extraction devices. Proper unmounting ensures that no more applications work with the flash drive and there is no unsaved data there.

    If the device is not unmounted and the file is open in a program, unexpected ejection can cause corruption at the file system level. There may be unfinished operations left before the file is closed.

    In addition, the sync option has a bad effect on the life of the flash drive. The kernel writes in batches to each sector as soon as it is needed. For cheap flash drives that don't redistribute servers, a modern journaled file system can be the last thing and kill the device very quickly.

    For file FAT systems You can use the flush mount option. It writes data as soon as the disk becomes inactive. This improves the situation a little.

    Always use safe removal

    If you remove the flash drive and do not unmount it first, it is unlikely that anything will happen to the flash drive itself; it will definitely not burn out. But if at this time something was writing data to it, then it will be lost. Therefore, it is better to make it a rule to always unmount linux flash drive before removing it from the computer, and this is true not only for Linux, but also for Windows.

    Moreover, all this is done in a couple of mouse clicks. In Ubuntu this can be done using File Explorer. KDE has a special taskbar widget that allows you to safely remove the flash drive:

    If you want to perform this action through the terminal, then everything is also a little more complicated:

    sudo umount /dev/sdb1

    Here sdb1 is the name of the flash drive device on your system. After this, the flash drive will be prepared for removal. In Windows, this must be done, because unlike Linux, this system can itself, without your knowledge, begin to perform any actions with a flash drive, for example, create a System Volume Information folder with metafiles.