Archive for July, 2012|Monthly archive page

DTB or not DTB, that is the question…

(or how a tale of woe was reversed)…

About 5 years ago, when the old VCR gave up the ghost, I purchased a Wharfedale 160GB PVR with twin tuner.  I guess at the time I’d had it in mind at some stage in the future to acquire a DVD recorder so I could off-load programmes from the PVR to it. At least that was the plan!

Throughout the years since then I’d wondered a couple of things:

  1. What could be done with the DB9 serial connection on the back
  2. What sort of hard drive was inside and, more importantly, would I be able to read it on a computer?

I never got round to doing anything about 1, but events this week have forced me to address 2 – I returned home on Monday to find the PVR dead! 😦  Having done the usual things (unplug, plug in, change fuse) I decided to take a look inside:

Inside my (now dead) Wharfedale PVR.

Is this an IDE I see before me?  Well as it turns out, yes.  A 160GB Western Digital hard drive.  “Simples,” thinks I. “Just have to pop it in my Lacie external USB drive case and Bob’s your mother’s brother!”

Well….not quite!

HDD was removed from the PVR and installed in USB case and connected to laptop running Linux Mint 12.  a quick fdisk revealed:

Disk /dev/sdf: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcfaab5fa
 
Device     Boot  Start       End     Blocks Id System
/dev/sdf1           63    417689    208813+ 83 Linux
/dev/sdf2       417690 312576704 156079507+ 83 Linux

So far, so good. It looks like the embedded O/S was Linux-based.  Wonder what filesystem types were used:

/dev/sdf1: UUID="7fc78ac0-b003-9dc0-cc66-e0c1a4e0cbc1" TYPE="ext2" 
/dev/sdf2: UUID="7fc78ac0-b003-9dc0-cc66-e0c1a4e0cbc1" TYPE="ext2"

Looks OK apart from both partitions having the same UUID Ever get the feeling things are too easy sometimes?  Read on….

# mount /dev/sdf1 /mnt
# df -h /mnt
Filesystem    Size Used Avail Use% Mounted on
/dev/sdf1     204M 6.4M  198M   4% /mnt

OK. So the first partition mounts.  let’s try the second…

# umount /mnt
# mount /dev/sdf2 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdf2,
 missing codepage or helper program, or other error
 In some cases useful info is found in syslog - try
 dmesg | tail or so

ARRGH!  Do I run fsck and try and repair superblocks (risking  corrupting what’s on there)? Best to exercise a bit of caution at this stage, so I used a utility called partimage to take a backup of the second partition, writing to a 500Gb USB drive I have.  Partimage works at a lowere level than the filesystem and will create an exact image of the partition, split into 2Gb files if required, thus enabling the recovery of the partition should something go wrong.

Whilst partimage was doing its thing, considerable Googling was done, with the upshot being that the second partition was formatted using a “modified” ext2 using 32K blocks rather than the usual (maximum) 4K blocks. Other PVR users had attempted the same thing and hit the same problem (it turns out that the Wharfedale unit is really made by Vestel, who provide similar re-badged units to supermarkets etc).  Under normal circumstances, Linux can’t handle filesystems with 32K blocks (well, not without patching the kernel and I wasn’t about to start that).

What to do?  Well, loathe as I am to say it, this is where a piece of software written for Windows called ext2fsd comes in which basically adds a driver to Windows so that it can read ext2 filesystems. I installed the software and connected the drive and sure enough, the second partition and its contents were visible.  Each programme recorded is stored in a separate directory (folder in windows land) with the directory name based on date/time recorded. For example, here’s the directory holding the earliest recording:

~dvr2007081322003801.rec

“That’s odd.  I’m certain I didn’t get the PVR until September 2007” Looking at some of the other directory names it seems the month and day portions start at 00 (for the 1st), so the directory name breaks down thus:

2007                 Year
    08               Month (-1, so this in fact indicates September)
      13             Day (again -1, so this is 14th)
        22           Hour
          00         Minute
            38       Channel (In this case BBC4)
              01     All the recordings end in 01 for some reason

Coming up in Part II: Getting to grips with video encoding and producing a DVD…