View previous topic :: View next topic |
Author |
Message |
shepmaster Tux's lil' helper
Joined: 20 May 2004 Posts: 105
|
Posted: Sat May 31, 2008 5:26 pm Post subject: How to find where inodes are used? |
|
|
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 |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Sun Jun 01, 2008 12:19 am Post subject: |
|
|
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 |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Sun Jun 01, 2008 2:26 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|