• Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Tech News, Magazine & Review WordPress Theme 2017
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

No Result
View All Result
Geeky Insider
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

Submit
Geeky Insider
No Result
View All Result

Top 3 Ways to Fix “No Space Left on Device” Error in Linux

by Staff Writer
August 30, 2022
in Gadget and Gear
Reading Time: 9 mins read
Top 3 Ways to Fix “No Space Left on Device” Error in Linux
Share on FacebookShare on Twitter

Table of Contents

Toggle
    • READ ALSO
    • Mastering Your Shots: Essential Photography Equipment and Gadgets
    • Level Up Your Game: Must-Have Gaming Gear!
  • Does Your Hard Drive Actually Have Enough Space?
  • Why Does Linux Show “No Space Left on Device”?
  • Fix 1: Restart Processes Using Deleted Files
  • Fix 2: Check Inodes
  • Fix 3: Mark Bad Blocks
  • What Is the Best Way to Fix the “No Space Left on Device” Error?

READ ALSO

Latest Smart Home Gadgets for a Connected Life

Latest Smart Home Gadgets for a Connected Life

September 1, 2023
Eco-Friendly Products for Students

Eco-Friendly Products for Students

August 24, 2023

Errors without a clear cause are the most irritating problems to deal with. And while Linux is usually specific in its error messages, this is one of the few times when it drops the ball.

Getting a “No place left on device error” explains very little, especially if your drive is far from full. Why is this error message showing up? Why can’t you create new files despite having sufficient space on the disk? And most importantly, how do you fix it?

Let’s find out.

Does Your Hard Drive Actually Have Enough Space?

Before you rush to find a fix, make sure there is a problem, to begin with. After all, if disk space has actually run out on your system, there is no need to panic. You can just remove unnecessary data to free up more space.

There are two Linux system commands for getting information about disk space – du and df. The du command estimates the disk space usage, while the df command analyzes the free space present on the disk. Using them in conjunction with sudo gives you an accurate report of how much space is actually available on the disk.

  1. Let’s start with the du command. Its output can be rather long and cumbersome to go through, so we will use the -s and -h flags. -s summarizes the results, while -h ensures it is human readable. So enter the command sudo du -sh / where / points to the base directory.

  1. Don’t worry about all the permission denied messages – that’s how it trawls through all subdirectories of the system. Depending on the size of the drive you may have to leave it running for a while, as it recursively goes through everything.

  1. When du finishes scanning, it will output a simple list of directories alongside their sizes. For example, this is the output of the du command applied to an ordinary directory.

Now we will use df to see how much free space is available. The df command is much simpler to use since it only shows the mounted filesystems and their usage statistics. Once again, we will use the -h flag to make the output human readable.

sudo df -h

The idea is to tally the results of the du and df commands. Any discrepancy points to disk space that is not freely available despite not being used by any files or folders.

Why Does Linux Show “No Space Left on Device”?

If you are seeing the “No Space Left on Device” error message despite having sufficient free space on your disk, it’s not the hardware that’s at fault. Figuring out the exact cause for the error can take a bit of troubleshooting.

  • Recently Deleted File: The most common reason for seeing this error is a recently deleted file. Often a file is deleted while a process is still using it, keeping the space reserved even though the file is already gone.
  • Not Enough Inodes: Another frequent cause is not having enough inodes. Inodes are the index pages of a Unix filesystem, holding the metadata of every file on storage. However, inodes aren’t unlimited, and running out of inodes before the storage space can give you the “No space left on device” error.
  • Failing Hard Drive: Then of course there is the possibility that the hard drive is simply failing, and much of the apparent free space is taken up by bad sectors. Since the system fails to write any files to these locations, it throws an error.

Fix 1: Restart Processes Using Deleted Files

