Fix 2 : Using the du Command

Now that you know which storage space is causing the problem, try finding out which folders and files are taking up the most space by using the du command. Use the -h option to show the sizes in a way that’s easy to understand, and you can optionally use the sort command to put all the biggest folders at the top of the list.

Command :

sudo du -h | sort -h

Output :

Sort the Files by their Size

How to Fix the “No space left on device” Error in Linux

When you try to save files or write data on a Linux system, you might get the “No Space Left on Device” error. This error means that the storage space you are trying to use is full and does not have enough room left for your operation. To fix this error, you can either make more space available in the storage space or increase the total amount of storage space.

In this tutorial, we will show you how to resolve the “No Space Left on Device” error and review some basic Linux commands to help you identify the problem.

How to Fix the “No space left on device” Error in Linux

  • Fix 1 : Using the df command
  • Fix 2 : Using the du Command
  • Fix 3 : Clear your Browser Cache
  • Fix 4 : Clearing Temporary Files
  • Fix 5 : Deleting Old Log Files
  • Fix 6 : Clearing Package Cache
  • Fix 7 : Resizing Partitions
  • Fix 8 : Removing Unnecessary Software

Similar Reads

Fix 1 : Using the df command

There are several ways to fix the “No Space Left on Device” error on Linux. The most obvious way is to delete some files or data on the storage space to make more room. Another way is to make the storage space bigger. We will go over how to do this in the steps below....

Fix 2 : Using the du Command

Now that you know which storage space is causing the problem, try finding out which folders and files are taking up the most space by using the du command. Use the -h option to show the sizes in a way that’s easy to understand, and you can optionally use the sort command to put all the biggest folders at the top of the list....

Fix 3 : Clear your Browser Cache

One quick way to make more space is to delete the temporary files stored by your web browser. These files can sometimes take up a lot of space on your computer without you realizing it. The steps to do this will be a little different depending on which web browser you use, but it’s usually easy to find the option in the browser’s menus....

Fix 4 : Clearing Temporary Files

Open your file manager and then in the Left Side menu click on the Computer and then Double click on File System....

Fix 5 : Deleting Old Log Files

Open terminal and Go to the /var/log directory by using the below command....

Fix 6 : Clearing Package Cache

When you install software programs on your Linux system, temporary package files get stored in a cache. Over time, this cache can take up a lot of space unnecessarily....

Fix 7 : Resizing Partitions

If clearing out files does not free enough space, you may need to make the partition itself larger, to do that follow the below steps....

Fix 8 : Removing Unnecessary Software

Over time, you may have installed programs on your Linux system that you no longer need or use. These programs take up disk space that could be recovered....

Fix the “No space left on device” Error in Linux – FAQs

What does the “No space left on device” error mean in Linux?...

Conclusion

If you are seeing the “No Space Left on Device” error on your Linux system, it means the storage space is full. To fix this, you can delete some files or folders that are taking up a lot of space. Use the df command to find out which storage is full. Then use the du command or the Disk Usage Analyzer program to see which folders are the biggest. You can also clear your web browser’s cache to free up space quickly. If you still need more space after deleting files, you may need to make that storage space bigger by adding more storage or extending the partition size....