LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-15-2014, 03:51 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Question commands like df?


Hey LQ,

I've got a linux system whose harddrive is 10% full which seems way higher than it should be at this point in time. I'm trying to find out which directory on the system is using up this space. I want to know what command will tell me which directories are using the most space.

I know that "df" will kind of do what I want. It reports that /dev/xvda1 is using 10%, but now I want to go into /dev/xvda1 and see which directories in there are using what not. How can I accomplish this?
 
Old 03-15-2014, 04:05 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
You could try the following:

Code:
du -a /home/fred/ | sort -n -r | head -n 20
Obviously, replace the path above with the mount point for /dev/xvda1.
 
1 members found this post helpful.
Old 03-16-2014, 07:39 PM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by sycamorex View Post
You could try the following:

Code:
du -a /home/fred/ | sort -n -r | head -n 20
Obviously, replace the path above with the mount point for /dev/xvda1.
Thanks, I'll try that out.
 
Old 03-22-2014, 03:04 PM   #4
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Ok I've tried that command

Code:
du -a /home/fred/ | sort -n -r | head -n 20
And it tells me that 1.8gb are in my folder where I thought there would be a lot more. So this makes me curious about something.

I used to have many gbs of images inside of mysql database. But I deleted that system and I'm pretty sure my disk space never went down to reflect that delete. Is there any chance that I need to do a defrag of the mysql database or something to get that disk space back? I'm pretty sure I'm not using as much disk space as my system thinks I am.
 
Old 03-22-2014, 03:22 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Here's an article about the fact that Linux does not need any kind of defrag software.
http://www.howtogeek.com/115229/htg-...defragmenting/

Here's how to locate where MySQL stored data. Perhaps you need to manually delete the old database content:
http://www.cyberciti.biz/faq/mysql-d...ed-unix-linux/

Also check for some old/forgotten dot files/folders (hidden files with names starting with a dot .)
 
1 members found this post helpful.
Old 03-22-2014, 08:50 PM   #6
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Thanks for that. Here is something interesting.

Code:
root@wh33t:/var/lib/mysql# ls -l
total 7203752
-rw-r--r-- 1 root  root           0 Feb  1 18:55 debian-5.5.flag
-rw-rw---- 1 mysql mysql 7358906368 Mar 22 18:48 ibdata1
-rw-rw---- 1 mysql mysql    5242880 Mar 22 18:48 ib_logfile0
-rw-rw---- 1 mysql mysql    5242880 Mar 22 17:11 ib_logfile1
I see that there is an ibdata1 file in there that is 7.3gb?! Is it safe for me to just go ahead and remove it?
 
Old 03-22-2014, 08:59 PM   #7
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
When you delete files, they don't go away entirely. They just go into the trash. You have to empty the trash to reclaim the disk space used by the deleted files.
 
Old 03-22-2014, 09:01 PM   #8
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by sgosnell View Post
When you delete files, they don't go away entirely. They just go into the trash. You have to empty the trash to reclaim the disk space used by the deleted files.
Yeah, and even then emptying the trash doesn't "really" delete them, but even still, the free space should still be reported correctly right?

Anyhow, I deleted that file and now my mysql server won't boot. I guess I need to trouble shoot that now... damn it!~
 
Old 03-23-2014, 03:33 AM   #9
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Try the links below, if nothing helps, just try reinstalling mysql so that that file is recreated.

The links also suggest how to prevent the ibdata from growing so much.
https://www.linuxquestions.org/quest...-mysql-757527/
http://stackoverflow.com/questions/3...-file-in-mysql
http://forums.mysql.com/read.php?22,181987
 
1 members found this post helpful.
Old 03-23-2014, 03:45 AM   #10
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by sycamorex View Post
Try the links below, if nothing helps, just try reinstalling mysql so that that file is recreated.

The links also suggest how to prevent the ibdata from growing so much.
https://www.linuxquestions.org/quest...-mysql-757527/
http://stackoverflow.com/questions/3...-file-in-mysql
http://forums.mysql.com/read.php?22,181987
Thank you. You've been a great help.
 
  


Reply



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
USB Low Level commands (embedded Linux, terminal commands) JonCombat Linux - Newbie 2 01-05-2013 02:34 PM
Linux equivalent commands for all Solaris commands Harry_Linux008 Linux - Newbie 4 08-22-2010 07:21 PM
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 08:54 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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