# Recordings being corrupted after upgrade



## PeskiWabbit (May 8, 2004)

My recordings being corrupted after an upgrade of a UK Tivo Series 1.

I have reacently upgraded from the initial 40Gb to a 250gb disk using ptvlba48-4.02.iso and the commands :


mfsbackup -Tao - /dev/hdx | mfsrestore -s 300 -r4 -xzpi - /dev/hdy

and 

run copykern.


Put the disk back in the Tivo and all appeared to be great.

Now some 50hrs of (Best) recording later, I'm loosing my old Tivo recordings. When I play them I get 

"Error playing a recording
The recorder was not able to record this
program because there was no video signal on
the channel. You may have been trying to record
a channel that yoy dont recieve. "

Or, the recording freezes part way through, and the Tivo reboots - same place every time. Yet when I checked them after the upgrade, they were fine.


The disk I bought was sold 'as new' and of 'good quality', and the internal temp is 37C.

Any ideas on where I went wrong ?


----------



## funtoupgrade (Mar 15, 2005)

Your swap file of 300 is way bigger than need be. 127 would be fine. The rule is half the size of the hard drive GB. Whether this is contributing to your problem or not I have no idea, but reserving swap space certainly cuts down on maximum space available for recordings. Do you plan to always have that many best quality programs stored?


----------



## HomeUser (Jan 12, 2003)

I take it copykern modifies the Series 1 kernel for LBA48 Support. 

Did your run tpip to fix the mfstools greater then 127M swap partition problem? 

Other then that I would pull the drive and run the manufactures diagnostics on it.


----------



## JamieP (Aug 3, 2004)

HomeUser said:


> I take it copykern modifies the Series 1 kernel for LBA48 Support.
> 
> Did your run tpip to fix the mfstools greater then 127M swap partition problem?
> 
> Other then that I would pull the drive and run the manufactures diagnostics on it.


This sounds like the classic problem of wrap-around that occurs when running a large disk with a kernel that doesn't have lba48 support. I would bet that copykern didn't in fact put on an lba48 aware kernel. If this is the problem, pretty soon your root or kernel partitions will be over-written and then the box won't boot anymore.

Too much swap space is not really an issue, as long as it is initialized properly, and 300MB out of 250GB is of no consequence in terms of recording recording space usage (~ one tenth of one percent).


----------



## PeskiWabbit (May 8, 2004)

Swapfile : does it do any harm to be too big ? If I have to re-do the disk I'll make it 
127.
50hrs of Best : I generally run my machine at 90% full, to have the best selection of things to watch. If I have 85.5 Hrs of Best why use Basic until I run out of space! 
tpip : No I didn't run tpip, I understood that MFS tools could handle big disks/swapfiles these days. *Is this where I've gone wrong ?*

a kernel that doesn't have lba48 support : Does the kernal that is on ptvlba48-4.02.iso support a Tivo Series 1 ? (I got it from http://www.ptvupgrade.com/products/software/lba48/lba_4.02_license.html )

Is this the same problem as PeterW_Tivo is having ?


----------



## JamieP (Aug 3, 2004)

PeskiWabbit said:


> Swapfile : does it do any harm to be too big ? If I have to re-do the disk I'll make it 127.


It does no harm to be too big, as long as it is initialized properly and you have a kernel that can recognize it. It ties up a small amount of space that would otherwise be used for recordings, but that is in the noise.


> ...
> tpip : No I didn't run tpip, I understood that MFS tools could handle big disks/swapfiles these days. *Is this where I've gone wrong ?*


The PTVupgrade CopyKern script is basically a cover script over tpip. It runs tpip for you.


> a kernel that doesn't have lba48 support : Does the kernal that is on ptvlba48-4.02.iso support a Tivo Series 1 ? (I got it from http://www.ptvupgrade.com/products/software/lba48/lba_4.02_license.html )


My best guess is that CopyKern didn't do the right thing. It might be that it installed the right kernel, but not in the partition you are booting from. Or it might not have installed the kernel at all.

You might want to use tpip directly rather than relying on CopyKern. Here's a good reference: courtesan.com.


> Is this the same problem as PeterW_Tivo is having ?


 Could be.


----------



## PeskiWabbit (May 8, 2004)

If I insert the Tivo disk into my PC, booting off CD, is there a foolproof way of identifying what kernal I'm running, so that I know tpip has done the correct job to the correct partition ?

By the way, Ive now got the GSOD and repeated rebooting ! Good job I kept that backup.


----------



## blindlemon (May 12, 2002)

At this stage I would suggest re-doing the upgrade 

For a UK Series 1 machine use the Version 1.0 LBA48 CD from PTVUpgrade and when you run copykern, check that it reports initialising the 300mb swapfile size you specified.

To check the kernel version prior to re-upgrading, boot in byteswapped mode, and check the file */proc/version* in the root (usually on /dev/hdX4)

If you have the standard kernel it will say


> Linux version 2.1.24-TiVo-2.5 ([email protected]) (gcc version 2.8.1) #2 Thu Feb 7 17:49:48 PST 2002


whereas the LBA48 kernel will show up as


> Linux version 2.1.24-TiVo-2.5 ([email protected]) (gcc version 2.8.1) #14 Wed Oct 8 12:06:25 MDT 2003


----------



## JamieP (Aug 3, 2004)

blindlemon said:


> To check the kernel version prior to re-upgrading, boot in byteswapped mode, and check the file */proc/version* in the root (usually on /dev/hdX4)


Um,  /proc isn't a real file system. It's a psuedo file system that provides access to kernel data structures. If you look at /proc/version while you have linux booted up on the PC, you'll see the version of linux running on the pc. Looking at /proc is only useful if you can do it on the running tivo (for example, from a serial console.)

You could run:

```
strings /dev/hdXN | grep "Linux version"
```
 with linux booted on your PC to get the tivo linux version information. I suppose on a S1 it would need to be booted in byte-swap mode. X would be a,b,c or d, depending on what channel you have your tivo drive hooked up to. N would be 3 or 6, depending on which partition is your primary boot (kernel) partition.


----------



## PeterW_Tivo (Mar 7, 2006)

Just posted to say I fixed my problem... why did I say that!
I seemed to have cured the hanging, slow Tivo problem by adding swap 
in. The first few recording I tried worked ok, so I assumed (wrongly) that all was ok.
Still seeing the "Error playing a recording" message.
Think I'll just zap all the ones that have errors and see if it works from a clean disk.

I did a cat /proc/version and it shows 2.1.24-Tivo-2.5. Think this is the right one with
the LBA48 fixes in.


----------



## PeterW_Tivo (Mar 7, 2006)

Oh well, plan of deleting all the "bad" recordings wasn't successful.
Recorded 2 programmes, one after the other. First gives the error, the 2nd is
fine. I know that, in theory, they are ok as I was watching them live.

Bit stumped as what to do next. My guess the problem is something to do with the
disk size and the ability of the Tivo to access some of the sectors on the disk.
Just a guess though. 

So, I'm looking at suggestions of where to go from here.

Pete


----------



## JamieP (Aug 3, 2004)

PeterW_Tivo said:


> So, I'm looking at suggestions of where to go from here.


Still sounds to me like you don't have an lba48 kernel installed. Check the *whole* kernel version string as suggested by blindmon. On the tivo, you can check /proc/version as he suggested. If the disk is on a linux PC, use the strings command I suggested. If you see "[email protected]" in the kernel version string, it's a stock kernel built by tivo and most likely not LBA48 aware (since TiVO didn't ever release an lba48 kernel for S1 AFAIK). If you see "[email protected]" in the string, you have a kernel that Todd Miller built, and it probably is lba48 aware. There is lots more information about using large disks on S1s at Todd's site here.


----------



## PeterW_Tivo (Mar 7, 2006)

My mistake.... didn't check the whole version string.
It appears I have the non-LBA48 version. 
It would certainly explain why I see what I do.

Now all I have to do is work out why I have a non-modified kernel!

Thanks for your help.

Pete


----------



## PeskiWabbit (May 8, 2004)

*Re: determining the version of Tivo kernel while the disk is plugged into my PC.*

I tried both the suggestions on identifying the version of Kernel, but neither got me the info I wanted (or maybe I'm doing it wrong)

cat /proc/version

gave

'Linux version 2.4.4 ([email protected]) (gcc version egcs-2.91.66 19990314/Linux) (egcs-1.1.2 release) #1'

which I presume is the kernel on the CD.

The strings gave no output what so ever. I tried all sorts of values for N.

I must be doing something wrong somewhere !

Meanwhile, I have restored my disk using the PTV-MFSTOOLS2-LARGE-DISK.ISO as suggested, (and using -s 127 this time, not 300), and I'm now filling it up, to see if it will fail again.

One messages I didn't understand during the copy from hda to hdd was :-

'Adding pair /dev/hdd12 - /dev/hdd13'

and, during the COPYKERN is the following message a good sign, or bad ?:-

Writing /cdrom/kernals/kernal-2.5/vmlinus-2.5.px (869376 bytes) to block 76198976
Initializing swap partition (version 1) @76735552, size = 127 MiB


----------



## JamieP (Aug 3, 2004)

PeskiWabbit said:


> ...
> 'Linux version 2.4.4 ([email protected]) (gcc version egcs-2.91.66 19990314/Linux) (egcs-1.1.2 release) #1'
> 
> which I presume is the kernel on the CD.


Yes. That's the x86 kernel the CD boots to. Doesn't tell you what you need to know.


> The strings gave no output what so ever. I tried all sorts of values for N.
> 
> I must be doing something wrong somewhere !


My guess is that this is a series 1 and you haven't booted in byte-swap mode. If you don't want to, or can't figure out how to boot in bswap mode, you could byte swap in userspace with dd:

```
dd if=/dev/hdXN conv=swab | strings | grep "Linux version"
```
Again, X is a,b,c or d depending on what IDE channel you are using for your tivo disk. N is either 3 or 6, depending on which partition is being used as your boot partition.


> One messages I didn't understand during the copy from hda to hdd was :-
> 
> 'Adding pair /dev/hdd12 - /dev/hdd13'


That's normal when expanding with the mfsrestore/mfsadd -x switch.


> and, during the COPYKERN is the following message a good sign, or bad ?:-
> 
> Writing /cdrom/kernals/kernal-2.5/vmlinus-2.5.px (869376 bytes) to block 76198976
> Initializing swap partition (version 1) @76735552, size = 127 MiB


Looks normal to me (modulo spelling errors). This doesn't look like the output I'd expect to see from any recent ptv lba48 iso though. They have their kernels gzip'd and ungzip them to /mnt before calling tpip, IIRC.


----------



## PeskiWabbit (May 8, 2004)

Sorry for being a complete idiot, but I'm still unable to confirm what kernel is on my Tivo (Series 1, 40Gb) disk.

Here is what I'm doing :-

1) Insert ORIGINAL Tivo disk into PC, in the Primary Master slot.

2) Insert the PTV-MFSTOOLS2-LARGE-DISK.ISO Cd into the PC.

3) Boot PC.

4) At 'boot:' prompt hit <enter>. Get 'loading vmlinuz ......'

5) At 'Please hit <enter> to continue!', check that the Tivo disk is seen (it appears on hda)
and then hit <enter>

6) At '/#' prompt, type 'dd if=/dev/hda3 conv=swab | strings | grep "Linux version" '

it responds with

'0+0 records in
0+0 records out'

7) type 'dd if=/dev/hda6 conv=swab | strings | grep "Linux version" '

same response!

8) switch off PC and scream.

Surely, on an original Tivo Series 1 disk I should be able to get some response !
If I cant get this, then how can I get info on the new larger replacement disk ?


----------



## JamieP (Aug 3, 2004)

PeskiWabbit said:


> ...
> Surely, on an original Tivo Series 1 disk I should be able to get some response !
> If I cant get this, then how can I get info on the new larger replacement disk ?


Sorry, I don't have an S1 image to try this with. I think it should work, but it seems it doesn't for you. I can't really debug this remotely.


----------



## PeskiWabbit (May 8, 2004)

Oh, well thanks for your efforts, I just hope someone in the UK who has a S1 can help.


----------

