|
|
08-01-2007, 09:35 PM
|
#1
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
How can I perform a graceful shutdown/reboot?
I've been rebooting my Tivo ALOT lately (see http://www.tivocommunity.com/tivo-vb...d.php?t=360675 ) and would like to find a way to do it gracefully.
Pulling the plug, using "restart the recorder" from the UI, running /sbin/restart or using the reboot binary all crash the system resulting in corruption on the var partition. I'm not surprised that people lose their hacks!
Is there another binary or script that exists which will shutdown the Tivo properly? I always worry about the potential for database corruption that isn't reported since the partitions are not mounted normally.
Last edited by ciper : 08-02-2007 at 03:18 AM.
|
|
|
08-02-2007, 01:34 AM
|
#2
|
|
It wasn't me.
Join Date: Aug 2006
Location: Southsea, Hampshire
Posts: 1,381
|
I've rebooted my TiVo plenty of times while tinkering with scripts, and have not once had fsck run. I've even used 'reboot' from the shell prompt and not seen a problem.
So I'm wondering if your tinkering has made the TiVo unstable.
Also - is your root partition set to read only before a reboot or RW? I'm wondering if rebooting while in RW mode is causing the problem.
|
|
|
08-02-2007, 02:29 AM
|
#3
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
Check your kernel log. e2fsck always runs even if the FS is clean. I tested this by pulling the drive and cleaning the var partition and then placing it back into the Tivo. I didn't mean mfsfix/gsod. The closest thing I can think of is running
But even that still causes some corruption on var
Here is an example of what to look for.
Code:
Jan 1 00:03:18 (none) kernel: Loading input section drivers
Jan 1 00:03:18 (none) kernel: Cleanup /dev/hda9 pass 1
Jan 1 00:03:18 (none) kernel: ext2fs_check_if_mount: No such file or directory
Jan 1 00:03:18 (none) kernel: /dev/hda9 was not cleanly unmounted, check force
Jan 1 00:03:18 (none) kernel: Deleted inode 28712 has zero dtime.
Jan 1 00:03:18 (none) kernel: Set dtime? yes
Jan 1 00:03:18 (none) kernel:
Jan 1 00:03:18 (none) kernel: Fix summary information? yes
Jan 1 00:03:18 (none) kernel:
Jan 1 00:03:18 (none) kernel: /dev/hda9: 505/32768 files (4.0% non-contiguous)
Jan 1 00:03:18 (none) kernel: Cleanup /dev/hda9 pass 2
Jan 1 00:03:18 (none) kernel: ext2fs_check_if_mount: No such file or directory
Jan 1 00:03:18 (none) kernel: /dev/hda9: clean, 505/32768 files, 27338/131072
Jan 1 00:03:18 (none) kernel: /dev/hda9 is clean after pass 2
Last edited by ciper : 08-02-2007 at 04:20 AM.
|
|
|
08-02-2007, 03:14 AM
|
#4
|
|
tivoheaven.co.uk
Join Date: May 2002
Location: Malmesbury, UK
Posts: 5,577
|
Try "restart"
__________________
6023, Lifetime, 240gb, Sky, CC, Mode 0, 100 SPs/AWLs
6022, Lifetime, 250gb, Freeview, CC, Mode 0, 90 SPs/AWLs
601E, my 'test' machine!
|
|
|
08-02-2007, 03:19 AM
|
#5
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
I edited my first post to include restart. It does it too. Here is the log entries from using /sbin/restart
Code:
Jan 1 00:03:19 (none) kernel: Loading input section drivers
Jan 1 00:03:19 (none) kernel: Cleanup /dev/hda9 pass 1
Jan 1 00:03:19 (none) kernel: ext2fs_check_if_mount: No such file or director
Jan 1 00:03:19 (none) kernel: /dev/hda9 was not cleanly unmounted, check forc
Jan 1 00:03:19 (none) kernel: Fix summary information? yes
Jan 1 00:03:19 (none) kernel:
Jan 1 00:03:19 (none) kernel: /dev/hda9: 529/32768 files (6.0% non-contiguous
Jan 1 00:03:19 (none) kernel: Cleanup /dev/hda9 pass 2
Jan 1 00:03:19 (none) kernel: ext2fs_check_if_mount: No such file or director
Jan 1 00:03:19 (none) kernel: /dev/hda9: clean, 529/32768 files, 32223/131072
Jan 1 00:03:19 (none) kernel: /dev/hda9 is clean after pass 2
Jan 1 00:03:19 (none) kernel: Mounting /var
I'm going to now try
sync ; mount -o remount,ro /var ; restart
even though it doesn't take car of the MFS partitions.
Last edited by ciper : 08-02-2007 at 03:26 AM.
|
|
|
08-02-2007, 03:33 AM
|
#6
|
|
TiVoCentral.co.uk
Join Date: Jun 2005
Location: Up North
Posts: 2,594
|
running restart at least tries to dismount /var ...
Quote:
bash-2.02# restart
Killing processes...
Dismounting /var
Couldn't dismount /var
Restarting system...
|
umount -f /var
gives the mesage that forced umounts aren't implemented yet
fuser -km /var
but fuser isn't on tivo series1, unless there is a binary floating around the net ?
__________________
TivoCentral.co.uk - To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
08-02-2007, 03:40 AM
|
#7
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
Haha I was just going to post the exact same thing not including fuser.
My attempt above using "sync ; mount -o remount,ro /var ; restart > /var/reboot.log" resulted in me getting stuck at a "mount: /var is busy" prompt and I cant undo it
Ive been doing all my testing remotely using telnet and a slingbox so it seems I might be done for the night!
|
|
|
08-02-2007, 04:04 AM
|
#8
|
|
Serious TiVo User
Join Date: Oct 2000
Location: Swansea
Posts: 1,178
|
rebooting by pulling the plug or using the shutdown in the UI shouldn't lose /var.
In my experience, what causes my /var partition is pulling the plug while a reboot is in progress or possibly immediately after TiVo has rebooted while system tasks are still being completed.
__________________
TiVo user since the very beginning.
Hacks: 120Gb (44 hours best quality), Serial PPP (no longer used), Turbonet, TivoWeb, endpad, To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
08-02-2007, 04:19 AM
|
#9
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
Even if thats the case any of the current methods of rebooting the system cause some type of errors on the partition and I dont like it. Try it yourself. Afterword search your kernel log for "cleanup"
Looks like there was a discussion about something similar on the other forum http://xaddr.com/sh
Edit: Hmm this is getting a little better but not quite http://forums.oztivo.net/showthread.php?t=962
Last edited by ciper : 08-02-2007 at 04:28 AM.
|
|
|
08-02-2007, 07:07 AM
|
#10
|
|
Registered User
Join Date: Oct 2000
Location: Reading, UK
Posts: 6,468
|
Quote:
|
Originally Posted by aerialplug
In my experience, what causes my /var partition is pulling the plug while a reboot is in progress or possibly immediately after TiVo has rebooted while system tasks are still being completed.
|
Your local electricity company can also do it remotely by cutting your power twice in quick succession.
__________________
Ian.
Windows 7 MCE, 2 x Freeview Tuners, 1 x HD Freesat Tuner, 1TB Hard Drive, 1.5TB Mirrored Raid on e-SATA.
1 x Xbox360 MCE Extender.
1 x LinkSys DMA2100 Extender.
1 x Broken TiVo.
|
|
|
08-02-2007, 07:42 AM
|
#11
|
|
Registered User
Join Date: Dec 2006
Posts: 3,946
|
Those error messages just seem to indicate that the "unmounted cleanly" flag (if that's what it's called) isn't set. I can't see this does any harm? /var is only wiped if it fails a second check.
|
|
|
08-05-2007, 12:09 PM
|
#12
|
|
Serious TiVo User
Join Date: Oct 2000
Location: Swansea
Posts: 1,178
|
Quote:
|
Originally Posted by iankb
Your local electricity company can also do it remotely by cutting your power twice in quick succession.
|
Yes, I suffered this last December.
__________________
TiVo user since the very beginning.
Hacks: 120Gb (44 hours best quality), Serial PPP (no longer used), Turbonet, TivoWeb, endpad, To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
08-05-2007, 02:05 PM
|
#13
|
|
Registered User
Join Date: Jan 2007
Posts: 34
|
Every now and again my Tivo appears to be interlaced.
Recordings are fine, but entirely unwatchable until you reboot. Happens to me about once a fortnight...
|
|
|
08-05-2007, 02:41 PM
|
#14
|
|
Registered User
Join Date: Dec 2006
Posts: 3,946
|
What do you mean? TiVo's output is always interlaced.
|
|
|
08-06-2007, 08:16 AM
|
#15
|
|
Registered User
Join Date: Mar 2002
Location: East of England
Posts: 2,622
|
Quote:
|
Originally Posted by aerialplug
Quote:
|
Originally Posted by iankb
Your local electricity company can also do it remotely by cutting your power twice in quick succession.
|
Yes, I suffered this last December.
|
I stuck a cheap UPS on mine to prevent it all going to pot when the power goes out for a couple of minutes which was quite regular over winter. Pleased to learn this should save me more than the odd recording!
I can recommend this 500VA one - you'll need to convert a power strip to a kettle lead connection.
http://cpc.farnell.com/jsp/search/pr...?SKU=CS1324907
£33 inc VAT + delivery or free delivery if your exVAT order is over £40.
__________________
My Series 1 Tivo has been unplugged since 2011 but I haven't the heart to get rid of it.
|
|
|
08-06-2007, 09:06 AM
|
#16
|
|
TiVoCentral.co.uk
Join Date: Jun 2005
Location: Up North
Posts: 2,594
|
Quote:
|
Originally Posted by TCM2007
What do you mean? TiVo's output is always interlaced.
|
One of my tivos does that too... tivo seems to get its video output clock rate confused, all display including menus are all affected. Its like the effect you get when a PC is its outputting a scan rate the monitor can't handle (no picture roll though)
Its been doing it once a week or so for the past 2 years, and hasn't got any worse. A reboot cures it, and recordings are unaffected.
|
|
|
08-06-2007, 11:58 PM
|
#17
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
The best solution I have found so far is to use
Code:
/bin/sync ; /sbin/restart
This still results in the error on startup that the FS was not unmounted but at least there aren't other errors. The /sbin/restart binary tries to unmount var but is unable to because the FS is in use. I think tivoweb and mfs_ftp are to blame so I'm going try and create a scrip that syncs the disk, kills the offending app and then runs the combination sync;restart.
Code:
bash-2.02# sync ; restart
Killing processes...
Dismounting /var
Couldn't dismount /var
Restarting system...
TmkLogger:
Last edited by ciper : 08-07-2007 at 04:51 PM.
|
|
|
08-07-2007, 03:03 AM
|
#18
|
|
TiVoCentral.co.uk
Join Date: Jun 2005
Location: Up North
Posts: 2,594
|
I've just found a post from yourself saying you have the fuser binary, so
fuser -km /var
kills any processes that are using /var
then you should be able to unmount it.
fuser -um /var
would show which processes are using /var
|
|
|
08-07-2007, 03:39 AM
|
#19
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
Nice! Ill try that. Its kinda funny but I was planning to re enable mode0 on my tivo and after searching I found a post by myself that I didn't even remember writing that had all the settings in it LOL
|
|
|
08-07-2007, 11:42 AM
|
#20
|
|
Registered User
Join Date: Dec 2006
Posts: 3,946
|
Quote:
|
Originally Posted by mikerr
I've just found a post from yourself saying you have the fuser binary, so
fuser -km /var
kills any processes that are using /var
then you should be able to unmount it.
fuser -um /var
would show which processes are using /var
|
Careful; forcibly killing a process running under tivosh which has the databse open can (and usually does) make the TiVo crash and reboot in anything but a nice way!
That's why EndPad, mfs_ftp and other have these convoluted ways of unloading themselves, 'cause kill -9 ends up with the "Almost there..." screen.
Last edited by TCM2007 : 08-07-2007 at 11:47 AM.
|
|
|
08-07-2007, 07:23 PM
|
#21
|
|
Registered User
Join Date: Nov 2004
Posts: 1,980
|
Shoot. I used to have just about every binary imaginable that would run on the S1. After my A drive crapped out recently I lost everything and had to start from scratch. I thought I had a complete backup but come to find out many of the files are missing.
By chance did anyone download the archived copy of the "complete" S1 binary set? I'd love to get my hands back on it as it took a long time to find and sort the binaries to weed out the MIPS versions.
|
|
|
08-07-2007, 09:54 PM
|
#22
|
|
back?
Join Date: Nov 2003
Location: Rockport, MA
Posts: 1,596
|
remember that syslog does a lot of scribbling on /var... you'll need to turn off logging just before rebooting.
__________________
Check Out my To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. with info on TWP2.0 and Tivoserver
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|