December 1, 2022

How to Fix MTD Device Error in Linux

When your device freezes in the middle of a boot, it can be frustrating, especially when you don’t know what the problem is. This guide shows you how to fix your MTD device error and get your computer working again.

What is an MTD Device Error?

The full error message for an MTD device error is:

mtd device must be provided (device name is empty)

MTD stands for “Memory Technology Device”. This is your storage device, such as a solid state drive (SSD) or hard disk drive (HDD). The error message itself doesn’t tell you much about the cause of the problem. This means that Linux cannot access the storage device, which is impossible because your device displays if you see the error message.

How to Fix MTD Device Error

While this error may cause a bit of panic, as it prevents your device from booting, fixing it won’t cause the same panic.

1. MTD Pstore

This problem is caused by loading “systemd-pstore.service” before loading mtdpstore. This would lead to no loading of kernel modules and leave the device stuck in a boot loop.

Although this problem is recent, the solution to this problem is simple. An official patch was released on September 14, 2022. Update your distribution and main repository using the following commands to get the update.

sudo apt-get update
sudo apt-get dist-upgrade

2. Free up space

This is also called “0 byte error”. Filling up your storage space can cause your PC to start looping. I ran into this problem when I populated my VAR partition, so it’s probably a logging issue.

The solution is simple: access the Grub boot menu by pressing Escape on your keyboard after loading the bios to allow you to boot into recovery mode. Select the “Try to free up space” option.

Here you should be able to free up some space using the following commands:

Where

When using rm -rfmake sure you navigate to the folder and files you want to delete using cd. If you need root access, find out how you can open any file as root in Ubuntu.

If you are unable to free up space this way, you can always boot live from a Linux USB stick and delete files using the GUI. Setting up a Linux USB flash drive is simple: download the image file from the Ubuntu website and use the Boot Creator to set it up as a boot disk.

If needed, you can also boot into recovery mode in Ubuntu.

3. Secure Boot

Secure Boot detects malware or any malicious file that may launch on startup. The extra security is beneficial but can lead to boot problems, including the MTD device error.

To resolve this issue, access your motherboard’s BIOS by pressing the BIOS hotkey (F12, OF THE, F2 Where F10). Select the Security tab and disable Secure Boot. After restarting, the error message should disappear and your device should start. This process may differ slightly depending on your motherboard.

Secure Boot Screenshot

If “CSM Support” is enabled, you may not be able to access Secure Boot. Make sure it is on the disabled setting.

Point: If your Ubuntu Software Center is not working, we have the fixes here.

Frequently Asked Questions

Is the MTD device error only on Ubuntu?

Although the fix in the article is specifically for Ubuntu, this problem is not limited to it. Users reported this issue on Mint and Fedora. Patches are similar for all distros, so you don’t have to worry too much if you’re using a different one.

Is it a security risk to disable Secure Boot?

As long as you don’t download dangerous drivers and rootkits, there isn’t much danger in disabling Secure Boot. This is more of a problem on Windows than on Linux, as insecure third-party installs are rare on Linux.

Will a reinstall of GRUB fix the MTD device error?

The go-to fix for any boot problem is to reinstall GRUB or use the boot-repair ordered. Although your device may not be able to boot, the problem is not actually a bootloader failure, so using this command will not resolve the error. After going through all the fixes in this article, if your device still won’t boot, the problem is probably not an MTD device error, but something more serious.

Image credit: Pixabay. All screenshots by Nathan Meyer.

Was this article helpful?

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox