On Thu, Dec 9, 2010 at 1:23 PM, David Strom <dst...@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/ _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss