# DVR hard drive maint.



## ggotch5445 (Sep 27, 2009)

Hi everyone!

Just curious: is there an ongoing program, taking place "behind the scenes", whereby the hard drives on the DVRs are regularly defragmented, and otherwise maintained?

I've heard that this may be taking place, but have never been able to verify anywhere if and when this actually occurred.

Thanks!


----------



## RasputinAXP (Jan 23, 2008)

EXT3 doesn't fragment.

Defragmenting your hard drive is a silly holdover from the old days, anyhow.


----------



## ggotch5445 (Sep 27, 2009)

Wow, how interesting.

Thanks for the reply!


----------



## lparsons21 (Mar 4, 2006)

Even if it were fragmented, it wouldn't be an issue because of what you use it for. Think about a computer hard drive. If a movie were fragmented all over the drive, it would still play smoothly.


----------



## phrelin (Jan 18, 2007)

lparsons21 said:


> Even if it were fragmented, it wouldn't be an issue because of what you use it for. Think about a computer hard drive. If a movie were fragmented all over the drive, it would still play smoothly.


Yes, but would the heads not be busily jumping around creating more opportunity for glitches and HDD failure? Just thinking out loud....


----------



## lparsons21 (Mar 4, 2006)

phrelin said:


> Yes, but would the heads not be busily jumping around creating more opportunity for glitches and HDD failure? Just thinking out loud....


Theoretically that could be the case, but since you record/play pretty much continuous selections, it shouldn't really be an issue.


----------



## bnborg (Jun 3, 2005)

The first recordings on the drive would record contiguously, one after another.

With a *lot* of erasing and recording on the DVR, especially if single recordings at a time, there would definately be fragmentation.

Also, dual tuner DVRs must introduce some fragmentation when both tuners are recording at the same time, unless the DVR uses a separate partition for each tuner.


----------



## Stewart Vernon (Jan 7, 2005)

Also your viewing/deleting habits would come into play.

If you record a bunch of 30 min programs, then watch one in the middle... and record an hour program... and do that a few times, at some point the receiver is going to have to start using those "spaces" to record larger programs.

Theoretically, though, the receiver could do some background defragmenting (if truly necessary) during times like its scheduled overnight update when it knows it has access to the drive without worrying about recordings.


----------



## James Long (Apr 17, 2003)

Worst case they would be pretty big fragments. If a person kept recording a few minutes of a program then deleted every other recording a new recording could theoretical fill the gaps and have to jump every few minutes to a new section on the disk but I believe that would be fairly rare. Most recordings would be half hours and hours and there would only be jumps in longer programs. People who record a lot of movies (lengths not /30 minutes) could see shorter jumps ... but we're not talking about jumping around the hard drive every minute or two to find the next piece of the recording.


----------



## sremick (Feb 4, 2008)

RasputinAXP said:


> EXT3 doesn't fragment.


Not actually true. It does fragment, just not as quickly. Its design reduces the amount of fragmentation but it still happens. Granted, in this application one might never notice any performance issues due to fragmentation as I'm sure even a heavily-fragmented HD movie could be read of the HDD fast enough to keep up with the playback buffer. The HDD throughput is likely to not ever be the bottleneck.

http://en.wikipedia.org/wiki/Ext3#Defragmentation
http://prefetch.net/blog/index.php/2007/01/21/determining-file-fragmentation-on-ext3-file-systems/
http://www.h-online.com/open/features/Tuning-the-Linux-file-system-Ext3-746480.html

So does the DVR get fragmented? Yes. Will it ever be a problem? Almost certainly not.


----------



## RasputinAXP (Jan 23, 2008)

sremick said:


> So does the DVR get fragmented? Yes. Will it ever be a problem? Almost certainly not.


OK, fine, EXT3 fragments, but not enough to be a problem...


----------



## ggotch5445 (Sep 27, 2009)

I so appreciate all of these comments with regard to the DVR HD function.

I find hard drives something of a miracle device to start with, and think that the use of them, in our DVRs, is amazing.

As regarding the fragmentation of our drives: what got me to thinking about this, in the first place, was the idea that these drives are operating continuously. Since we are able to "pause and record live TV", this would mean that recordings are being made all of the time. Just imagine the number of files our DVRs must be creating for "channel surfers"!

I kept thinking, "these things must have to defrag, but when, and how would they do it?"

It is all extremely fascinating!


----------



## Kevin Brown (Sep 4, 2005)

James Long said:


> Worst case they would be pretty big fragments. If a person kept recording a few minutes of a program then deleted every other recording a new recording could theoretical fill the gaps and have to jump every few minutes to a new section on the disk but I believe that would be fairly rare. Most recordings would be half hours and hours and there would only be jumps in longer programs. People who record a lot of movies (lengths not /30 minutes) could see shorter jumps ... but we're not talking about jumping around the hard drive every minute or two to find the next piece of the recording.


This isn't how I think about it. Yes, the DVR deals with half hour, 1 hour, etc, increments, but the _physical length_ of each of program is heavily dependent on the type of program, how much it's been compressed, etc.

So I would imagine that a typical drive gets pretty fragmented in a short amount of time, especially if you watch and delete recordings "out of order" a lot like I do. 

One person suggested that if you think this is a concern: dump all the recorded shows you have to an external drive, and then copy them back. Instant (but time consuming) defrag !!


----------



## P Smith (Jul 25, 2002)

That's why DTv and dish doesn't bother with defrag process.


----------



## TBoneit (Jul 27, 2006)

phrelin said:


> Yes, but would the heads not be busily jumping around creating more opportunity for glitches and HDD failure? Just thinking out loud....


The heads are always jumping around.

Imagine a VIP722K recording Four shows at once and playing back another one or two. We are talking four writes and two reads and maybe you hit guide for a third read operation. The heads have to be moving around for all that access to the drive platters.

Just an opinion of course.


----------



## articos (Oct 10, 2006)

Answering the question of _when_ the system does integrity checks, on older non-VIP units, it does a system integrity check nightly, although I don't know if that runs a full HDD diagnostic. Both VIP and non-VIP run a fsck utility on the drive every 7-10 days, I believe. You can check the last date it ran in Menu->System Setup->Diagnostics->Counters. Scroll down in the counters, and you'll see a section on the HDD.


----------



## P Smith (Jul 25, 2002)

fsck doesn't have defrag functionlity; as to how often - each night during that reboot.


----------



## jsk (Dec 27, 2006)

Sometimes, my wife or I will record a minute or two of a program so we can share it with each other. I would assume that would cause more fragmentation on our HD. We had a HD failure a couple of years ago, but I don't think you could directly link that to fragmentation. We haven't have any other problems.


----------



## MrC (Jun 6, 2005)

Don't make this assumption. Modern, fast file systems use very smart algorithms for managing disk blocks. For a DVR which is primarily going to record large file sizes, block sizes will be large and fixed, and can be multi-sized each size living in a certain pool. Small files can be allocated from a pool of smaller blocks.

Defragmenting comes from simpler file systems. It is primarily a (legacy) Windows issue (and that was not mean as a Window's bash).


----------



## P Smith (Jul 25, 2002)

The DVR allocating by 2 or 4 MB V/A chunks regarding recording time, it is fixed allocation unit.


----------



## Stewart Vernon (Jan 7, 2005)

P Smith said:


> The DVR allocating by 2 or 4 MB V/A chunks regrading recording time, it is fixed allocation unit.


I was wondering along those lines... It would be "smart" in some ways if a DVR used certain block sizes regardless of the actual time of the recording... such that, for example, a 5 minute recording and a 25 minute recording might take up the same amount of space on the hard drive.

I'm not saying that's how it works... just wondering/speculating, and it would cut down on fragmentation.


----------



## P Smith (Jul 25, 2002)

If you could calculate how many minutes of SD or HD will fit into 2 or 4 MB allocation unit ...


----------



## Stewart Vernon (Jan 7, 2005)

P Smith said:


> If you could calculate how many minutes of SD or HD will fit into 2 or 4 MB allocation unit ...


Unless I did something wrong, I used a "guess" based on a 4GB, 90-minute HD recording... and that looks like 45MB per minute.

I don't want to think that is right... but it must be.


----------



## P Smith (Jul 25, 2002)

So, those allocation chunks hold two or three minutes ... I would expect more, but perhaps it related to FF/RW - trick play modes and GOP size.


----------



## MrC (Jun 6, 2005)

If the blocks were non-contiguous, FF and RW would cause the disk heads to go nuts. There is more to this than just block size. The allocations must have large, non-seek requiring contiguous spans to work well.


----------



## P Smith (Jul 25, 2002)

It could be contiguous like for current channel's life buffering, but add to that scheduled recordings (OTA, sat) and all your wishes gone out to a window.


----------



## Jhon69 (Mar 28, 2006)

ggotch5445 said:


> Hi everyone!
> 
> Just curious: is there an ongoing program, taking place "behind the scenes", whereby the hard drives on the DVRs are regularly defragmented, and otherwise maintained?
> 
> ...


I believe when you turn the DVR off(StandBy) that's when "housekeeping" begins.


----------



## P Smith (Jul 25, 2002)

No defragmenting process running at all, regardless how name it.


----------



## Stewart Vernon (Jan 7, 2005)

Jhon69 said:


> I believe when you turn the DVR off(StandBy) that's when "housekeeping" begins.


There's really no "good" time for the receiver to run a defrag process anyway. In standby it might have to fire up to record a scheduled program at any time during the standby period... so it may or may not be in true standby for long enough to do much defragmenting even if needed.


----------

