LinuxQuestions.org
Register a domain and help support LQ
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 09-28-2016, 06:01 AM   #1
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Rep: Reputation: Disabled
Question No space left on device


Hello..

My harddisk is full and I don't know how to determine which folder has eating my hard disk space?

[root@backup home]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_drlinux-lv_root
51609340 51504776 0 100% /
tmpfs 8124020 72 8123948 1% /dev/shm
/dev/sdb1 495844 88485 381759 19% /boot
/dev/mapper/vg_drlinux-lv_home
420625024 233628 399024820 1% /home
/dev/sda1 1922859912 1214826676 610357560 67% /backup


trying below:

[root@backup home]# du -a / | sort -n -r | head -n 5
sort: write failed: /tmp/sortrs99KU: No space left on device
[root@backup home]#

but no luck
please help..

thanks a lot in advance

Win
 
Old 09-28-2016, 06:17 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,050

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
When you post output, use [code] tags so the layout (and thus readability) is maintained.
You are including that /home and /backup in the "du" - bad idea; try it like this
Code:
du -x -d 1 / | sort -n -r | head -n 5
 
Old 09-28-2016, 06:18 AM   #3
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,793

Rep: Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618
Something to remember from this: when root (or, actually, the mount point for /tmp) has no space then pipes do not work.
Simply expand your terminal and run
Code:
 cd / ; du -hs
and look for the heavy players. You may have to drill down a folder tree a bit.

My personal take, is that it might be easier to boot form a usb device or live-cd and work. That way you can examine the file system properly (mounted or not as needed) and pipes will work because they wil not depend upon the full filesystems.
 
Old 09-28-2016, 06:26 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
pipes are a kernel structure - no disk storage is used. You might be confusing how Microsoft implemented "pipes", which aren't pipes but temporary files...

The error shown is for sort which does use disk space.

Since root if full, the first place to look is at /tmp (since your df doesn't show /tmp being used for a mount point). If there is some large files there - get rid of them. Many systems are using tmpfs for /tmp which uses memory (and swap) for temporary storage. The advantage is that /tmp is always empty after a boot.


Then look at /var. A "du -sh *" will show rather quickly which directories are rather full. In my case the biggie is cache... but log tends to get large too (mine is currently 4.2G).

/var/tmp can usually be cleaned out - but watch out for things like systemd. Some desktop systems will also use /var/tmp as well as some system tools.

The usual culprit is /var/log - if you don't have log rotation configured. Delete old logs you don't need - and set up for log rotation if your system isn't doing it. Some logs that you should be able to delete are things like Xorg.[123].log (and the (.old logs).

Last edited by jpollard; 09-28-2016 at 06:45 AM.
 
1 members found this post helpful.
Old 09-28-2016, 06:49 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,050

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
Oops - for some reason I thought you had /tmp on tmpfs - if it's on disk, that ain't helping things. If that command fails again, try this then re-run the "du" I gave you.
Code:
mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
 
1 members found this post helpful.
Old 09-28-2016, 07:43 AM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,667

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Check /var/logs
 
Old 09-28-2016, 08:36 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,680
Blog Entries: 12

Rep: Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902
The command

Code:
du -d 1 -h
will give you a hint as to which top-level directories are the largest. (The "-d 1" means "depth one level"; the "h" means "human readable"). See man du for more.

Here's sample output from this here computer I'm typing on:

Code:
235G	/home
1.1M	/run
39M	/lib64
13M	/bin
4.0K	/srv
. . .
The first places to look are often /tmp and /var/log. Sometimes, if logrotate isn't installed or isn't working properly, log files can run out of control, and temporary files can also grow unchecked. Also, don't worry about /proc. It's not real place.

Last edited by frankbell; 09-28-2016 at 08:39 PM.
 
Old 09-28-2016, 09:16 PM   #8
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thanks all
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need larger tmp space - error writing temporary file: No space left on device deepGC Linux - Newbie 6 06-06-2015 06:55 AM
LXer: Linux: No space left on device while df command shows lot of free space LXer Syndicated Linux News 0 08-26-2013 03:50 PM
No space left on device even though it has free space? enine Linux - General 8 05-30-2007 05:22 PM
No space left on the device........ raklo Linux - Hardware 3 10-06-2006 09:23 AM
No space left on the device ashwinipahuja Programming 1 06-24-2004 01:05 AM


All times are GMT -5. The time now is 06:59 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration