View Full Version : I got the disappearing /var filesystem blues
cojonesdetoro
10-31-2003, 02:34 PM
Hey,
I finally got pissed off enough about the /var filesystem disappearing that I came up with a good way to back it up directly to another linux machine. You need to get a copy of netcat that runs on the Tivo. I used one that came with a a package called extractstrem (I forget what project it is under). The netcat binary file is usualy named 'nc'.
I run this command on the tivo:
/var/hack/tar cf - /var | nc -n -l -p 24
and this command on the linux box (cygwin might work too):
nc tivo_ip_address 24 > tivo-var-system.tar
Seems to work well but I haven'tr tried a restore. I can say that my Linux tar binary can read and extract it. You also have to make sure you keep an FTP binary and maybe a tar binary on the root FS of the Tivo so this can be restored.
Another thing I've thought about is running the above tivo command in a looped script so I can always kick off a backup from my linux box from a cron job.... fun stuff.
L8R
TheWickedPriest
10-31-2003, 03:52 PM
The best solution is to monte, and put your hacks in the root partition, where they won't be deleted. Or you could create a new partition in the free space just for your hacks.
cojonesdetoro
10-31-2003, 04:09 PM
Originally posted by TheWickedPriest
The best solution is to monte
Yep, no monte here. I gotta add a sig with SA1, etc.
I used to do this but I like to have stuff backed up off the tivo too:
Tivo1# tivo cat /var/hack/varbackup.sh
#!/bin/sh
rw
cd /
mkdir var-backup
# ignore the error
cd var-backup
tar czvf var-backup.tgz /var
cp $( which tar ) .
cp $( which gzip ) .
ro
I keep /var because I have alot of things that assume /var/hack and mfs_ftp insists on /var/mfs-ftp. A lot of things also assume they're on a rw FS. It's also a pain to create all the soft links.
TheWickedPriest
10-31-2003, 04:15 PM
Mine doesn't. :-) Most of those things, you can just edit in the TCL.
MuscleNerd
11-19-2003, 08:04 PM
It's much much easier to populate /var/hack with sym links to where you're safely keeping your stuff. You can even automate the bootup so that if /var has been rebuilt, the sym links are then rebuilt too. It's much easier/faster to recreate a small tree of symlinks than to restore all of the actual programs.
johnmacd
11-20-2003, 02:20 PM
can you give us linux newbies a hint on how to set this up? This sounds simple enough, but I'm unsure where to start.
MuscleNerd
11-20-2003, 02:48 PM
This script creates symlinks between /var/hack and the actual location of your TiVo hacks (specified in the "realTree" variable). It's okay to run this script at every boot, even when the /var/hack symlinks are already there.
The symlinks allow you to run utilities that depend on the /var/hack path, but in reality your hack tree is safely stored on another partition.
Instructions:
[list=1] Make sure you've done "chmod +x checkvarhack" to make this script executable.
Specify the real location of your TiVo hacks in the "realTree" line
[/list=1]
johnmacd
11-20-2003, 08:39 PM
any suggestion on a safe place to keep the hacks? What dir wouldnt get wiped out by Tivo?
and thanks for that script
John
MuscleNerd
11-20-2003, 08:46 PM
Anywhere on the root filesystem (e.g. /hack) will be "safe". The caveats are:
You can run out of space there if you go overboard with hacks
You must always remember to do "mount -o remount,rw /" when you want to write to that partition, and do "mount -o remount,ro /" when you're done.
If you're on an S2, you must be using monte to jump into your system (or, have a hacked bootrom). If you're not, everything you try to put on the root filesystem will be blown away.
Alternatively, you can use pdisk to allocate a brand new partition on the drive, format it as an ext2fs, mount it during the boot process, and keep all your stuff there. That is the most complicated, but by far it's the safest place for your stuff (but only if you know what you're doing).
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.