LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-20-2011, 05:27 AM   #1
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Rep: Reputation: 8
howto check a filesystem usage (bit complicated)


Hello,

I have a problem that "/" is full, with "du" i found less usage what "df" shows

I know it can be deleted but still open files, i checked with "lsof" but there was no big open files

other idea what i would like to check that other fs mounted on a directory(for e.g /var) but the upperlying "/" may used /var before
and there can be "hidden" usage

and the question is: is there a way to find/check this out without umounting the suspected fs?

thanks in advance
 
Old 05-20-2011, 05:35 AM   #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
Quote:
and the question is: is there a way to find/check this out without umounting the suspected fs?
You could exclude it from du, eg:

Code:
du --exclude "/var"
 
Old 05-20-2011, 06:22 AM   #3
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Original Poster
Rep: Reputation: 8
thanks but i am not really sure thats what i wanted

I tested it on a vm eg:
i created this first

Code:
/dev/mapper/vg00-lv_test
                      5.0G  139M  4.6G   3% /test
i made a directory /test/test2 and made a 2G file under it
dd if=/dev/zero of=file2G.tmp bs=1M count=2048

after that i mounted another fs on /test/test2, so now its looks like this
Code:
/dev/mapper/vg00-lv_test
                      5.0G  2.2G  2.6G  46% /test
/dev/mapper/vg00-lv_test2
                      5.0G  139M  4.6G   3% /test/test2
and using this exclude option just seems to ignore the specified fs to output, but doesnt show that hidden 2G file is somewhere
Code:
[root@localhost test2]# du -hs /test/*
16K     /test/lost+found
20K     /test/test2
[root@localhost test2]# du -hs --exclude /test/test2 /test/*
16K     /test/lost+found
maybe my first post wasnt clear enough, hope this example helps, and this was just a test where i know where is the "hidden file"
but where i would need to do it, there are more mounted fs as there we speak about "/", so it would not be enough to find there is something but i would like to get if its under /home or /var or etc

Last edited by hurryi; 05-20-2011 at 06:24 AM. Reason: using code
 
Old 05-20-2011, 08:53 AM   #4
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
Here is what I do to find what consumes storage space on /
Code:
du -xak /|sort -n|tail -100
-x prevents measuring mounted filesystems
-a shows files, not just directories

sort and tail let you focus on the large directory and files

Last edited by 16pide; 05-20-2011 at 08:57 AM.
 
Old 05-20-2011, 09:05 AM   #5
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Original Poster
Rep: Reputation: 8
thanks but it isnt revealing the 2G either, i am not realy sure if it can be seen without umount the fs from /test/test2
I thought i just ask it in hope that someone knows some cool trick but not a big issue

Code:
[root@localhost test2]# du -xak /test
4       /test/test2
16      /test/lost+found
24      /test
[root@localhost test2]# du -xah /test
4.0K    /test/test2
16K     /test/lost+found
24K     /test
 
Old 05-23-2011, 03:09 AM   #6
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
well, that's when you boot from a live cd.
run the du command I posted above on that filesystem
and you may discover you have a /var directory that was hiding below the /var mount point, etc ...
 
Old 05-23-2011, 03:16 AM   #7
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Original Poster
Rep: Reputation: 8
yes thanks, that was my question if i can do without rescue mode etc, but seems not thanks for help
 
Old 05-23-2011, 09:26 AM   #8
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Original Poster
Rep: Reputation: 8
sry for resurrecting this but i thought i will share this, i dont know why the idea did not come faster

but it was simple
just mount the filesystem to other lets call "/test" directory and you can check with ease - no downtime ftw
 
  


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
Howto install 32-bit libraries on 64-bit Linux using yum shawn_t Linux - Server 16 07-13-2012 03:46 AM
32 bit Application on 64 bit Linux OS -- Memory Usage saleem_ak Linux - Newbie 3 04-01-2009 03:59 PM
Bit complicated sed search & replace sharathkv25 Programming 6 04-07-2007 02:53 PM
LXer: Howto install Flash, Java, Real Player 32 bit plugins under 64 bit Firefox LXer Syndicated Linux News 0 03-17-2007 12:31 AM
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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