David Strom
2010-Dec-09 13:23 UTC
[zfs-discuss] How many files & directories in a ZFS filesystem?
Looking for a little help, please. A contact from Oracle (Sun) suggested I pose the question to this email. We''re using ZFS on Solaris 10 in an application where there are so many directory-subdirectory layers, and a lot of small files (~1-2Kb) that we ran out of inodes (over 30 million!). So, the zfs question is, how can we see how many files & directories have been created in a zfs filesystem? Equivalent to "df -o i" on a UFS filesystm. Short of doing a find <zfs-mount-point> | wc. TIA. -- David Strom
Tomas Ă–gren
2010-Dec-09 14:00 UTC
[zfs-discuss] How many files & directories in a ZFS filesystem?
On 09 December, 2010 - David Strom sent me these 0,7K bytes:> Looking for a little help, please. A contact from Oracle (Sun) > suggested I pose the question to this email. > > We''re using ZFS on Solaris 10 in an application where there are so many > directory-subdirectory layers, and a lot of small files (~1-2Kb) that we > ran out of inodes (over 30 million!). > > So, the zfs question is, how can we see how many files & directories > have been created in a zfs filesystem? Equivalent to "df -o i" on a UFS > filesystm. > > Short of doing a find <zfs-mount-point> | wc.GNU df can show, and regular Solaris could too but chooses not to. statvfs() should be able to report as well. In ZFS, you will run out of inodes at the same time as you run out of space. /Tomas -- Tomas ?gren, stric at acc.umu.se, http://www.acc.umu.se/~stric/ |- Student at Computing Science, University of Ume? `- Sysadmin at {cs,acc}.umu.se
Peter Tribble
2010-Dec-09 14:08 UTC
[zfs-discuss] How many files & directories in a ZFS filesystem?
On Thu, Dec 9, 2010 at 1:23 PM, David Strom <dstrom at ciesin.columbia.edu> wrote:> Looking for a little help, please. ?A contact from Oracle (Sun) suggested I > pose the question to this email. > > We''re using ZFS on Solaris 10 in an application where there are so many > directory-subdirectory layers, and a lot of small files (~1-2Kb) that we ran > out of inodes (over 30 million!). > > So, the zfs question is, how can we see how many files & directories have > been created in a zfs filesystem? ?Equivalent to "df -o i" on a UFS > filesystm.If you have gnu df, (it''s in /opt/sfw/bin/gdf if you''ve installed the companion CD), then that supports the -i flag. Alternatively parse the output from df -g. I have a horrid script that does something like that, fragment here: echo "Filesystem iused ifree %iused Mounted on" for ZF in ${FSLIST} do OUT=`/usr/sbin/df -g ${ZF} | awk -F: ''{print $NF}''` NFILES=`echo $OUT | awk ''{print $15}''` NFREE=`echo $OUT | awk ''{print $18}''` NUSED=$(($NFILES-$NFREE)) NPERC=$(((100*NUSED)/NFILES)) SPACE=`/usr/sbin/df -k ${ZF} | nawk ''/%/{print $3}''` echo "${ZF} $NUSED $NFREE ${NPERC}% ${ZF}" echo " average $(($SPACE/$NUSED))k" done ZFS goes up to ridiculous number of files. Here''s one of ours which has a fair number: Filesystem iused ifree %iused Mounted on /images/fred 140738056 36000718887 0% /images/fred average 11k I''ve never seen ZFS run out of inodes, though. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
Richard Elling
2010-Dec-14 12:24 UTC
[zfs-discuss] How many files & directories in a ZFS filesystem?
On Dec 9, 2010, at 5:23 AM, David Strom wrote:> Looking for a little help, please. A contact from Oracle (Sun) suggested I pose the question to this email. > > We''re using ZFS on Solaris 10 in an application where there are so many directory-subdirectory layers, and a lot of small files (~1-2Kb) that we ran out of inodes (over 30 million!).30 million files for ZFS is a walk in the park. It doesn''t even get interesting until you get into the billions ;-) As long as you have space, you have space for more files. -- richard