How to Fix an MTD Device Error in Linux

Spread the love

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 up and running again.

Content

What Is an MTD Device Error?

The full error message for an MTD device error is:

mtd device must be supplied (device name is empty)

MTD stands for “Memory Technology Device.” This refers to your storage device, like 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. It means that Linux cannot access the storage device, which is impossible, as your device is posting if you’re seeing the error message.

How to Fix an MTD Device Error

Although this error can cause a bit of panic, as it prevents your device from booting, fixing it will not cause near the same amount of panic.

1. MTD Pstore

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

Although this problem is recent, the fix for this is simple. An official bugfix was released on 14th September 2022. Update your distro and main repository using the following commands to get the update.

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

2. Freeing Up Space

This is also called the “0 bytes error.” Filling your storage can cause your PC to boot loop. I encountered this problem when I filled my VAR partition, so it’s likely a logging issue.

The fix for this is simple: access the Grub boot menu by pressing Escape on your keyboard after the bios has loaded to allow you to boot into recovery mode. Select the “Try to make free space” option.

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

sudo apt autoremove

or

rm -rf <file/foldername>

When using rm -rf, make sure you navigate to the folder and files you want to remove using cd. If you need root access, learn how you can open any files as root in Ubuntu.

If you’re unable to free up space this way, you can always live boot from a Linux USB and remove files using the GUI. Setting up a Linux USB is easy: download the image file from the Ubuntu website and use the startup creator to make it set up as a startup disk.

If necessary, you can also boot to Recovery mode in Ubuntu.

3. Secure Boot

Secure boot detects malware or any malicious files that may launch on boot. The additional security is beneficial but can cause boot issues, including the MTD device error.

To fix this, access your motherboard BIOS by pressing the BIOS shortcut key (F12, DEL, F2 or F10). Select the Security tab and disable secure boot. After rebooting, the error message should be gone and your device should boot. This process can differ slightly based on your motherboard.

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

Tip: 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 bugfix in the article was specifically for Ubuntu, this issue is not limited to it. Users have reported this issue on Mint and Fedora. The fixes are similar for all distributions, so you don’t need to worry too much if you’re on a different one.

Is it a security risk to disable secure boot?

As long as you aren’t downloading unsafe drivers and rootkits, there’s not much danger in disabling secure boot. It’s more of an issue in Windows than Linux, as unsafe third-party installations are rare in Linux.

Will a GRUB reinstall fix the MTD device error?

The go-to fix for any boot issue is to reinstall GRUB or use the boot-repair command. Although your device is unable to boot, the issue is not actually a bootloader failure, so using this command will not fix the error. After you’ve run through all the fixes in this article, if your device is still not booting, the issue is likely not an MTD device error but something more serious.

Image credit: Pixabay. All screenshots by Nathan Meyer.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe
Comments are closed