Disabling head parking on Western Digital hard drives. We solve the problem with games periodically freezing for half a second, a second. Consequences of incorrect Mikrotik configuration and a critical bug in RouterOS

While working at a service center, I increasingly began to encounter failures of hard drives in laptops. And the strange coincidence in this situation was that 80% of these disks were 500GB in size. I even stopped advising my friends and clients to buy disks of this size. And this went on for a couple of months until I noticed my own hard drive (hard drive) in my home laptop. What strange thing did I notice? The answer is simple. Periodic extraneous sounds. Sounds that were only audible if you listened very carefully and only when the laptop was standing and I was not doing anything on it.

I'll say right away, I had a hard drive Western Digital 640GB BLUE SATA2 2.5" WD6400BEVT and there were no suspicions of its abnormal operation before, I regularly looked at the S.M.A.R.T. values, everything was fine with them, there were no bad or reassigned sectors on the hard drive. So what were those quiet sounds that the hard drive was making? I set myself a goal and started looking for similar complaints on the Internet and immediately found what the problem was.

It turns out that modern hard drives have a technology for parking the head unit when idle. For what? To save the resource of the heads themselves, disk platters and electricity. The heads hanging above the plates create additional aerodynamic drag, because The discs rotate at a fairly high speed, then the air in the can is drawn into rotation along with them, and the head block slows down these air flows. The resulting chaotic “gusts of wind” in turn create additional resistance for the rotation of the plates and energy consumption increases, which increases the temperature, which is harmful to the heads. As an example, I’ll say that for 3.5-inch disks with a rotation speed of 7200 rpm, the linear speed of the edges of the plates is approximately 120 km/h, and at such speeds the air is already quite tangible, as you can personally verify by sticking your hand out of the car. So, when the computer takes a break from work, and the hard drive along with it, then after a while the Advanced Power Management functions come into operation and they park the hard drive heads. Everything would be fine, but the idle time before activating the energy saving function in some disks is only a few seconds; as a result, it turns out that the disk parks its heads very often. Disk manufacturers claim that disks can easily withstand up to 1 million parking spaces (depending on the disk model), but in practice the number of parking lots increases very quickly and after half a year of disk operation this number can exceed 200 thousand!

But this educational program should not bother you. Frequent parking will cause your drive to die much earlier than all the phenomena described.

So let's go back, as they say, to our sheep. On my WD6400BEVT drive there were about two thousand parking lots every day, and in just two years it would definitely die from constant parking. I don’t know why my disk had this problem, it was “BLUE” BLUE, although this usually affects models of the “GREEN” GREEN series of disks, the main purpose of which is to save energy.

So. How to check your disk for the presence of such a “disease”? The answer is simple. You need a program that will show you the S.M.A.R.T. parameters. This could be, for example, the AIDA64 (Everest) program or similar. AIDA64 (Everest) is a hardware monitoring program, in this case we will be interested in the information as in the picture.

We are primarily interested in the parameter С1 Load/Unload Cycle count- the number of head parkings, if this parameter is several times greater (or tens of times) than the parameter 0С Power Cycle Count- the number of disk power-off cycles (can be considered the number of times the computer is turned on if the disk was installed in it initially). This is our case!

What will help us? And a little program called WDIdle3. It only works with Western Digital drives, although this problem is not limited to Western Digital drives. In the screenshot you saw above, the S.M.A.R.T. indicators. Hitachi HTS721010A9E630 1TB 2.5" 7200rpm hard drive - it also suffers from frequent head parking, but this program does NOT help it. With Hitachi drives the situation is a little more complicated and I will not describe it in this article.

So here it is. First we need to prepare our computer for “treatment”, or to be more precise:

  1. Switch the disk operating mode to IDE in the BIOS if you have AHCI installed. Some laptops cannot be set to IDE, so the drive must be removed and connected to a desktop computer.
  2. Create a boot floppy disk or USB flash drive with DOS. Read how to create a bootable USB flash drive with DOS if you don’t know how to do this.
  3. WDIdle3- actually herself utility version 1.05, the utility was created for a very limited set of disks on which this problem first appeared, but works with all WD disks.

If you have already done all three steps, then unpack it from the WDIdle3 archive and copy it onto a flash drive or floppy disk (depending on what you are using). It is recommended to physically disconnect all other drives except the one you plan to work with and, of course, do not forget to make a backup of the data (but who will do that :) So, boot from the flash drive and enter in the command line:

wdidle3 /r

