SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-08-2009, 11:38 AM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
Wiz.bin corruption and recovery.

Ok. From what I can tell the wiz.bin corruption is the biggest pain in everyones side. Most people don't see it, but it seems like everyone has had to deal with it at least once, and it left a really bad taste in thier mouth. For the life of me I can't understand why they don't use a backend database. Ok done with my rant .. now my problem.

My server is a multipurpose server, meaning I don't use it just for sage. As such I do have the occasional problem (about once every couple of weeks) where my system has to be rebooted because of a lock up. Yes I know, and I'm working on getting those problems fixed so it doesn't do that but in the mean time I've got a major problem. It seems that if sage isn't shut down gracefully it will corrupt the wiz.bin everytime. It's a major pain in the butt but I was still willing to live with it if I could simply restore from a backup copy. I create a script that once an hour makes a copy of the wiz.bin and sage.properties (I keep three days worth of backups) and thought at a least I could restore from those if I had another problem... I was wrong..

So, last time this happened I thought "well at least I got a backup". I shutdown sagetv "/etc/init.d/sagetv stop" removed wiz.bin and sage.properties from the "/opt/sagetv/server" dir and copied the backups into the dir. I then started sage up again. Tt immediately renames the wiz.bin to win.bin.corrupt0 and I lose everything. I spent a few bucks on getting my system setup with turner cards and media extenders and now the wife is ready to kill me. Can someone help me?

I've read the faq's about how to backup your system (Windows), I've gone through most of the threads trying to figure out how to have a reliable backup and thought I had done it. Can someone please let me in on the secret?

1) What is the best method for backing up my sagetv system so that I can restore to a known good working state.
2) What is the correct way to restore from the above backup.
3) Is there something else I can be doing to prevent the wiz.bin from getting corrupt in the first place.

The wife has a death grip on our comcast DVR and will not release it until I can prove that this system is as stable as it should be. Any help would be appreciated.

Last edited by SuiDog; 03-09-2009 at 02:25 PM.
Reply With Quote
  #2  
Old 03-08-2009, 11:55 AM
boojiboy's Avatar
boojiboy boojiboy is offline
Sage User
 
Join Date: Feb 2009
Posts: 29
I'll be looking to see what the best procedures are for this.
Which Linux distro are you running?
__________________
Ubuntu 8.10, PVR-150
Reply With Quote
  #3  
Old 03-09-2009, 02:19 PM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
I'm running Ubuntu 8.10
Reply With Quote
  #4  
Old 03-09-2009, 07:16 PM
RocKKer RocKKer is offline
Sage Advanced User
 
Join Date: Dec 2005
Posts: 196
I am also running on ubunto 8.10 and I fixed the corrupt Wiz.bin on my system.

I moved /etc/rc2.d/S20sagetv to /etc/rc2.d/S99sagetv with this command -

sudo mv /etc/rc2.d/S20sagetv /etc/rc2.d/S99sagetv

Originally sagetv was started before the network, my change starts sagetv after the network daemon is started, which is /etc/rc2.d/S28NetworkManager

This solved 3 problems for me:
I was getting "No HDHR devices discovered" in my /opt/sagetv/server/sagetv_1.txt and the corrupted Wiz.bin after reboots, I presume was because network was not up yet so it couldn't find my HDHR.

The third problem was I had to stop and restart sagetv after a reboot in order for placeshifter to start successfully, before it would show the sagetv splash, then a black window with the spinny thing and then it would all just disappear.
__________________
SageTV Server v9.2.2, Ubuntu Server 18.04.4 x64, Java 1.8.0_252, Xeon E5-2690, 32GB, 6X6TB WD Red - Software Raid 6, 2X HDHR3 (OTA), 3X HD-200
Reply With Quote
  #5  
Old 03-10-2009, 09:13 AM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
So you're saying that sage starting up before the network starts was causing the corruption? I will try that and see if it helps.

I'd still like to know how to backup my system and restore it for the unexpected power failure or corruption.

Sui
Reply With Quote
  #6  
Old 03-10-2009, 09:23 AM
boojiboy's Avatar
boojiboy boojiboy is offline
Sage User
 
Join Date: Feb 2009
Posts: 29
What about setting up a Subversion repository?

I also found this old cached page:

Quote:
Originally Posted by laurenglenn
After having Wiz.bin corruption which caused my SageTV install to lose the ability to schedule recordings, I added the following to my SageTV startup:

date +%s > ~/.datenum
read chep < ~/.datenum
tar -cf /var/media/Wiz-backup-$chep.tar /opt/sagetv/usr/Wiz.bin

This will create a TAR compressed file of your Wiz.bin titled /var/media/Wiz-backup-114040444.tar ($chep ends up being the # of seconds since 1/1/1970, so it will be unique with each execution)

so...... to get this to work, edit your "~/.xinitrc" file and put these at the beginning. Also, I put an "exec .xinitrc" and the end of the file to force SageTV to be reloaded in case it crashes when running as a server (mode 0)

Lauren
If you want to not have to write to a file everytime, you can do this in one line:

tar -cf /var/media/wiz-backup-`date +%s`.tar /opt/sagetv/usr/Wiz.bin

(those are `'s, which are under the ~)
__________________
Ubuntu 8.10, PVR-150

Last edited by boojiboy; 03-10-2009 at 09:32 AM.
Reply With Quote
  #7  
Old 03-10-2009, 06:18 PM
rz888951 rz888951 is offline
Sage User
 
Join Date: Jun 2007
Posts: 18
SuiDog,

The steps you've outlined are what I do to backup my system and have never had a problem restoring to the same machine. I thought in another post you mentioned you have dual nics, correct? Do you guarantee they load in the same order every reboot. In the thread here:

http://forums.sagetv.com/forums/show...t=33133&page=2

bcjenkins mentions this at the end.
Reply With Quote
  #8  
Old 03-10-2009, 08:18 PM
RocKKer RocKKer is offline
Sage Advanced User
 
Join Date: Dec 2005
Posts: 196
Quote:
Originally Posted by SuiDog View Post
So you're saying that sage starting up before the network starts was causing the corruption? I will try that and see if it helps.

I'd still like to know how to backup my system and restore it for the unexpected power failure or corruption.

Sui

Yes, in my case not having the network up caused STV grief in that it couldn't find the HDHR. Now if that was truly causing the corruption I don't know, but in my case it solved all my problems.

In any case, I put apps last in the run control, unless there is a good reason not to.
__________________
SageTV Server v9.2.2, Ubuntu Server 18.04.4 x64, Java 1.8.0_252, Xeon E5-2690, 32GB, 6X6TB WD Red - Software Raid 6, 2X HDHR3 (OTA), 3X HD-200
Reply With Quote
  #9  
Old 03-11-2009, 11:17 AM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
Ok, I tried the suggestions about moving the Sagetv to a later point in the startup. Change the to the SageTV startup didn't have any affect. The wiz.bin is getting corrupted every time I reboot. I'm using cron to reboot the system on a schedule to avoid the lockups on my server. Is there anyone that can help. This is ridiculous. I don't even know where to start looking, and I didn't realize something so basic would be such an issue. I REALLY like sage and all it feature. I've used just about all the others out there for linux and this one is the best in my opinion. Can someone please tell me how to fix this one issue I'm having?


Sui

Last edited by SuiDog; 03-11-2009 at 11:25 AM.
Reply With Quote
  #10  
Old 03-11-2009, 01:32 PM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,042
What distro do you use? How do you start Sage and *not* end up with a corrup wiz.bin?

One thing to watch out for is that SageTV seems to want to be able to use ifconfig to identify the machine you're running on. If it cannot find ifconfig, or ifconfig cannot find the correct NIC, or there is any other problem, it will corrupt your wiz.bin (and not bother to tell you why). I'm not sure what it is looking for in the ifconfig output, (I assume MAC address), but it needs to see the same thing every time it is run.

So the first thing I'd check is that the startup environment is similar to the environment where you're able to start Sage successfully. Eg, make sure that /sbin/ is in the PATH so that ifconfig can be found, and make sure that all the NICs on your machine are available and named consistently.

Drew

PS:

$ head /opt/sagetv/server/startsage
#!/bin/bash
export PATH=/opt/jre/bin:/sbin:$PATH
Reply With Quote
  #11  
Old 03-11-2009, 04:41 PM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
If I get the sagetv sources setup and it gets the program info, I can start and stop sagetv without problems.. I actually have 3 nics .. 1 Gb eth (eth0) .. 1 Fast eth (eth1) and 1 wireless card (ath0). I use the wireless card to make and AP and bridge it with the fast eth so I can use my server as a access point (br0). To make the AP it just creates a virtual interface wifi0 interface which I think gets a unique mac each time.. you think that could be the problem? Not to mention the br0 interface that is created I think gets a new mac everytime. I have two networks 192.168.1.1 attached to the Gb eth and 192.168.2.1 attached to br0 .. all of my clients and extenders connect to sage using the br0 interface. Think this might be the problem all along?

Sui

Last edited by SuiDog; 03-11-2009 at 04:45 PM.
Reply With Quote
  #12  
Old 03-12-2009, 03:10 PM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,042
Quote:
Originally Posted by SuiDog View Post
To make the AP it just creates a virtual interface wifi0 interface which I think gets a unique mac each time.. you think that could be the problem?
That certainly fits. I've never tried to make a virtual wifi interface. Is there a way to make it use the same MAC address every time? At worst, you could probably just modify your /etc/init.d script to hardcode the MAC address on this interface (ifconfig wifi0 hw ether ....) before starting sagetv.

Drew
Reply With Quote
  #13  
Old 03-13-2009, 10:31 AM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
Man I can't beleive that I have to have the same MAC addresses everytime to make sure I don't get a corrupt wiz.bin .. I mean what If I want to add a card.. or if I have a card go bad and have to replace it. Does that mean I'm going to get a wiz.bin corruption? Believe it or not sometimes we keep recordings for 6 months (kids shows that we can play over and over). We also setup like 40 things to record for and manage the favorites. There has to be a better way to do this. Is there anyone from support that can help? Is there anyone from the dev team that can confirm this?

On a seperate note in attempt to work around this problem I've bought a HDHR and I'm thinking I might setup a sage server in a vbox and see how that goes.

FYI: I've confirmed that everytime I reboot the server I get a corrupted wiz.bin and if it's because I have different mac addresses on the br0 and wifi0 interfaces I think thats something that definiately needs to be addressed.

Suidog
Reply With Quote
  #14  
Old 03-13-2009, 10:39 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by SuiDog View Post
Is there anyone from support that can help? Is there anyone from the dev team that can confirm this?
Since this is a user-to-user forum and a develepor only might see a post, I suggest you submit a report to SageTV to see what they say about it.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #15  
Old 03-16-2009, 11:49 AM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
Ok. Since I was having so many problems with wiz.bin corruption I figured I'd go a different way with this. I'm now moving to getting a sage box up in vmware on my ubuntu server. I have purchased a HDHR and will be using it as my tuner instead of the Hauppauge 500 I have.

I'm going to start a new thread with instructions and screenshots.
Reply With Quote
  #16  
Old 06-28-2009, 03:07 PM
shugrue shugrue is offline
Sage User
 
Join Date: May 2007
Posts: 25
Your solution is right on the money.
Sage needs to start after everything else.
Thanks for finding this cure.

-pat
Reply With Quote
  #17  
Old 10-03-2009, 05:30 AM
DylanHall DylanHall is offline
Sage User
 
Join Date: Sep 2009
Location: Wellington, New Zealand
Posts: 32
Just to add my experiences to the mix..

I've been trying to debug a kernel panic in my NIC driver so I've been swapping eth0 and eth1 around.

First time I did the NIC swap (after the kernel panic) the Wiz.bin got trashed and nothing I did would recover it. I eventually uninstalled everything, then reinstalled before it would work again. The actual problem was I couldn't connect to the server with my HD200. It would get half-way through connecting, the just switch off.

Having just installed a new NIC driver I've switched back to my original NIC, and bang, corrupt Wiz.bin again. Some googling found this thread I banged my head against the corruption problem for a bit and was just about to reinstall it again when a thought occurred.

I re-ran the "keygen.sh" script and re-registered the product. This seems to have fixed the issue. I'm guessing the MAC address of the NIC is embedded in the crypto stuff somewhere, maybe as a unique identifier for your machine.

I've also switched the init stuff to 99. A more ubuntu friendly way to do that is:

update-rc.d -f sagetv remove
update-rc.d sagetv defaults 99

Hope this helps someone

Dylan
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wiz.bin corruption with 2.6.24 kernel and Save 6.3.x svemuri SageTV Linux 7 02-03-2011 04:17 PM
Unhappy with design of Sage's Wiz.bin recovery stevech SageTV Software 20 09-28-2006 01:04 PM
Can I get program info back after a Wiz.bin corruption? zubblwump SageTV Software 3 01-12-2005 03:30 AM
wiz.bin corruption? PaulModz SageTV Software 7 08-05-2003 06:30 PM
Wiz.bin corruption and lost shows questions PaulModz SageTV Software 4 07-21-2003 05:38 PM


All times are GMT -6. The time now is 01:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.