# switching to boot partition?



## mr.cello (Jul 28, 2004)

I am having issues with my TiVo (duh!) and am thinking that something happened to the HD on which the system files are. I am wondering how one switches the boot partition as I think the issue is with the current one. 

I didn't see any options in pdisk for specifying which partition to boot from. Is there any way to do this - or is this info stored in some kind of NV ram that is read as part of the power up sequence? 

If this can't be done is there a way for me to update the system files without loosing my media? The box has two 120G drives in it. It will boot but then freezes up within five minutes of power up. Now it is giving the green screen of death infinitely...


----------



## MungoJerrie (Mar 30, 2006)

Is this tivo hacked? If so, it can be done with the "bootpage" command.


----------



## mr.cello (Jul 28, 2004)

The box has been upgraded via MFS tools - but nothing beyond that. Is the bootpage command on any of the MFS tools CDs? I have the LBA48 disk from PTV...


----------



## MungoJerrie (Mar 30, 2006)

Bootpage is on the ptvupgrade cdrom; see http://www.courtesan.com/tivo/bootpage.html for a complete look at the bootpage utility. The following assumes that your hard drive is connected in your PC as "secondary master" and therefore the bootdisk recognizes this as /dev/hdc. If your setup is different, you'll have to adjust. But to summarize:

bootpage -f /dev/hdc

flips the current active boot partition to the alternate and vice versa.

Other commands:

bootpage -p /dev/hdc

prints current bootpage parameters - should give you root=/dev/hda4 or root=/dev/hda7.

bootpage -b /dev/hdc

print current active boot partition - if root=/dev/hda4 this will be 3; if root=/dev/hda7 this will be 6

bootpage -a /dev/hdc

print current alternate boot partition - if root=/dev/hda4 this will be 6; if root=/dev/hda7 this will be 3


----------



## mr.cello (Jul 28, 2004)

mungo you rock! Hopefully this will fix my current woes!


----------



## mr.cello (Jul 28, 2004)

So I just tried it - and it doesn't seem to be changing the actual partition... I run: 
bootpage -f /dev/hda 
and when I run it with -p it still states that the original partition is the original one. I also tried it with the option that allows you to explicitly pick a partition and that doesn't seem to do the trick either.


----------



## MungoJerrie (Mar 30, 2006)

You say you ran "bootpage -f /dev/hda" - that would be correct if the drive was located in your PC as the Primary Master - otherwise use the drive letter mapped to your drive in your PC's IDE chain.

OK, let me back up a minute; and indulge me if you already know this. Tivo uses two sets of partitions in booting your system. The 3/4 pair and the 6/7 pair. One pair is active and the other is the alternate. When tivo sends you a software upgrade, it places the software in the alternate set and flips the bootpage. Now, the 3rd partition is the kernel and the 4th is the root filesystem; similarly the 6th partition is the kernel and the 7th is the root. So...it sounds like you actually want to boot from the alternate (assuming it exists - if you recently used mfstools to restore, it doesn't). Assuming it does, do this:

bootpage -p /dev/hdc

This prints your current bootpage - let's say it gave you root=/dev/hda4; this means that the 3/4 is your active and the 6/7 is your alternate. To change and boot from the 6/7 you need to do the following.

bootpage -P "root=/dev/hda7" -C /dev/hdc

--that's capital P & C, assuming the drive is in your pc as /dev/hdc; this command changes your active root to the 7th partition upon reboot. If other arguments are given in the bootpage string, copy them into the quotes; probably not if you haven't hacked before.

Next,

bootpage -B 6 /dev/hdc
bootpage -A 3 /dev/hdc

--those are capitals as well; those two commands make your 6th partition the active boot and the 3rd the alternate.

Reboot and you should be booting from the flipped bootpage (i.e., alternate); while the drive is in your PC, make sure the 7th partition exists by trying to mount it.


----------



## mr.cello (Jul 28, 2004)

That is the information that I needed. A final question - after I run those three commands if I run bootpage -p will it display the new information - or will that only change after the drive boots in the TiVo box? I will go try this out now.


----------



## MungoJerrie (Mar 30, 2006)

Yes, after you run the commands, bootpage -p will show the new info. A reboot is not required to verify the bootpage changes.


----------



## mr.cello (Jul 28, 2004)

This is not happening - when I run the commands I am not seeing any changes when I run -p afterwards, though they do seem set once I boot in the TiVo and check again on the PC (weird huh?). The PTV boot disk I have has a different version of bootpage which has a bunch more options than those on the link you specified above; one major difference is in the reporting of the partition, the number returned is the one that follows the drive letter (i.e. 4 or 7) and not 3 or 6 as you mentioned.

One thing I did notice is after executing the commands and booting in the TiVo the string (-p) and boot partition (-b) are set correctly; however the alternate partition (-a) is still set to the old one... (I did use the capitals to set the values). 

Is there another copy of bootpage lying around that might resolve this issue? Sadly the TiVo still refuses to boot


----------



## MungoJerrie (Mar 30, 2006)

Yes, older versions of bootpage were funky; try the free lba48 boot cd from ptvupgrade.com; the version on that disk works fine. LBA48 BOOT CD I hope that's not the one you're using; I've used that one w/out incident numerous times. There is another copy of a bootpage at that site that shall not be named...(DDB).

And again, the final argument to bootpage should be the device where your tivo drive is mapped in your IDE chain. In your example you had it at /dev/hda which suggests Primary Master. In my example I was using Secondary Master (/dev/hdc).

In general:

PRIMARY MASTER /dev/hda
PRIMARY SLAVE /dev/hdb
SECONDARY MASTER /dev/hdc
SECONDARY SLAVE /dev/hdd

Make sure you're giving it the right one...


----------



## mr.cello (Jul 28, 2004)

I have the PTV LBA48 disk (got it 18-24 months ago), but will check out the one you refer to. As for the drive mapping on my PC I disconnected my drives which are on the master and not on the secondary - the secondary has DVD and CDROM drives, so that won't work anyway  

Thanks for you help will check out the disk you suggest - hopefully will not have more questions for you...


----------