The command displays information about the current settings of the head parking timer; if the value is read from your disk, then a new one will be written, which seems logical, write down the original value just in case to return the disk under warranty or the disk reacts inadequately. For example, on my disk there were 8 seconds.

So, the head parking timer time was found out and remembered or written down. Now we need to set a new, longer time or turn off the timer altogether. To do this, run the program with the commands:

wdidle3 /d

The command to stop the timer, this setting completely disables head parking during operation.

wdidle3/s210

The team sets the timer to 210 seconds. It must be remembered that when setting the timer from 8 to 12.7 seconds, you can set it with an accuracy of 0.1 seconds; when setting from 12.8 to 30 seconds, the timer is always set to 30 seconds. Values ​​from 31 to 300 seconds are set with an accuracy of 30 seconds.

Help on using the utility can be obtained with the command:

wdidle3 /?

This command provides help on using the utility.

After changing the parameters, you need to type again:

wdidle3 /r

Thus, we can make sure that the new value has been registered and is already After this, be sure to TURN OFF THE COMPUTER POWER holding down the power button for 3-5 seconds.

Now turn on the computer and load Windows. For those who have disconnected additional drives, you can connect them again before turning on the computer, and those Anyone who switched the disk operating mode to IDE in the BIOS needs to go into the BIOS and switch it back to AHCI mode, otherwise you will get a blue screen of death when loading Windows.

Just today I changed the head parking time on two “GREEN” disks Western Digital 2TB WD20EZRX and Western Digital 2TB WD20EARX - the problem disappeared, the time was 8 seconds on each, it became 240 :) The disks work and do not park as often as it was before! Hooray!

Despite the relatively large amount of material on Mikrotik in this blog, it does not cover even a tenth of the main possibilities for using RouterOS and Mikrotik for home and office purposes.

In addition to the materials presented, I strongly recommend that you familiarize yourself with the basics of network technologies (basic), in the future this will greatly simplify your life when working with equipment from Mikrotik or any other vendor. Those who are attentive will probably have noticed that at the top of the site there is a large horizontal banner, which offers an analogue of the MTCNA course. If you are a beginner, I would recommend taking a short course in Networking Fundamentals from the same author before you begin studying the MTCNA exam materials.

If you have ever used self-signed certificates on Mikrotik (point #5), then you have definitely encountered the fact that modern browsers will refuse to accept such a certificate, giving an error.

In an enterprise network, such a certificate is still better than its absence. Today we will talk about how to install a full certificate for WebFig and/or HotSpot. In order for browsers to “not swear” at the certificate, it must be valid; a number of conditions must be met.


No sooner had the first solutions supporting the 802.11ad standard appeared on the market than Qualcomm followed them with the introduction of chips supporting the latest 802.11ay standard.

As you remember, in mid-2017 we became aware of the close cooperation between Qualcomm and Mikrotik in the implementation of the 802.11ad standard. Over the past year and a half, Mikrotik has been actively working to improve its 60 GHz solutions. As we can see, quite active work is going on in this direction. Just the other day I came across an interesting press release from Qualcomm, which talks about the release of chips that support the 802.11ay standard.


No sooner had Mikrotik announced Newsletter 86 than the 87th release was already presented. At the same time, the previously announced PWR-Line AP has not even reached retail yet, against this background the 87th release is causing some indignation.

As previous announcements and individual threads on the official forum show, Mikrotik is serious about releasing solutions that support 10 Gbps speeds. Either the company decided to keep up with Ubiquiti with their XG solutions, or the market has really grown and is ready to introduce 10 Gbit speeds.

Modern WD desktop drives have technology that parks the disk head block when idle. Everything would be fine, but the downtime on some drives is only a few seconds, and in the end it turns out that they park very often. The manufacturer claims that the discs can withstand from 300 to 600 thousand parking lots without problems (depending on the model), but this number adds up very quickly!

First, I’ll tell you a little why they came up with parking the head block when idle. This is done to reduce wear on heads, plates and reduce energy consumption. The heads hanging above the plates create additional aerodynamic drag, because The discs rotate at a fairly high speed, then the air in the can is drawn into rotation along with them, and the head block slows down these air flows. The resulting chaotic “gusts of wind” in turn create additional resistance for the rotation of the plates and energy consumption increases, which increases the temperature, which is harmful to the heads. As an example, I will say that for a 3.5-inch disk with a rotation speed of 7200 rpm, the linear speed of the edges of the plates is approximately 120 km/h, and at such speeds the air is already quite tangible, as you can personally verify by sticking your hand out of the machine. :) But this educational program should not bother you. Frequent parking will cause your drive to die much earlier than all the phenomena described.

