Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to find where inodes are used?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
shepmaster
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2004
Posts: 105

PostPosted: Sat May 31, 2008 5:26 pm    Post subject: How to find where inodes are used? Reply with quote

Hey all,

I have a /media partition that was originally optimized for large media files (movies, mythtv storage,etc). When I created it, I must have used an option that minimized the number of inodes. For example, my root vs my media drive:

Code:
Filesystem               Inodes     IUsed    IFree   IUse%   Mounted on
/dev/sda3                1251712    397363   854349  32%     /
/dev/mapper/main-media   64000      55616    8384    87%     /media


Now I sometimes will run out of inodes. I would like to be able to figure out which directories on my media partition use the most inodes so that I can create a more optimized partition for them.

Thanks!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sun Jun 01, 2008 12:19 am    Post subject: Reply with quote

Each file on disk requires an inode. Assuming you do not create extra hard links to files, you can find where your inodes are used by looking at where you have files and directories. If you create extra hard links, then counting becomes more complicated, since you have multiple directory entries for a single inode.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Sun Jun 01, 2008 2:26 am    Post subject: Reply with quote

This will give you an overview of which directories contain the most files:
Code:
cd /media
find . -maxdepth 2 -type d ! -name '.' | while read dir; do
  printf "%6d\t%s\n" $(ls -R "$dir" | wc -l) "${dir:2}"
done | sort -n
Adjust the maxdepth argument for more or less detail.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum