# Defrag



## Noddy Holder (Oct 4, 2002)

Does Tivo defrag the hard drive/s when idle?


----------



## blindlemon (May 12, 2002)

Not as far as I know - why?


----------



## Noddy Holder (Oct 4, 2002)

blindlemon said:


> Not as far as I know - why?


To make access to files on the disk quicker etc!


----------



## sanderton (Jan 4, 2002)

With the enormous block size which TiVo uses, fragementation is not an issue.


----------



## Noddy Holder (Oct 4, 2002)

sanderton said:


> With the enormous block size which TiVo uses, fragementation is not an issue.


Thank you Sanderton, So I take it fragmentation to any serious degree does not take place?


----------



## worm (Feb 10, 2005)

I'm not sure fragmentation is really an issue on any Linux OS is it?


----------



## UncUgly (Apr 25, 2002)

worm said:



> I'm not sure fragmentation is really an issue on any Linux OS is it?


surely fragmentation cant really *NOT* be an issue with any os - if it writes files to non contiguous space then the read of that file will 'stutter' as the drive heads have to shuffle around for the data ?

uu


----------



## blindlemon (May 12, 2002)

As Sanderton says, blocksize is the key. The TiVo recordings are written in files with such a large blocksize that every one could be on a different (and distant) track of a 500gb drive without causing stuttering. 

If you are experiencing stuttering then your drive is probably faulty or on its way out


----------



## worm (Feb 10, 2005)

UncUgly said:


> surely fragmentation cant really *NOT* be an issue with any os - if it writes files to non contiguous space then the read of that file will 'stutter' as the drive heads have to shuffle around for the data ?
> 
> uu


My knowledge is less than 100% - but my understanding is that there is a difference between how a typical Windows OS and a typical Linux OS deals with fragmented files, in fact with all files, fragmented or otherwise.

I don't know if a Linux filesystem will necessarily be less fragemented than a Windows filesystem, although I do understand that Linux tends to avoid fragmentation slightly better. However that way that Linux accesses files results in a much reduced *impact* of fragmented files compared to Windows, by effectively 're-ordering' file requests before they go to the disk. (this may be a hugely misleading analogy - I'm not sure of the specific details)


----------



## iankb (Oct 9, 2000)

The video streams are stored in a proprietary filesystem called MFS, and do not use a traditional Linux filesystem. As Stuart said, the blocksizes in MFS are so large that fragmentation is not an issue. I notice that I only have four units of allocation for a one-hour recording, although I can't be sure whether each unit represents a single contiguous-space on disk, or is re-mapped to a set of physical blocks.


----------



## Ian_m (Jan 9, 2001)

There is an article I read recently on MSDN written by an ex-employee of Diskkeeper (?) about why filesystem fragmentation is not such and issue nowadays. Basically:-

- large capacity drives
- large RAM caches on drive
- modern filesystems (NTFS etc)

all render defragging less relevant than it used to be.

Large capacity drives mean that contiguous free space is easier to find (NTFS in XP SP2 does do this), larger drive RAM caches mean that non-contiguous files no longer give a performance hit and modern file systems can aleviate file fragmentation.


----------



## cwaring (Feb 12, 2002)

An ex-emplyee of a company that markets a dis-defragmenter says that the software his old employer makes is now no-longer needed. Hmmm... no agenda there then


----------



## Anndra (Oct 12, 2004)

worm said:


> My knowledge is less than 100% - but my understanding is that there is a difference between how a typical Windows OS and a typical Linux OS deals with fragmented files, in fact with all files, fragmented or otherwise...


I'm not sure about Linux either, but Mac OS X (based on a Unixy OS) de-fragments larger files in the background.


----------



## Ian_m (Jan 9, 2001)

cwaring said:


> An ex-emplyee of a company that markets a dis-defragmenter says that the software his old employer makes is now no-longer needed. Hmmm... no agenda there then


I think he said he left because they were producing a product that was getting less and less return as hardware and OS's move on, so could end up being a redundant product. Anyway the XP built-in version of defrag is from diskkeeper anyway.


----------



## blindlemon (May 12, 2002)

As the TiVo software has a fair degree of control over what recordings it deletes and when, and as it was written by some pretty smart people, I wouldn't be surprised if one of the criteria for deciding which expired show to delete is whether it's deletion will allow the MFS to coalesce free space and/or allocate the new new recording as a contiguous set of blocks. 

You don't need to defrag if you didn't frag in the first place...


----------



## sanderton (Jan 4, 2002)

Fragmentation is only an issue if it causes the disk to be seeking all over the place dozens or hundreds of times a second (slow) rather than just reading sector after sector in a row (fast). The MFS partions on the hard disk where the video is stored have a huge block size - the smallest amount that can be written to the disk. Each block is good for several seconds of video. So even if a file is "fragmented" ie all the blocks are in different places) that's only one seek every few seconds which is no problem.

The blocks are not the same as the "Parts" which Ian is talking about, which are the raw "files" of MFS and are typically 512Mb.


----------



## Noddy Holder (Oct 4, 2002)

sanderton said:


> Fragmentation is only an issue if it causes the disk to be seeking all over the place dozens or hundreds of times a second (slow) rather than just reading sector after sector in a row (fast). The MFS partions on the hard disk where the video is stored have a huge block size - the smallest amount that can be written to the disk. Each block is good for several seconds of video. So even if a file is "fragmented" ie all the blocks are in different places) that's only one seek every few seconds which is no problem.
> 
> The blocks are not the same as the "Parts" which Ian is talking about, which are the raw "files" of MFS and are typically 512Mb.


Thank you once again Sanderton, for clearing this up!


----------

