Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31

Warning: include(http://archive.tivocommunity.com/tivo-vb/history/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31

Warning: include() [function.include]: Failed opening 'http://archive.tivocommunity.com/tivo-vb/history/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 31
Pages:1



Swap and partition problem

(Click here to view the original thread with full colors/images)



Posted by: ZacnJosh

Before I get to the problem, some history on this TiVo:
quote:
The original TiVo was a 20 hour Phillips, Series 1 SA unit. Right after I bought it, I added an 80GB HD to boost my storage space. I used MFS Tools version 1 on this upgrade.

I recently (3-4 weeks ago) upgraded my TiVo from the (original HD) 20GB and 80GB (previous expansion) hard drives to two 120GB hard drives. I used MFS Tools version 2 on this one. I also added a TurboNet wired ethernet card, using the TiVo Turbonet directions and SW from 9th Tee. Both upgrades went smoothly and without error.

I did a dd copy from the 20GB and 80GB to one of the 120GB drives to save my recordings, then used mfsadd to add the other 120GB drive. I did not increase the swap space at that time, or if I did, it didn't work. I did a mfsbackup | mfsrestore, but don't remember if I had the '-s 127' option in there or not.


Anyway, two weeks ago while organizing my audio and video cables with a cable management system, the TiVo power plug came out. (I know, I should have already powered it down, my fault.) When I shut everything down and tried to boot it up again, it got to the "TiVo is starting" screen, followed by the green screen severe error warning, followed by a reboot. This continues in an endless loop, never even getting to the "almost there" screen.

I read up on the green screen error and followed the four page "How to fix your TiVo if it gets stuck on a green screen" from the Underground forum, made a backup of my partitions 1, 4, and 9, then created a swap partition (hda8). I then followed the pdisk partition swapping instructions and tried to fix it, but it didn't work. The TiVo stays at the initial startup screen and never gets any further.

I now have no working partition 4 or 7. Partition 9 still mounts and is ok. Partition 7 mounts, but the ls command only lists lost+found, my custom .profile and .bashrc files, and i-node errors for the other files and directories that used to be there. Partition 8 is now swap space. I still have backups of my original partition 1, 4, and 9.

How can I fix or re-format partitions 4 and 7, check and fix the 128MB of swap space if necessary, and finally restore my backup of partition 4 or 7 (without losing my recordings)?

I've looked at this for awhile now and tried to find a solution, but I need some help. I'm trying to save the recordings that I have, or I'd just wipe everything out and start over.

Thanks for your time and help,
Sam



Posted by: Robert S

I get this feeling that you're refering to my rescue procedure from the Fixes thread at the top of the Upgrade Centre, but I don't recognise your description of it.

What you're supposed to do is:

Identify your active root partition.
Use pdisk to transpose your inactive root partition and your swap partition.
Use mkswap to initialise the new swap partition as swap.
Let the TiVo recover
Use pdisk to transpose the partitions again, thus restoring the original order.

If your swap partition is already 127Mb, then your problem does not relate to swap. If your swap partition is 128Mb or larger, then you actually got no swap at all and need to run mkswap to initialise the swap partition.

If the TiVo has no swap it'll reboot almost immediately. If the TiVo has 64Mb of swap it'll take four minutes or so to allocate it all and trigger the reboot.

If the TiVo reboots after more than four minutes, mfsfix has encountered a bad block and the reboot is part of the repair process (so consider running diagnostics to see if the bad block can be remapped).

Which was your active root partition?

You may be able to copy the system partitions from your old drive (not partition 1 as that's the partition table!) to salvage this disk.



Posted by: ZacnJosh

Robert,

Yes, I am referring to your rescue procedure in the "Fixes for MFSTools 2.0 problems. Thanks for responding so quickly. I take full responsibility for my mistakes.

Here's what I did: (please don't tell anyone else about this, it's embarrassing ;) )

Identified the active root partition using edit_bootparms (root=/dev/hda7)
Used mkswap to prepare the inactive root partition as swap (mkswap -v0 /dev/hda4)
Used pdisk to transpose partitions:
r 8 4
r 5 9
w
y
Put drives back in TiVo and let it run for over 12 hours, never recovers.

Put drives back in PC
Backed up partitions 1, 4, 7, and 9 using dd to a FAT 32 drive
:confused: => *Totally lost my mind and self-destructed at this point <=
Decided to try swapping partitions 4 to 8, then 7 to 4 using pdisk
Now totally fubar. :down:

Current state of drives and partitions:
Partition 9 is OK. Mounts and still contains all of my hacks.
Attempting to mount partition 4 gives the "mount: you must specify the filesystem type" error.
Partition 7 will mount and is still tagged as the active root partition according to edit_bootparms hdc -r
Doing an ls command on the mounted partition 7 gives the following error:
"EXT2-fs error (device ide1(22,7)): ext2_read_inode: unable to read inode block - inode =2049, block=8197
/bin/ls: var: Input/output error"
each dir ^

^ var, proc, install, dist, mnt, and all other directories generate this error - except for lost+found and the .profile and .bashrc files that I created at setup.

I hope that this clarifies my steps, mistakes, and current state, but if I'm overlooking something or leaving something out, please let me know. :o

Thanks again for your time and quick response.
Sam



Posted by: Robert S

OK, that doesn't sound too bad.

As you backed up the partition table and the active root partition, I would think that dd'ing 1 and 7 back on would make the TiVo bootable again.

Then you can get back to worrying about the GSOD.

Did its behaviour change after you did the rescue?

Do a surface scan with the drive manufacturer's diagnostics just incase there's a bad block somewhere awkward that the diagnostic can remap.



Posted by: ZacnJosh

When I try to restore my partition using dd from my FAT drive back to /mnt/h7 or /dev/hdc7, I get a "No space left on device" error. I tried with hdc7 mounted and unmounted, same results.

How can I wipe out only partition 7?
Should the dd be done with the partition mounted or not?

The drive is a Seagate and I'm downloading the diagnostic SW now and signing off for the night.



Posted by: Robert S

The partition should not be mounted as you're writing directly to the disk rather than going through the filing system.

You'll have to use byteswapping mode, of course, and you should see the TiVo's partition table printed in the boot log.

dd if=/mnt/dos/file of=/dev/hdc7



Posted by: ZacnJosh

Robert,

I tried to use dd as you suggested, but I still get an error message when I try to use that command.

I am booting in byteswapped mode via the PTVboot7.1e.iso disk image. I have the master TiVo drive connected to IDE2 Master, and the slave TiVo drive connected to IDE1 Slave. My Windows FAT 32 drive is connected to IDE1 Master and my CD drive is connected to IDE2 Slave.

Here is the command that I'm using and the error messages that occur.

/# dd if=/mnt/dos/tivoPart7.bak of=/dev/hdc7

dd:writing to '/dev/hdc7' : No space left on device

3+0 records in
2+0 records out
:confused:

Can I use mkfs.ext2 to make partition 4 and/or 7 usable? I'm looking into it now.

Thanks again,
Sam



Posted by: Robert S

Do you see the TiVo's partition table in the boot log (dmesg | more)?



Posted by: ZacnJosh

I'm finally getting back to this problem. I ran the dmesg | more cmd and here's what I get (I'm leaving out hda (my dos/Win98 drive) and hdd (CDROM):

# dmesg | more
0A, ATAPI CD.......
...
hdb: 120034 MB
hdc: 120034 MB
...
Partition check:
hda .....
hdb:Signature 9214, be16 Signature 1492
Blocks in Map = 4
mac st=1 sz=3f name='Apple' t='Apple_partition_map' bim=4
hdb1 mac st=40 sz=400 name='New MFS Application' t='MFS' bim=4
hdb2 mac st=440 sz=df94000 name='New MFS Media' t='MFS' bim=4
hdb3 mac st=df94000 sz=770 name='Extra' t='Apple_Free' bim=4
hdb4
hdc:Signature 9214, be16 Signature 1492
Blocks in Map = 10
mac st=1 sz=3f name='Apple' t='Apple_partition_map' bim=10
hdc1 mac st=bd1fc40 sz=1000 name='Bootstrap 1' t='Image' bim=10
hdc2 mac st=bd20c40 sz=1000 name='Kernel 1' t='Image' bim=10
hdc3 mac st=bd61c40 sz=1000 name='Bootstrap 2' t='Image' bim=10
hdc4 mac st=bd21c40 sz=40000 name='Root 1' t='Ext2' bim=10
hdc5 mac st=bd63c40 sz=40000 name='Root 2' t='Ext2' bim=10
hdc6 mac st=bd62c40 sz=1000 name='Kernel 2' t='Image' bim=10
hdc7 mac st=bda3c40 sz=20000 name='Linux swap' t='Swap' bim=10
hdc8 mac st=bdc3c40 sz=40000 name='/var' t='Ext2' bim=10
hdc9 mac st=be03c40 sz=100000 name='MFS application region' t='MFS' bim=10
hdc10 mac st=950e040 sz=2811c00 name='MFS media region' t='MFS' bim=10
hdc11 mac st=bf03c40 sz=400 name='Second MFS application region' t='MFS' bim=10
hdc12 mac st=40 sz=950e000 name='Second MFS media region' t='MFS' bim=10
hdc13 mac st=bf04040 sz=400 name='New MFS Application' t='MFS' bim=10
hdc14 mac st=bf04440 sz=2090000 name='New MFS Media' t='MFS' bim=10
hdc15 mac st=df94440 sz=770 name='Extra' t='Apple_Free' bim=10
hdc16

Floppy drive.....
.......................................

Please help me fix this.

Thanks,
Sam



Posted by: Robert S

If you do pdisk -l /dev/hdc you get a more intelligble version that looks a bit like this:

hdc2 sz=1000 name='Bootstrap 1'
hdc3 sz=1000 name='Kernel 1'
hdc4 sz=1000 name='Bootstrap 2'
hdc5 sz=40000 name='Root 1'
hdc6 sz=40000 name='Root 2'
hdc7 sz=1000 name='Kernel 2'
hdc8 sz=20000 name='Linux swap'
hdc9 sz=40000 name='/var'

It looks to me like the problem is that partitions 4 and 5 have become transposed, so r 4 5 should fix it.



Posted by: ZacnJosh

Running pdisk -l /dev/hdc gave me this (leaving out some stuff):

# type name length
2 Image Bootstrap 1 4096
3 Image Kernel 1 4096
4 Image Bootstrap 2 4096
5 Ext2 Root 1 262144
6 Ext2 Root 2 262144
7 Image Kernel 2 4096
8 Swap Linux swap 131072
9 Ext2 /var 262144
10 MFS MFS application region 1048576
11 MFS MFS media region 42015744
12 MFS MFS Second application region 1024
13 MFS MFS Second media region 156295168
14 MFS New MFS Application 1024
15 MFS New MFS Media 34144256
16 Apple_Free Extra 1904

This confuses me more, but I thought that it might give you an insight. Does this help?

The pdisk run does not match up to the dmesg log.
hdc7 is 'Linux swap' in dmesg and 'Kernel 2' from the pdisk run
hdc8 is '/var' in dmesg and 'Linux swap' from the pdisk run
hdc9 is 'MFS application region' in dmesg and '/var' from the pdisk run
hdc10 thru hdc16 are out of sync too.

I *really* need to keep my recordings or I would have formatted everything and started over.
Thank you for your time and help.
Sam



Posted by: Robert S

What I meant by 'more intelligble' was that the partition labels are in the right place. For some reason on the dmesg report the partition numbers are printed after the partitions they refer to and preceded by a carriage return. You'll notice that at the top there's a partition with no number, and at the bottom there's a partition number (hdc16) with no partition.

pdisk prints the partition labels at the start of the lines.

The order is supposed to be

2 boot 1
3 kernel 1
4 root 1
5 boot 2
6 kernel 2
7 root 2
8 swap
9 var

So as I said, 4 and 5 are transposed. 6 and 7 are also transposed. If you swap those pairs over, you should get back to the correct order.



Posted by: ZacnJosh

Ah, that makes sense now. I guess I didn't look at the entire partition table as a big picture. I was focused on just 2-9 and didn't see the overall shift.

Does it matter how I swap them?
r 4 5
or
r 5 4

r 6 7
or
r 7 6

I'm guessing that it doesn't, or I would have already mucked things up beyond repair.



Posted by: Robert S

I don't use pdisk enough to know the answer off-hand. However, there's no danger - just try some combinations until you get the partitions into the right order. pdisk doesn't change the partition table until you tell it to. If things go wrong, just quit and try again.



Posted by: ZacnJosh

Swapping with pdisk isn't working. My p8 is 64MB and after I swap partitions, install the drives in the Tivo and boot up, it gets to the "Tivo is starting up..." screen and no further. I let it run for 24 hours, no boot.

When attempting to mount p4 - p9, p5 and p8 both generate the
"/dev/hdc* looks like swapspace - not mounted
mount: you must specify the filesystem type"

error message.

p4 and p7 mount, but I get the /bin/ls: dir: Input/output error when trying to view (ls) the contents of /mnt/hdc4 or /mnt/hdc7.

edit_bootparms hdc -r shows that /mnt/hdc7 is root


Here's what I think needs to be done (although I'm not sure how to make it happen):
1. Increase swap space to 128MB, either on /dev/hdc8 or /dev/hdc4 or /dev/hdc? (make a new partition?)
2. Use pdisk to swap partitions back where they belong
3. Install both drives back and Tivo, let it boot up and repair itself with the increased swap space

or

1. Restore /dev/hdc7 from my backup using dd ?
2. Increase the swap space to 128MB
3. Install, boot, and self repair

Which way should I go? Or is there another avenue that I should take?



Posted by: Robert S

Unless you give the new partition list (or, at least, claim that it matches its original configuration), saying which partitions don't mount doesn't help much.

(If you mount your C: drive as per Hinsdale, pdisk -l /dev/hdX > /mnt/dos/tivopart.txt will list your partitons to a file (C:\tivopart.txt) that you can paste in to a message).

If you have got the partitions in the right order now, you must have corrupted the system partitions.

Salvaging from the backup isn't hard, but you'll need a hard drive to install the backup on so you can get at the partitions you need. Assuming you've restore the backup to the new drive and that drive's active root partition is also #7, you can use dd to grab the partitions.

Boot byteswapping and mount you c: drive as per Hinsdale. Now you can copy the partitions to the C: drive.

dd if=/dev/hdX7 of=/mnt/dos/tivoroot.raw

Then you can copy the partition on to the live drive:

dd if=/mnt/dos/tivoroot.raw of=/dev/hdX7

(or you could copy directly from disk to disk if you prefer).

When you've got the TiVo to boot, you can go back to trying to to the 'rescue' by swapping the partitions around. Hopefully by now you've learned enough to do that successfully.

The TiVo should boot almost instantly - if 'Welcome' hasn't cleared in 1 minute, it never will.



Posted by: ZacnJosh

Sorry that I didn't make the partition map reference more clear. When I said that pdisk isn't working, I meant that the partition map hasn't changed when I've tried r 4 5 and r 6 7.

After making the r 4 5 and 4 6 7 changes using pdisk, loading the disks in the TiVo and trying to boot, then putting them back in the PC and checking partition map again using pdisk hdc -l, I'm right back where I started, with this map:

# type name length
2 Image Bootstrap 1 4096
3 Image Kernel 1 4096
4 Image Bootstrap 2 4096
5 Ext2 Root 1 262144
6 Ext2 Root 2 262144
7 Image Kernel 2 4096
8 Swap Linux swap 131072
9 Ext2 /var 262144
10 MFS MFS application region 1048576
11 MFS MFS media region 42015744
12 MFS MFS Second application region 1024
13 MFS MFS Second media region 156295168
14 MFS New MFS Application 1024
15 MFS New MFS Media 34144256
16 Apple_Free Extra 1904

I'll start trying the dd copy to my C: drive, mounted in byteswapping mode as per Hinsdale, and follow that path. I'll keep you updated. Thanks.



Posted by: Robert S

You should see the partition list changing as you run the r commands (press p to list the partitions). It sounds like you're not writing the changes before you quit pdisk.

You press w.



Posted by: ZacnJosh

Got my partitions back. Finally understand how pdisk r p1 p2 works. I must seem like Forrest Gump to you: "I am not a smart man." ;-)

Anyway, thanks for your patience and persistence. I will now try to do the 'rescue' thing by making my inactive root partition into swap space, renumber the partitions, install in TiVo and let it run. I will, of course, keep you posted.

Thanks again.



Posted by: Robert S

Does the TiVo boot to the GSOD now, then?



Posted by: ZacnJosh

Nope. Still stuck at Please wait a moment...
I did the following:

mkswap -v0 /dev/hdc4
pdisk /dev/hdc
r 8 4
r 5 9


Put both drives in the TiVo and booted up, still sticks at "Please wait a moment..."

I put both drives back in my pc and ran pdisk /dev/hdc -l my partition map is this:

2 boot 1
3 kernel 1
4 swap (64MB)
5 boot 2
6 kernel 2
7 root 2
8 root 1 (128MB)
9 var

Do I need to rename the p8 to swap somehow?



Posted by: Robert S

The partition labels don't have very much significance.

Have you tried using the backups you made? I think partition 7 is the important one.



Posted by: ZacnJosh

I backed up partition 7 (again), then used my original backup to overwrite partition 7 via the dd command. Same result, still won't get past "Please wait a moment..."

I ran edit_bootparms hdc -r again to confirm that it is partition 7, and it is. I looked around the /dev/hdc7/etc/ dir and when I looked at fstab, it looks right.

/mnt/hdc7/etc# cat fstab
/dev/hda7 / ext2 ro 1 1
/dev/hda9 /var est2 rw 1 2
/dev/hda8 swap swap defaults 0 0


I've seen references to a MakeTivoBootable program, should I try that now?
I'm not sure how to proceed at this point.



Posted by: Robert S

MakeTiVoBootable rebuilds the boot block. I think it's unlikely you've damaged that - normally it's the WinNT signature that corrupts the boot block. You would have backed up your boot block as part of partition 1.

Is is possible something bad happened to partition 6? Does mount say that looks like swap? That's where the Linux kernel lives.

Do you have a working A drive you could copy the system partitions off?



Posted by: ZacnJosh

I backed up partition 7 (again), then used my original backup to overwrite partition 7 via the dd command. Same result, still won't get past "Please wait a moment..."

I ran edit_bootparms hdc -r again to confirm that it is partition 7, and it is. I looked around the /dev/hdc7/etc/ dir and when I looked at fstab, it looks right.

/mnt/hdc7/etc# cat fstab
/dev/hda7 / ext2 ro 1 1
/dev/hda9 /var est2 rw 1 2
/dev/hda8 swap swap defaults 0 0


I've seen references to a MakeTivoBootable program, should I try that now?
I'm not sure how to proceed at this point.



Posted by: ZacnJosh

Whoops! A couple of typos. Meant to say:

I checked for root using edit_bootparms; it is still root=/dev/hda7

cat fstab
/dev/hda7 / ext2 ro 1 1
/dev/hda9 /var ext2 rw 1 2
/dev/hda8 swap swap defaults 0 0

What should I try next?



Posted by: ZacnJosh

It just occurred to me, /dev/hda (dos) isn't byte-swapped. Is that an issue when doing dd transfers to /dev/hdc which IS byte-swapped?



Posted by: Robert S

If you're copying from a DOS drive, then that's the only way it can work, because DOS runs on little-endian PC's, but the TiVo disks run in big-endian TiVoes.

If you're copying directly from one hard drive to another, then both devices must be swapped, or both unswapped or the copy will be different to the original.



Posted by: ZacnJosh

Regarding the kernel, I'll try to mount it tonight and see if I can. I do have at least one other drive with a valid kernel, maybe two, but one of them is very old, TiVo 2.x.

When I boot my pc, hda (dos) is normal and hdb and hdc are byteswapped. Does doing the dd copy from /dev/hdc7 to /mnt/dos/tivoP7.bak and
from /mnt/dos/tivoP7orig.bak to /dev/hdc7 work with that configuration?



Posted by: ZacnJosh

My boot 2 (partition 5) and kernel 2 (partition 6) are both messed up, and kernel 1 won't mount.

I have another TiVo up and running on my Ethernet network. Can I telnet into it and use dd (or something else) to copy the active boot and kernel files from my live TiVo to my local dos disk?



Posted by: ZacnJosh

I finally fixed my TiVo last weekend. I took down TiVo1, backed up the kernel, root, and boot partitions, restored them to TiVo2, then restored the partition table of TiVo2 to TiVo2. I then created the 128MB swap space, booted to green screen of death, and let it repair itself. I kept all of my recordings and all of my season passes!

But... The season passes now show no upcoming episodes. If I watch live TV, I can browse the online guide and see what's there, but if I go through the Season Pass manager, To Do List, or pick programs to record, they show NOTHING. I can only record shows by watching live TV, bring up the onscreen guide, then pick shows in the future to record.

btw, daily calls are working and getting correct guide info. Any ideas on how I fix this one?

Thanks again.



Posted by: Robert S

You just have to wait for the indexer to complete. This can take many hours if you have a lot of channels and the indices are completely empty.



Posted by: ZacnJosh

That's what I thought at first, but it's been over a week now.

Is there a way to manually kick start this process? I can telnet into my TiVo and have TiVo Web and some other hacks installed.




Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37

Warning: include(http://archive.tivocommunity.com/tivo-vb/history/footer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37

Warning: include() [function.include]: Failed opening 'http://archive.tivocommunity.com/tivo-vb/history/footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/avsforum/archive.tivocommunity.com/tivo-vb/history/archive_functions.php on line 37



vBulletin Copyright ©2000 - 2014, Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2014 - Created by Stefan "Xenon" Kaeser Modified by Adam J. de Jaray