Random Access Memory, or RAM, is an important part of any computer system. If you set up a new Ubuntu environment or VPS (Virtual Private Server) and you do not have an idea about the internal memory details of your system, such as how much RAM is installed and used on your system, then you can easily test all information about your computer’s memory using a memtest software program. Memtests are memory test utilities designed to test your computer’s RAM for errors. There are 86+ memtest programs included by default in most Linux distributions, including Ubuntu 20.04. If a memtest program is not included in your distribution, then you can create a portable test drive from the USB from which to boot and run the memtest. This utility writes the test patterns of memory addresses, reads data, and compares for errors.
This article will show you how to run a memtest in Ubuntu 20.04. The article will also explain more about memtester command-line utilities, which can be used to check RAM errors.
To perform the memtest shown in this article, Ubuntu 20.04 must be installed on your system, and the memtest86+ option should be available in the GRUB menu.
How to Run Memtest86+ in Ubuntu 20.04
Performing a memory test in Ubuntu is easy compared to other distributions. Perform the following steps to run a memtest on your Ubuntu 20.04 system.
Step 1: Access GRUB Menu
As you may know, Memtest86+ runs without an operating system. Therefore, you must have access to the GRUB menu in Ubuntu. Turn on or restart your system and hold down the ‘Shift’ key to access the GRUB menu. The following window will display upon starting up the system:
Step 2: Select Memtest86+
The following list of options will be displayed in the GRUB menu. Using the arrow keys, select the ‘Memtest86+’ option, marked with an arrow in the image below:
Press the ‘Enter’ key to run the Memtest86+ program.
Step 3: Quit Test
The test will start to run automatically on your system and continue until and unless you quit the running process by pressing the ‘Esc’ key. It is best practice to run the test for one full pass. In the output window shown in the following image, the details about the test are highlighted in red.
You have now successfully executed the memtest on your Ubuntu system. This is like a game to check if any errors are detected or if your system restarts. It is recommended to run the memtest for many passes, because sometimes, an error might not be detected until a second pass. Each pass may take many hours or days to complete, depending on how much memory is installed on your system. So, it is recommended to run the memory test at the end of the day to obtain the best results. If your system has a large volume of memory and crashing is infrequent, then may be a good idea to run the test over the weekend. If you have Error Correcting Code (ECC) memory, then you can easily get errors with doing one pass only. It will correct all errors on its own. If you have the time to perform a second pass for error detection, in this case, we recommend that you do so.
Run Memory Test Using Memtester Utility
Memtester is a command-line utility that you can use to check your RAM for errors.
The memtester utility is not installed on the Ubuntu system by default. But, you can install the utility using the following command:
Check Errors Using Memtester
Once the memtester is installed on your system, you can run the memtester command on your system to check the RAM for errors. Use the following syntax to run the memtester command:
In the above command, ‘size’ is the amount of memory that you want to allocate and ‘iteration’ is the number of times to run the command to check for errors, or the number of passes.
For example, to run a memtester command for memory size 200 M for 1 iteration, the above command will change into the following format:
After entering the above command, the following output should display on the terminal:
From the information provided in this article, you learned how to run Memtest86+ in Ubuntu 20.04. This feature can be useful if your system has been crashed many times. Before filing any bug report, first, you should perform the memtest. Moreover, you also learned how to run a memory test using the memtester command-line utility. Hopefully, after reading this article, you are now able to perform a memory test for your own system.