Some people say that this problem is specific only to Linux. However, on Windows with the WD2001FASS disk, I accumulated about 20 thousand parking lots in a week, I’m afraid it would definitely die from this in a year. Although this usually affects green series models. For those who are afraid, I can say that the utility can show what is considered the current idle time before parking the heads. For example, I had 12.8 seconds! True, don’t forget one thing, but if, say, bad blocks appear sometime in the future and you have to bring the disk under warranty, run the utility again and return the original values, because If they notice a changed time, your warranty will be voided. :)

So we need:

Switch the disk operating mode to IDE in the BIOS if you have AHCI installed. Some laptops cannot be set to IDE, so the drive must be removed and connected to a desktop computer.

AIDA64 (Everest)- iron monitoring program, in this case we will be interested in S.M.A.R.T data, namely the parameter 193 Load/Unload Cycle count - number of head parkings, if this parameter is several times greater (or tens of times) than 12 Power Cycle Count - the number of disk power-off cycles (can be considered the number of times the computer is turned on if the disk was installed in it initially). This is our case!

Bootable USB flash drive with DOS- everything is written there how to do it. The utility works under DOS...

Actually, the utility itself is version 1.05, the utility was created for a very limited set of disks on which this problem first appeared, but it works with all WD disks.

So we made a bootable flash drive and unpacked it from the WDIdle3 archive and copied it onto a flash drive. During this operation, I disconnected all other drives and, of course, made a backup of the data! We boot from it and start entering into the command line:

wdidle3 /r - information about the current settings of the head parking timer, if the value is read from your disk, then a new one will be written, which is logical, just in case, write down the original value for returning the disk under warranty or inadequate response of the disk.

wdidle3 /d - stop the timer, this setting completely disables head parking during operation (which is what I did for myself)

wdidle3/s50 - sets the timer for 50 seconds. When setting the timer from 8 to 12.7 seconds, you can set it with an accuracy of 0.1 second. When set from 12.8 to 30 seconds, the timer is always set to 30 seconds. Values ​​from 31 to 300 seconds are set with an accuracy of 30 seconds.

wdidle3 /? - help on using the utility

After changing the parameters, you need to dial again wdidle3 /r to make sure that the new value is registered. It is written that the work can take a long time, changing the parameter took about a second for me... Well, as they traditionally write in such articles, you do everything that is written at your own peril and risk.

Questions on the topic: “Will this work on my disk?” not accepted. Make sure that you have a Western Digital drive, look at the two smart parameters above and use the utility itself to see how long your head parking timer is set.

P.S. In some cases, there are incomprehensible disk glitches when the time is changed upward or the parking is completely disabled. I recommend that you first try to disable it completely and if the disk works fine, then leave it that way. If the disk behaves “incomprehensibly” - constant head parking or “blue screens” - increase the parking time. Considering the 32 thousand views and 8 pages of comments on this article (at the time of writing this sentence), one person started experiencing blue screens after changing the parking time. Some disks do not respond quite adequately to time changes. But the change in parking time did not lead to irreversible fatal consequences for anyone.

Modern laptop manufacturers go to various lengths in order to gain extra minutes of battery life. Often, sometimes with very dubious measures. For example, installing hard drives with an aggressive energy saving policy. For example, this model is installed in my new laptop.

Of course, this is a temporary measure. In the near future, I will install an SSD in the laptop and the hard drive will be used only for data storage. But this does not change the essence of the issue. When running on battery power, the drive turns off too often, which is not good. Firstly, it slows down the system. And secondly, a decrease in disk resource. Yes, maybe a small one, but a decrease. Therefore, our task is to make it always work. Perhaps this will reduce autonomy, but I don’t think so much as to regret it.

The easiest way is to use the power settings in Windows. But this doesn't always work. For example, in my case.

We will solve this problem radically, once and for all. For this we need the hdparm utility. You need to download it (based on the bit capacity of your system) and install it. This utility is good because it is universal and works with all drive models from all manufacturers. Then go to the c:\Program Files (x86)\hdparm\ folder and set the compatibility for hdparm.exe.

Then somewhere in a secluded place we save the bat file with the following contents. If you need to apply the setting to the second disk, replace hda with hdb. To the third - replace hdb with hdc, etc.

MS DOS

@echo off cd c:\Program Files (x86)\hdparm\ hdparm -B 255 hda exit

@echo off

cd c:\ProgramFiles(x86)\hdparm\

