LinuxQuestions.org
Visit Jeremy's Blog.
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, 04: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, 05:41 AM   #2
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
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, 07:35 AM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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 07:40 AM.
 
Old 03-25-2017, 07:55 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
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, 09:40 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,716

Rep: Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192Reputation: 2192
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, 10:39 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,249
Blog Entries: 4

Rep: Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777
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, 12:38 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
df -i
is your friend
 
Old 03-27-2017, 12: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 09:08 PM
os reports disk full but i still see some space jzoudavy Linux - Newbie 3 01-16-2015 11:15 AM
Disk space full and remedy stevenl Linux - Newbie 23 03-26-2012 04:52 AM
disk space unnecessarily full mbanwi Linux - Newbie 2 09-07-2009 09:52 AM
The hard disk space is full rahulruns Linux - General 5 04-14-2008 09:04 AM

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

All times are GMT -5. The time now is 01:15 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
Open Source Consulting | Domain Registration