View Full Version : Backup copy of tivoapp disappered from /tvbin
rrr22777
10-12-2006, 04:09 PM
I am following http://www.dealdatabase.com/forum/showthread.php?t=51121 to modify tivoapp.
To make some modications I did a cp /tvbin/tivoapp /tvbin/tivoapp.orig. Then I went ahead and made the modifications and rebooted but the Tivo was stuck at "Almost there..." so I pulled the drive and did some digging on hda7 and hda4. My active partition was 7 so I checked in /tvbin which had the modified version of tivoapp but my backup copy was gone. I was able to recover by copying the tivoapp from partition 4 to 7 but before I go doing the same thing again I want to know how is that the backup copy disappeared.
Should I be making the backup in /var/hacks?
Narf54321
10-12-2006, 05:50 PM
If you forgot to make root writable, then your copy commnd will fail. If your root partition is almost full, a copy command might begin but will ultimately fail -- perhaps without much warning. Another possibility, if your tivo somehow decided to do an update and was waiting to reboot, you may have flipped bootpages and when restarted it looks like tivoapp.orig disappeared (it may now be on your 'alternate' partition).
In any case, since each partition usually has different versions of system software I'd recommend not copying tivoapp from the 'old' partition.
rrr22777
10-12-2006, 06:15 PM
If you forgot to make root writable, then your copy commnd will fail. If your root partition is almost full, a copy command might begin but will ultimately fail -- perhaps without much warning. Another possibility, if your tivo somehow decided to do an update and was waiting to reboot, you may have flipped bootpages and when restarted it looks like tivoapp.orig disappeared (it may now be on your 'alternate' partition).
In any case, since each partition usually has different versions of system software I'd recommend not copying tivoapp from the 'old' partition.
Well in my case copying the old partition worked. I know that after the reboot I was still on partition 7 because the modified date of tivoapp was the day I ran dd and bootpage returned 7.
I did run out of space in the middle but I redid the copy after I deleted some extra copies to tivoapp.
Important lession though may be we should backup to a different directory like /hacks instead of creating backups in /tvbin.
Jamie
10-12-2006, 06:27 PM
Important lession though may be we should backup to a different directory like /hacks instead of creating backups in /tvbin.I don't think that's necessary in general.
You can't modify a running tivoapp, so if you copied it to tivoapp.orig then tried to modify the original with dd, you'd get a "Text file busy" error (details here (http://mail.nl.linux.org/kernelnewbies/2003-04/msg00137.html)). The standard practice (and what is described in the thread you linked to) is to mv the running tivoapp to tivoapp.orig, then cp back to tivoapp to make the modifications. That is:
mount -o remount,rw /
cd /tvbin
mv tivoapp tivoapp.orig
cp tivoapp.orig tivoapp
<apply patches to tivoapp>
mount -o remount,ro /
rebootIt's always a good idea to remount the file system readonly before you reboot. Otherwise you may lose any recent changes you made on the file system.
rrr22777
10-12-2006, 07:38 PM
I don't think that's necessary in general.
You can't modify a running tivoapp, so if you copied it to tivoapp.orig then tried to modify the original with dd, you'd get a "Text file busy" error (details here (http://mail.nl.linux.org/kernelnewbies/2003-04/msg00137.html)). The standard practice (and what is described in the thread you linked to) is to mv the running tivoapp to tivoapp.orig, then cp back to tivoapp to make the modifications. That is:
mount -o remount,rw /
cd /tvbin
mv tivoapp tivoapp.orig
cp tivoapp.orig tivoapp
<apply patches to tivoapp>
mount -o remount,ro /
rebootIt's always a good idea to remount the file system readonly before you reboot. Otherwise you may lose any recent changes you made on the file system.
Thank you. I think my missing piece was not running mount -o remount,ro /
Jamie
10-12-2006, 07:49 PM
Thank you. I think my missing piece was not running mount -o remount,ro /If you've failed to do that in the past, it's probably a good idea to run e2fsck -y /dev/hda7 to repair any damage in the file system. Be sure to do this when the file system is mounted readonly.
wtsexton
10-14-2006, 10:33 PM
After I make any changes I normal sync the file system. Just a habit from working with removable media in linux.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.