[mythtv-users] Fragmentation On Recording Disk?

Rod Smith mythtv at rodsbooks.com
Fri Apr 6 15:01:02 UTC 2007


On Friday 06 April 2007 02:18, Phill Edwards wrote:
> > Reducing the inode count for a mythtv partition might be useful. We
> > don't record 10,000 files in 100G...we record maybe 100 files in 100G.
> > Changing the inode percentage can recover an appreciable amount of disk
> > space..not that does *much* about fragmentation, but it does help *a
> > little*.
>
> So how do you do that? On JFS for example - as I use JFS :)

I just checked the jfs_mkfs and jfs_tune man pages and saw no mention of any 
parameters for adjusting the inode count on JFS. It's conceivable that it can 
be done using undocumented options or other tools, but if so I don't know 
what they are.

When using XFS, the mkfs.xfs man page specifies several options, accessed via 
the -i switch, that affect inode allocation; however, I haven't taken the 
time to study these options and they're complex enough that I wouldn't want 
to speculate on how to use them without further study and/or experimentation.

In ext2fs or ext3fs, the number of inodes can be specified with the -i or -N 
options. The -i option sets the number of bytes per inode, with larger values 
resulting in fewer inodes per filesystem (assuming a fixed filesystem size). 
The man page doesn't specify a default value, but examination of my existing 
ext2 and ext3 filesystems suggests the default is between 1,600 to 8,000. (I 
got different results for different filesystems; perhaps the default varies 
with filesystem size.) The -N option sets the number of inodes as an absolute 
value.

AFAIK, ReiserFS doesn't use a fixed number of inodes; I believe it allocates 
them dynamically as files are created, but I don't know the details. ReiserFS 
is also the filesystem that's least recommended for MythTV, judging by the 
documentation I've read.

AFAIK, the number of inodes can't be changed once it's set, at least in JFS, 
XFS, or ext2fs/ext3fs. If you want to adjust this parameter for the very 
small benefit you'll get, you'll need to move data off the partition you want 
to tune, reformat it, and then move data back onto it.

-- 
Rod Smith
http://www.rodsbooks.com


More information about the mythtv-users mailing list