LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2017, 02:15 PM   #1
darose78
LQ Newbie
 
Registered: May 2004
Distribution: Ubuntu 16.04
Posts: 3

Rep: Reputation: 0
No space left on drive


I am inexperienced in Linux having previously dabbled, but abandoned my efforts because of frustration. I now have more time and have resumed my acquaintance via Ubuntu 14.04 /16.04. (Kernel: 4.10.0xxxx)
I currently have two hard drives, 750 Gb (sda1) and 350 Gb sdb1 mounted as /mnt/backup.
Without prior warning, I suddenly was notified that I had 0 bytes space remaining on my hard drive. Despite deleting (NOT removing to 'Trash') three .iso images and several other files from my Downloads folder the figure remained at 0 bytes. I even rebooted only to find the same message, but no GUI.
Disconcertingly, I was subsequently not even permitted to delete files. A message reminded me that there was insufficient space to do so.
I will add that there were no previous versions of the kernel present.
I have two 1Tb drives itching to replace the above, but to further my education I would like to know:
1. How can I recover from this situation (not disaster.)?
2. Any advice on how best to manage my storage. Ideally, I would like to separate system from programs from data, but at the least manage data separately.
David Rose
 
Old 08-19-2017, 03:19 PM   #2
pdixit
LQ Newbie
 
Registered: Jul 2016
Distribution: Fedora 24
Posts: 15

Rep: Reputation: Disabled
Hi Devid,

You can monitor it better that which data is increasing and how can you manage it. As you mentioned that you have two drive sda and sdb. are you using LVM? because then it will be easy to manage the space and no need to delete the old data from drive. can you post your disk configuration here?

you can set drive alert to get the mails when your disk space will almost full. for example you wants alert when your drive becomes 90% full. you can create an script and set it to the cron job. For example, check the link below:

http://www.linuxjournal.com/content/...space-gets-low
 
Old 08-19-2017, 03:36 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
The first thing I'd do is boot to a Live Ubuntu CD or DVD and copy your files to a usb flash drive or an external drive if you have one.

To insure that your 750 GB drive and your 350 GB drive have not went south on you use S.M.A.R.T. to check the reliability of the drives.

https://en.wikipedia.org/wiki/S.M.A.R.T.

https://sourceforge.net/projects/smartmontools/

Run Memtest overnight to make sure the RAM isn't bad.
http://www.memtest.org/

You might want to check on the 'file system' as well. Make sure it hasn't been corrupted.
http://www.thegeekstuff.com/2012/08/...mand-examples/

As far as not having enough space left on the device message that your getting you can try adding more space to the partition. OR> boot to a Live CD/DVD and delete the unnecessary files that way.
You could also try clearing the pkg cache.

Code:
sudo apt-get clean
To remove files as root:
Code:
sudo rm /path/to/file
If suddenly you don't have a GUI it sounds like your DE crashed.
Run "starx" and see if it takes you to your DE. Should that fail you can always install another DE.


What is the output of:
Code:
cat /etc/os-release
Once you have a GUI you could use nautilus with root privileges to remove files.
Code:
gksudo nautilus
Be very careful running your system in this mode. Only delete or remove what's necessary.


Storage Management

There are many ways to manage storage.
Most members here back up their files and other data to an external drive or a server. A USB flash drive with enough gig's would be sufficient as well.

You could also create as many partitions as you like to manage files and data and use the Cloud:-

https://www.ubuntu.com/cloud/storage
https://ubuntuforums.org/showthread.php?t=1696116

Last edited by Ztcoracat; 08-19-2017 at 03:39 PM.
 
Old 08-20-2017, 07:05 AM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
Quote:
I suddenly was notified that I had 0 bytes space remaining on my hard drive.
Which one? There are surely partitions on your drives? Run
Code:
 $ df -h
to see what's causing the problem. Usually you find it's the root (/) partition which is full as it can hold a lot of the sub directories which the Distro might not allocate to separate partitions on install. Log files, and added applications can fill it up if it's small. How much space was allocated to the / partition?

If so, as mentioned you'd need to allocate a bigger / partition and without LVM it means backing up all your data then doing a clean install. (or it did in my day!)

You can then mount /home on a separate partition so your data will be safe if you ever have to re-install again (as long as you mark the partition as "don't format" during the partitioning section of the install)

My

Play Bonny!

 
Old 08-20-2017, 08:47 AM   #5
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
Pardon me, if my suggestions are somewhat “frugal” and unsophisticated...

I am facing the problem with “No space left on drive” quite regularly, because I am updating my stretch/sid system quite often. Put the other way around: Updating my Linux-system fills the hard drive with files, and quite regularly, which may be a difference with your own situation.

A proposition: Install a simple program like Baobab (when it is possible again). The next time that you are informed that there is no more space left, see what happened in the /var directory. As you are using Ubuntu, see what happened in /var/cache/.

My solution is to start up aptitude, because I am still accustomed to this package management program, then under “Actions” (first menu) I execute “purge packet cache”.

The menu commands are translated from German and may have different designations in the English locales. For apt-get the corresponding command would be “clean”. “autoclean” may appear more useful, as it keeps useful packages available. But as they are probably already installed, anyway, the definition of “useful” can be discussed.

Sorry, if I missed the point.

Last edited by Michael Uplawski; 08-21-2017 at 02:43 PM. Reason: Too verbose, the key words are not found. So fat and purple will do.
 
Old 08-20-2017, 09:20 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Some additions.

In addition to df -h run this from a command line:
Code:
sudo du -h | egrep '[0-9\.]G|[0-9]{3}M'
It shows directories with space usage > 100M. You have to run as sudo to avoid that you don't have permissions to look into all directories.

Ubuntu is a nice distro for starters, but it makes a point of hiding information from users. Which is bad in case of problems and leads to the Windows system administrator policy: "for small problems reboot, for large problems, reinstall"

Therefor, even if it is discouraged, set a root password:
Code:
sudo su
passwd
Linux is built so root can always log in. Even is there is no disk space.

I am not sure which partition scheme you have used. Recommended is separate /var, /usr, /home and /. Sometimes also separate /boot. I am not sure about that anymore. When doing this, especially when using the recommended sizes, there is always a partition filling up which you don't want.

Nowadays I install everything in one single partiton. Maybe except /home if I am sure I have enough disk space and I want to have /home to survice reinstallations.

This is a recommendation for desktops and laptops. Not for servers in a production environment.

Anyway, run the "du" command as stated above and let's take it from there. Unless you are a movie collector, Ubuntu does not take up more space than 20G. Even if you do a lot of upgrades. I just checked my laptop. Total space: 73G. But 66G is for a W10 virtual machine image. :GRIN:

jlinkels

Last edited by jlinkels; 08-20-2017 at 09:22 AM.
 
1 members found this post helpful.
Old 08-20-2017, 10:15 AM   #7
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
Code:
sudo du -h / | egrep '[0-9\.]G|[0-9]{3}M'
The directory “/”(or file list) was missing. I did not know the uses of “du” and just looked it up in the man page.
 
Old 08-20-2017, 11:19 AM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Correct. You have to specify '/' or do 'cd /'

I did the latter and copy&paste command. Thank you.

jlinkels
 
Old 08-21-2017, 04:15 AM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I'd try:
Code:
$ apt-get clean
 
1 members found this post helpful.
Old 08-21-2017, 04:26 AM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
try:

Quote:
du -h /var/logs
 
  


Reply

Tags
free space partition, storage, ubuntu 16.04



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I tell how much space I have left on my hard drive? Molzilla Bodhi 16 10-27-2018 06:27 AM
[SOLVED] Linux installer does not see free space left on dual boot drive Claussendb Linux - Laptop and Netbook 3 07-11-2013 01:45 PM
Lucid not reporting correct drive space left godsdice Ubuntu 7 05-05-2010 04:43 PM
can longer copy files to my empty USB pen drive on DSL - "no space left on device" misterfever Linux - Newbie 11 03-18-2009 03:42 PM
Viewing Space Left on Hard Drive The Oate Mandriva 5 08-25-2004 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration