View Full Version : Help! Accidental w (write) with fdisk!
rbivins
06-20-2005, 01:33 AM
I was in fdisk with /dev/hdb. It said that:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel...
Which is normal. You know how it then tells you that it has built a valid one for you, but it won't be applied until you hit w? Well, w is right next to the q, and I hit it by mistake So the new disklabel has been written. I haven't rebooted, yet, so my kernel is still using the old disklabel. Is there a way to get that back? Do I need to? Any help would be greatly appreciated.
Thanks!
--Robert
rbivins
06-20-2005, 01:36 PM
I have an idea, would reblessing the drive fix it? I know that I only have a few bits of info to restore. Everything else on the drive should still be fine.
Is it the disklabel that blessing writes?
Thanks!
--Robert
alldeadhomiez
06-20-2005, 01:53 PM
If I had to guess, I'd say that fdisk (a program that writes PC disklabels) probably only initialized the first sector. Of course, on a TiVo drive, the first sector contains the bootpage configurables but no partition information. Your partition table is probably at least partially, and maybe fully, intact. Poke around in a hex editor and post what you find - and always make a backup before you change anything.
References:
bootpage sources
pdisk and/or tivopart sources
rbivins
06-20-2005, 02:20 PM
If I had to guess, I'd say that fdisk (a program that writes PC disklabels) probably only initialized the first sector. Of course, on a TiVo drive, the first sector contains the bootpage configurables but no partition information. Your partition table is probably at least partially, and maybe fully, intact. Poke around in a hex editor and post what you find - and always make a backup before you change anything.
References:
bootpage sources
pdisk and/or tivopart sources
I will do that, I am currently imaging both drives right now, just in case I screw anything else up. Once that's done, I'll start poking around.
Thanks.
rbivins
06-21-2005, 01:16 AM
OK. dd'd both drives to two different partitions of a new 160GB HDD.
dd if=/dev/hdc of=/dev/hdg1
dd if=/dev/hdd of=/dev/hdg2
Then, as an experiment, I have reblessed the B drive. There seems to only be a very small difference between the two 0 sectors.
I also poked around and saw that the newly blessed drive B varies significantly in the data area -- what I assume is the data area, which is above offset 64. So I expect the saves on the reblessed drive to be unusable and/or unaccessable.
So, should I expect that if I dd'd the old B drive image back onto the drive and applied the changes listed in the attached files that everything works out OK? Remember, all I did was overwrite my disklabel with a DOS disklabel (which looks to be almost completely blank?).
Thanks for your time and patience.
--Robert
rbivins
06-21-2005, 05:20 PM
Alldeadhomiez,
Guess what? The rebless worked! The TiVo didn't like it. It, in fact, complained that the Database was inconsistent and that it couldn't be mounted. However, the splash screen was saying to leave the box on for the next three hours. So, I figured, what could it hurt?
Anyway, through the Serial Cable I saw that it did some type of fsfix, several different times in several different ways and each time it ran, it came back with 0 errors and 0 warnings.
Then it started to do some buddymap rebuilds, but kept returning that each map was internally consistent.
So, I guess it figured that it didn't need to do much and simply restarted itself. It took all of 15 minutes. All my hacks are in place, and all my recordings are OK as well. Well, I missed the end of the Detroit Pistons/San Antonio Spurs game. That must have been the point when I crashed it. Dang! Thought that I might have Robert Horry's heroics on disk. Oh, well.
The moral of the story is if you kill you boot sector on your B drive, a rebless will fix it as long as nothing else is broken. And, you are patient enough to wait for the TiVo to rebuild itself.
Thanks for the help. At least I have backup images of both my drives.
Now, I still have to upgrade my A from the present 40 Gig to my new 120 Gig...
--Robert
PS. I'm now going to do the MFSTools backup thing, at least it's more managable in size. At least this backup will have hacks in place, my other backup is of the virgin drive before I started hacking the box. I would have been devastated if I had to go back to that version!
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.