The most probable cause of the “No space left on device” error is a process still using a deleted file. Thankfully, fixing this error is easy. You just need to restart the process to free up the reserved storage.

  1. To find the problematic process, you need to use the lsof and grep commands. The lsof command will give you a list of all open files being used by running processes, and grep can narrow down the selection to the ones that are deleted. So enter sudo lsof / | grep deleted where / is the base directory and | a pipe for linking lsof’s output to grep.

  1. Now you can restart the affected process with the sudo systemctl restart service_name command, where the service name is the name of the service that turned up in the search.

  1. If there are multiple processes like this or you just don’t want to bother with finding specific services, you can just reset them all with the sudo systemctl daemon-reload command. This regenerates all dependencies, taking any changes in the filesystem into account.

After this the storage space being held up by the process should be available again, allowing you to write files without running into any errors.

Fix 2: Check Inodes

While each drive has a large number of inodes, it is finite. And if your system is littered with an incredible number of files, it is possible to reach this limit before exhausting the storage capacity of the drive. This is why it’s better to have large files rather than too many small ones.

You can easily check the availability of inodes by using the -i flag with the df command. Like this:

sudo df -i

This will clearly tell the total number of inodes present in the filesystem, along with the amount currently in use. If there are no free inodes left on your system, this is the source of the “No space left on device” error.

As inodes are only created upon first formatting the drive, there is no way to generate more inodes. All you can do is delete any unnecessary files to free up inodes for future files.

Fix 3: Mark Bad Blocks

Data corruption is the inevitable fate of any hard drive. While a new drive will not run into this issue, older hard disks will gradually start going “bad”.

What this means is that portions of the hard drive are rendered unusable, even though the filesystem still considers them functional. These bad blocks falsely inflate the apparent free space on the drive, when in truth no files can be written to them. This leads to a “No space left on device” error, as the operating system tries and fails to store any data on these locations.

There is no real way to fix this issue, as bad sectors are a result of the physical wear and tear of a hard drive. The only thing you can do is mark the bad sectors so that they are no longer referenced by the file system.

Doing this requires you to boot from a Live CD, as you cannot perform a File System Check within a running drive. Once you do that, just use the following command:

sudo fsck -vcck /dev/sda

This replaces the /dev/sda with the path of the drive you want to repair. This will automatically detect all bad blocks on the drive and mark them as unusable. It won’t give you any extra storage capacity, however, so be prepared to clean up some useless files to free up space on the drive.

What Is the Best Way to Fix the “No Space Left on Device” Error?

The usual reason for seeing a “No space left on device” error on Ubuntu or any other Linux distro is a deleted file still being used by a running process. This reserves the storage that was occupied by the file, preventing other operations from writing data to that space.

Fixing this problem is also the easiest, as all you need to do is to restart the process in question. The other causes of the error, however, are not that easy to solve.

Whether your drive is plagued by bad data blocks or has run out of inodes, there is no direct way to fix these issues. You must delete existing files to make room for new data to be written.

Source by helpdeskgeek.com

Related Posts

The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung
Smartphone

The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

July 11, 2024
Exploring the Innovative Features of Pear Phones
Smartphone

Exploring the Innovative Features of Pear Phones

October 25, 2023
Latest Smart Home Gadgets for a Connected Life
Gadget and Gear

Latest Smart Home Gadgets for a Connected Life

September 1, 2023
Eco-Friendly Products for Students
Gadget and Gear

Eco-Friendly Products for Students

August 24, 2023

Recommended.

samsung galaxy z fold 4 standing multitasking

The Samsung Galaxy Z Fold 4 is great, but its Android 12L I really love

September 18, 2022
Low-Power-Mode

iOS 16 beta 5 brings the battery percentage back – here’s how to remove it

August 9, 2022

Trending.

No Content Available
  • Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Contact us for submission queries. editor[at]geekyinsider.com.
No Result
View All Result
  • Home
  • Review
  • Apple
  • Gaming
  • Gadget and Gear
    • Camera
    • Smartphone
  • Microsoft
  • Security