hdparm-B 255hda

exit

And a file with the extension vbs.

Visual Basic

Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "D:\alex\!!System\NoAPM.bat" & Chr(34), 0 Set WshShell = Nothing

Set WshShell = CreateObject("WScript.Shell")

WshShell. Run chr (34 ) & "D:\alex\!!System\NoAPM.bat" & Chr (34 ) , 0

Set WshShell = Nothing

After this, we are supposed to have two files named NoAPM.bat and NoAPM.vbs. Please note that in the vbs file you must specify the current path to the file with the bat extension!

What have we done? And we have taken the first step towards solving the problem of frequent parking of the hard drive head. The hdparm utility switches the APM (Advanced Power Management) mode of the hard drive to the minimum saving mode and disables the notorious parking in each case. Now we need to automate the process of applying this setting when the computer boots and when exiting sleep mode or hibernation. Everything is simple here, we use the scheduler built into Windows.

Create a task with settings as in the screenshot.

It is important to pay attention to several nuances. On the very first tab you need to check the “Run with highest rights” checkbox. On the triggers tab, add two triggers: the first to activate a task when any user logs into the system, the second when an event occurs in the “System” log. We specify the event source as Power-Troubleshooter, and the event code is 1. Our action is launching the same vbs file. This will get rid of the annoying command line window that will appear for a second when loading or waking up. Now on the “Conditions” tab, you need to uncheck the “Run only when running on mains power” checkbox. And finally, on the last tab, uncheck the “Stop a task that takes longer to complete” checkbox.

That's all. Our problem is solved. Now, when the system starts and any user logs in, power saving on the hard drive will be forcibly disabled once and for all. Likewise after sleep and/or hibernation. You can check this, for example, after booting, sleep or hibernation like this through the CrystalDiskInfo utility.

P.S. Don't forget to disable hdparm autorun in Windows settings!

The following problem was observed on one of the computers: the computer constantly experienced freezes for a second, this was especially noticeable in games; when idle, the hard drive began to crackle. It turned out it was all about hard drive head parking, everything would be fine, but the disk parked the heads after 8 seconds of idle time. Some screws (probably some cheap models) take a long time to return to working condition after parking the heads, which leads to freezes in games. The second thing you need to pay attention to is that hard drive manufacturers claim that hard drives should withstand from 300 to 600 thousand parking spaces. My hard drive is less than a year old, but S.M.A.R.T given parameter Load/Unload Cycle count has already exceeded the one hundred thousandth mark, although the number of disk power-off cycles is slightly more than a thousand ( Power Cycle Count). In this article, I would not like to encourage anyone to perform this operation, but just consider how it is done. I've come across hard drives with more than a million parking lots that worked flawlessly. On the Internet I came across an article entitled “WDIdle3 - disabling head parking on Western Digital hard drives,” but unfortunately the utility discussed there supports a small number of disks Western Digital. By using WDIdle3 You can increase the downtime before parking the heads to 5 minutes, or turn it off completely. You can also disable parking by changing APM(Advanced Power Management), a parameter responsible for the power consumption of the hard drive (1 - 254). By default, for my WD drive this parameter was set to 96 , although many have the default value set to 128 . According to some statements, to reduce the number of parking lots, it is enough to set the value APM in 128. When the power is turned off, the parameter Advanced Power Management is reset to the default value, so later in the article I will look at disabling head parking through APM in automatic mode, by adding a task to the scheduler.

Utilities

1. To change the APM parameter we need the HDParm utility. 2. To prevent the command line window from being visible during startup, we use the hidcon utility.

Installation

1. Install HDParm in the default directory c:\Program Files (x86)\hdparm\ 2. Copy hidcon.exe to the same directory 3. Here we create a file hdparm.cmd, which will be responsible for changing APM, with the following content: @ECHO OFF cd "%~dp0" hdparm -B 255 hdb exit 255 - disables APM , you can specify the desired value without turning it off by specifying from 1 to 254. hdb - indicates that we are changing the value of the second hard drive in the system (hda, hdb, hdc ...)

Settings

1. For hdparm We set WinXP compatibility and run as administrator. 2. For hidcon It is also advisable to set it to run as administrator. 3. Launch the task scheduler. Press on the keyboard Win+R and in the window that appears, type the command: %SystemRoot%\system32\taskschd.msc /s 4. Create a task:

Event here System - Power-Troubleshooter - 1 created to disable APM when waking from sleep. Now, when the system starts, Advanced Power Management will be disabled, which will lead to disabling hard drive head parking.