On 10/24/2010 03:46 AM, Patrick Dupre wrote: > On Sat, 23 Oct 2010, JD wrote: > >> On 10/23/2010 02:49 PM, Patrick Dupre wrote: >>> On Sat, 23 Oct 2010, Patrick Dupre wrote: >>> >>>> Hello, >>>> >>>> On a logical partition I am unable to set the block size to 1024 ! >>>> I formatted the partition mke2fs /dev/VG1/part1 -b 1024 -t ext4 >>>> and when I do a >>>> blockbsz --getbsz or mke2fs -n >>>> I get 4096 ! >>>> I also tried 2048 with the same result. >>> But dumpe2fs gives the right answer ! >>> >>>> >>>> Is it related to the logical partition ? >>>> >>>> Thank. >>>> >>>> >>> >> You have to be aware that selecting such a small >> block size means that the FS will be allocating >> at least 256 bytes of inode space per 1K data block. >> So, the amount of space for on-disk metadata is about >> 25% of the space for data blocks. This is OK if you have >> a lot of small files about 1 to 4k in size. Buf it most of >> your files are much larger than 1kb, then you have >> wasted a lot of disk space for inodes that may never >> be used. > Is there a tool to optimize the block size ? > Determination of the average file size ? > > Thank. > Well, I do not know if there is such a tool, but you could write a shell script to find all files, sum up there sizes and divide the sum by the total. This would be a very crude way of determining average file size, but it would not be accurate by any means. It would be better to compute the mean, rather than the crude average. You will probably need to look up mean computation of a list of numbers. You could crate a file containing just the file sizes in a mounted partition: cd mountpoint find . -type f | while read f; do ls -l "$f" | awk '{ print $5 }' done > /tmp/sizes sort /tmp/sizes > /tmp/sizes.sorted now you need to run your program to calculate the mean from the file /tmp/sizes.sorted. Even here, you will be faced with another problem: frequency of occurrence of a number (size). What if al sizes are unique? So you would end up with a frequency of 1 for each size, and the result would be no different than computing the average. Setting up ranges would be helpful to come up with a frequency of numbers falling within some specific range, starting with the smallest range, until you see the range it fits in. So you really need to do some searching on how to come up with a useful mean for such a list of numbers. -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines