View Full Version : Eek - lost my /var/hack
cleudo
06-18-2007, 07:56 AM
As per the title of this thread - didn't get my daily call this morning, tried to open tivoweb - nothing, so telnet'ed in - no ls command and no /var/hack directory.
I think I've got a backup somewhere I did last year, but does this indicate that the drive's on the way out? It's about 2 yrs old (a Samsung i think).
healeydave
06-18-2007, 09:09 AM
Not necessarily, I have seen this happen when Tivo has re-booted unexpectedly (and its swapped partitions) but there has been no physical disk corruption.
You might want to check the logs or run the disk through an advance scan using a non-destructive HDD util to be sure.
cleudo
06-18-2007, 10:43 AM
Not necessarily, I have seen this happen when Tivo has re-booted unexpectedly (and its swapped partitions) but there has been no physical disk corruption.
You might want to check the logs or run the disk through an advance scan using a non-destructive HDD util to be sure.
If it has swapped partitions, is this recoverable (to get the original directories back?)
aerialplug
06-18-2007, 12:24 PM
It's happened to me twice when several consecutive short power cuts occurred causing TiVo to shut down during the boot sequence.
the reason for this is simple.
Most of TiVo's Linux partitions are deliberately set as read only - they don't need to have anything written to them as they're part of the operating system and TiVo control software. The only exception to this is the /var partition which is allocated especially for dynamic files that the operating system and myworld (TiVo's hub) use for logs, scratch files etc.
Note that the actual programmes are recorded in a different custom partition designed to be able to stop recording at a moment's notice - or indeed be instantly withdrawn by a cut in power.
Should the TiVo decide that something is not quite right with the /var partition, it's ben designed to rebuild it from scratch - after all, there's nothing permanant there, isn't there? ;)
Some of the hacks that we've installed over the years don't necessarily need to be on /var - they could survive and run elsewhere on the TiVo. I guess people have decided over the years to use /var because it's already read/writeable and therefore we can minimise the risk of making / or other partitions writeable while installing the hacks (thus increasing the risk of damage being done to one of the main partitions).
My solution was to install tar on the /var/hack area and then create a tar file of the entire /var/hack directory somewhere else that's not likely to be affected by the /var rebuild, so I can carry on using /var/hack safe in the knowledge that if something goes wrong, I'm not risking the rest of my TiVo.
cleudo
06-18-2007, 03:22 PM
Well it looks like I didn't copy the backup tars off the /var directory to my pc, so they are toast.
It's been ages since I did all this and I've forgotten how... Is there a guide/faq on hacks anywhere? I tried tivofaq.com, but that seems to have gone.
aerialplug
06-18-2007, 07:43 PM
It's happened to me twice when several consecutive short power cuts occurred causing TiVo to shut down during the boot sequence.
How bizarre is this - we haven't had a powercut here for ages but tonight - two short 1 minute cuts within a short period (so far)! Luckily they were spread out enough not to affect TiVo's /var partition as TiVo got a chance to fully reboot.
Annoyingly all the neighbourhood burglar alarms go off whenever the power is cut which is a bit of a bad design flaw as far as I can see... (exept mine as that's got a lead-acid battery backup power supply inside - though I have no idea how to replace it without the alarm going off as there's also a tamper switch too!!).
More annoyingly though, I was showing some friends around the house for the first time. I always get a sinking feeling when a power cut happens as you never know how long it's going to last.
spid3r
06-22-2007, 10:49 AM
Is /var included in a backup image made from mfsbackup?
ColinYounger
06-22-2007, 11:01 AM
Unless you use -v in the command line, I believe it does.
spid3r
06-22-2007, 11:10 AM
Ah good. I've lost my /var/hack in the past and it takes ages to set everything up again. This time I've got a backup though.
mikerr
06-22-2007, 11:22 AM
Personally I install a few must-haves into /hack (on the read-only partition),
once they have been running fine for a few months in /var/hack.
You do have to make sure they are writing log files etc to the /var partition though.
It's just viewed as good practice to install non-standard (hacks) on the var partition so that if any bad hack crashes / runs amok, an auto wipe of /var will return tivo to a virgin state.
ColinYounger
06-22-2007, 11:28 AM
spidr - your problem would be that you would have to re-image your drive to get /var back. As far as I know you can't restore 'bits' of the image, only the whole image. It's not a tar or ZIP file.
It also seems a sledgehammer/nut job. Just FTP the /var/hack directory and it's subdirectories onto your PC. A good FTP client will allow you to do this very quickly. You can then restore individual hacks\Tivoweb (+) modules if you tinker with them and break them. <innocent look>
spid3r
06-22-2007, 11:40 AM
Yeah true. I'll do that too. It was just that getting the LBA48 kernel on there was such a nightmare I'd like to be sure I have a good snapshot of the whole thing. I was using some docs that didn't mention the -r 4 command line for the restore, and if you looked in the help for the command, it wasn't even listed as an option.
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.