LinuxQuestions.org
Review your favorite Linux distribution.
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 03-25-2017, 05:20 AM   #1
Walter1981
LQ Newbie
 
Registered: Mar 2017
Posts: 2

Rep: Reputation: Disabled
Disk space full but can't find why


Hi,

for starters: I'm not a complete *nix noob but by far no pro either

I got a CentOS / Virtualmin server where my root-partition is currently at 98% but I can't seem to find what's eating up my disk space
Below is the output of the df-command, attached is a screenshot of the output of du "-hsx * | sort -rh | head -25", clearly showing only 27 GB of space is used (and most of it in the home-directory which is a seperate partition! (see screenshot here: https://imagebin.ca/v/3GlMwlomsqhi )



[ /]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos_xyz_-root 52403200 51305828 1097372 98% /
devtmpfs 3994544 0 3994544 0% /dev
tmpfs 4005208 0 4005208 0% /dev/shm
tmpfs 4005208 107052 3898156 3% /run
tmpfs 4005208 0 4005208 0% /sys/fs/cgroup
/dev/vda1 508588 223260 285328 44% /boot
/dev/mapper/centos_xyz_home 257511644 17981888 239529756 7% /home
tmpfs 801044 0 801044 0% /run/user/0
tmpfs 801044 0 801044 0% /run/user/1000
 
Old 03-25-2017, 06:41 AM   #2
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
As for as I know, du by default doesn't display hidden files/folder, although they are counted for. So I suggest you use this command instead to see sizes of hidden files/folders as well.

Code:
du -sch $(ls -A) 2> /dev/null | sort -rh
You can repeat this same command in each directory/partition to have a clear idea as to what is eating your space.
 
Old 03-25-2017, 08:35 AM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 997
Blog Entries: 12

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
find / -xdev -size +99M -ls
Or maybe -mtime Or other find switches...
Web-search: linux find what is filling up disk
http://www.linuxquestions.org/questi...t-it-is-758699

Last edited by Jjanel; 03-25-2017 at 08:40 AM.
 
Old 03-25-2017, 08:55 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,305
Blog Entries: 1

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
If you are NOT in a hurry.

$ du -h --max-depth=1 /

Then du down the rabbit hole for anything HUGE and track down where your space went. If /dev/ shows up as HUGE, you might have replaced /dev/null with an actual file (I did that once). Otherwise most of /usr/share/doc/ can be trimmed down in a crunch. And various /var/ places depending on package archives and bloated log files. But most times one too many media files in $HOME is what hogs my space.
 
Old 03-25-2017, 10:40 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,585

Rep: Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569Reputation: 1569
Two possibilities:
  1. When you run "du -hsx *", your shell expands the "*" and does not include files with names that begin with ".". It's not terribly likely that you have huge dotfiles in the root directory, but you can include those by running "du -hsx /". I suggest using the "--max-depth=1" option to reduce the clutter.
  2. You could have files hidden under an active mount point. You can examine the root filesystem as it would appear without the mounts by running
    Code:
    mkdir /tmp/tmproot
    mount --bind / /tmp/tmproot
    du -hsx --max=depth=1 /tmp/tmproot
    If there are files where you don't want them, you can move or delete them from /tmp/tmproot. Run "umount /tmp/tmproot" and delete that directory when you are done.
 
Old 03-25-2017, 11:39 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,629
Blog Entries: 4

Rep: Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001
Also note that open files consume disk space, even if there is no directory-entry (yet) pointing to them. And, if there is one, the directory entry probably is not up-to-date with the actual file size at the immediate instant.
 
Old 03-25-2017, 01:38 PM   #7
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,576
Blog Entries: 15

Rep: Reputation: Disabled
Code:
df -i
is your friend
 
Old 03-27-2017, 01:24 AM   #8
Walter1981
LQ Newbie
 
Registered: Mar 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
Also note that open files consume disk space, even if there is no directory-entry (yet) pointing to them. And, if there is one, the directory entry probably is not up-to-date with the actual file size at the immediate instant.
Thanks all for your feedback (most things I found & tried myself). This one was the trick.... I deleted a whole lot of log & temp files... so they didn't show up in the filesize ... but did still consume disk space. One reboot and I've got plenty of disk space again
 
  


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
Disk space full, and can't remove files because it's full? Legend of Ron Slackware 16 07-01-2016 10:08 PM
os reports disk full but i still see some space jzoudavy Linux - Newbie 3 01-16-2015 12:15 PM
Disk space full and remedy stevenl Linux - Newbie 23 03-26-2012 05:52 AM
disk space unnecessarily full mbanwi Linux - Newbie 2 09-07-2009 10:52 AM
The hard disk space is full rahulruns Linux - General 5 04-14-2008 10:04 AM

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

All times are GMT -5. The time now is 01:23 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