Tivo Hacks. 100 Industrial-strength Tips Tools 2003
Hack 29 Mounting and Working with TiVo's Drive Partitions
Before you can edit any of TiVo's configuration files, turn on the Bash shell, copy across files, and so forth, you need to understand a little about TiVo's drive partitions .
If you've performed a hard drive upgrade or simply read through Chapter 2, you probably noticed that we kept to the task at hand and never really devoted any time to what was actually on TiVo's disks. You had your hands fullliterallyalready, now didn't you?
In order to perform any of the feats in this chapter, you'll need at least a lay of the land when it comes to your TiVo's drives . If you're used to Unix, this will probably seem rather familiar to you; nevertheless, a quick refresher never did anyone any harm.
I'm assuming that you have gained direct access to your TiVo's drives by performing the following steps:
-
Opening your TiVo [Hack #20]
-
Removing its drive [Hack #21]
-
Mounting the drive in a spare PC [Hack #22]
If not, you'll need to do so before any of this hack is of any real use to you.
Understanding Partitions
The information on your TiVo's primary drive is stored in different sections on the disk, each called a partition . A standard TiVo contains 11 partitions, 3 of which (partitions 4, 7, and 9) are mountable by the Linux operating system, and are where you'll edit files and store programs for further hacking.
Before you start mounting and editing files on your TiVo's primary drive, you should understand how TiVo treats partitions 4 and 7. Both of these partitions contain copies of the root image of your TiVo's operating system, but only one of themcalled the active partition contains the active root image. The most current version of the TiVo OS and configuration files are stored in the active partition. The inactive partition contains a backup copy of the previous version of the operating system and configuration files. Depending on which partition was active when you first plugged in your TiVo, how many system software updates you've received, and the alignment of the planets, either partition 4 or partition 7 will be your currently active partition, the other being the inactive or backup partition. You'll figure out which is which in Section 3.2.2 in just a moment.
When your TiVo downloads a new system software update, it writes the new, updated version to the inactive partition. When your TiVo reboots for the first time following the update, it swaps what it considers to be the active and inactive partitions (from 4 to 7, and from 7 to 4), keeping a backup of the previous version of the system software on what is now the inactive partition and running the current version on what is now the active partition.
If you've recently performed a capacity upgrade using MFS Tools [Hack #25], your TiVo will not contain a copy of the inactive partition, because it is not backed up using MFS Tools method. Don't worry! Your TiVo will automatically create an inactive partition the next time it updates its system software, and you can still use all the information in this guide without any problems.
On the other hand, if you upgraded your TiVo's recording capacity by simply adding a second drive [Hack #26] without altering your drive, you will still have both partitions on your system.
Mounting Partitions
Having booted your PC with your TiVo hard drive(s) attached, you'll need to mount the partitions before you can use them. Start by creating some new directories that will serve as mount points (think of them as parking places) for your partitions. Do so for partitions 4, 7, and 9 by typing:
# mkdir /mnt4 # mkdir /mnt7 # mkdir /mnt9
Now that you have a place to put them, mount each partition, pairing up the partition name and mount point:
# mount /dev/hd X 4 /mnt4 # mount /dev/hd X 7 /mnt7 # mount /dev/hd X 9 /mnt9
If you've forgotten the real name of your hard drive (e.g., /dev/hdX4 ) refer to Table 2-4.
If all goes well, none of thee commands should produce any output. Occasionally, however, you may come across one of two error messages:
-
The "checktime" error is simply Linux making note of successfully mounting an unfamiliar or unverified partition:
EXT2-fs Warning: checktime reached EXT2-fs Warning: mounting unchecked file system EXT2-fs Warning: maximal count reached
Every so often, Linux likes to make sure that filesystems are running well under the hood. Chances are, yours is, so pay the error no heed.
-
While trying to mount partition 4 or 7, you may be warned that you're mounting a filesystem that does not exist:
fatfs: bogus cluster size VFS: Can't find a valid MSDOS filesystem on dev 16:07. fatfs: bogus cluster size VFS: Can't find a valid MSDOS filesystem on dev 16:07. mount: you must specify the filesystem type
This usually happens only if you've performed a capacity upgrade to your TiVo's drive using MFS Tools [Hack #25], which, as I've mentioned, does not back up the inactive partition.
If you receive this error while trying to mount partition 4, it means that you do not have a partition 4 and your active partition is 7. Conversely, if you receive this error while trying to mount partition 7, it means that your active partition is partition 4 and partition 7 is missing. Don't worry about the missing partition as you obviously can't mount a nonexistent partition.
Poking About
While I'll give you the full tour [Hack #35] in a bit, a quick mention of what's where is probably in order:
- /dev/hdX4 and /dev/hdX7
-
These two directories should look pretty similar to each other, while also looking remarkably similar to the / directory on a Linux system. This should come as no surprise, since that's exactly what TiVo is! You should see familiar directories like /etc , /dev , and /bin , but here they are called /mnt4/etc , /mnt7/etc , and so forth. That's only because we have the hard drive mounted in this odd way temporarily.
- /dev/hdX9
-
This is what gets mounted as the /var directory when your TiVo is running. Files in the /var directory constantly change when the system is running. Notice the /var/log directory containing TiVo's log files. You'll also notice that the /tmp directory is located here too.
Go To
If your intent was to enable the Bash shell over serial port, move on to [Hack #30].
|
Top |