Drew Scott Daniels' Blog Personal, usually technical posts

January 3, 2009

Adventures with testdisk

Filed under: Uncategorized — admin @ 8:00 pm

Saturday, January 3rd, 2009 (2009/01/03)
Drew Scott Daniels

Adventures with testdisk

Testdisk seems like a great utility as does its companion PhotoRec. I recently had a single NTFS partion hard drive stop displaying its contents in Windows. When I tried to mount it in Linux, “mount” complained that the $MFT file which holds the meta data about where files are was missing or corrupt. My initial experiments with testdisk showed the same results. The mirrored copy of the MFT seemed to be missing or corrupt too.

To try to restore the MFT file, I wanted to use the beta TestDisk 6.11. I tried the Microsoft Windows version which seems to be CygWin compiled. I’ve seen many problems with cygwin in the past so I have a bit of a distaste for it. I much prefer when applications are compiled with mingw. I gave it a try anyway, but couldn’t find the MFT recovery section, I later learned it was under Advanced, then Boot.

Since I had trouble with the Windows version, I pulled out an old copy of Knoppix (a Linux LiveCD) and booted to Linux with the startup options:

knoppix 2 noswap

The “2” boots to the command prompt which takes less memory. The noswap option prevents Knoppix from automatically trying to write files to any of the disks for “swap” space (AKA a page file). I later added the option “nodma” to try to make sure that the DMA controler/driver weren’t causing problems with trying to mount or run TestDisk.

Knoppix comes with the testdisk package installed, so I gave it a quick try. I didn’t find the MFT recovery section so I moved on to compiling TestDisk 6.11. I already had the source code so I coppied that to /tmp and tried configuring it. Of course, I was missing build dependencies. After a while of playing I remembered I could do an “apt-get build-deps testdisk”, but I needed to update the /etc/apt/sources.list file first so that I didn’t try to pull in a new libc6 (my Knoppix CD was from 2006) or anything else like that. On reflection, I should have added the deb-src line for Debian unstable (sid) after, and done a “apt-get source testdisk”, then coppied over the new TestDisk code, then did another round of getting build-deps.

I managed to get it compiled with a simple “./configure;make”, and ran the executable without needing to install the package. I still didn’t find the MFT option.

I rebooted back into Windows as my nagios monitor was of course reporting the host as being down, and my nightly bacula backup was about to start. I decided to treat the MFT issue as an accidentally reformated partition. I then went to Windows’ TestDisk’s Advanced, Boot options and found the MFT recovery option. The MFT mirror wasn’t available either. So I stared the boot recovery option which seems to scan for the MFT. The “Rebuild BS” didn’t seem to help. The MFT file or files seem to have bad magic. I beleive bad magic means the “magic numbers”. The magic numbers are a fixed string of bytes which are usually at the beginning of a file. See the “file” utility for more information on “magic”.

So I had no luck finding the MFT. I’m now starting to look at PhotoRec which supports scanning for an interesting variety of files. Unfortunatly, I’ll have to find a disk large enough to put all the found data on. I’ll have to sift through the data by hand and look to see if there was anything useful on the drive. I mostly think it was just where I did optical media backups so I’m not too worried, but I think I may have had some more interesting backups there.

Drew Scott Daniels’ resume: http://www.boxheap.net/ddaniels/resume.html

Originally from: http://www.boxheap.net/ddaniels/notes/20090103.html

January 1, 2009


Filed under: Uncategorized — admin @ 8:00 pm

Thursday, January 1st, 2009 (2009/01/01)

Drew Scott Daniels

  • Updated 2009/01/02, added links to build EVA8000 firmware.

Open Source on my TV

I recently got a new LG TV. It has an “Open Source Software Notice” with the caviet “This feature is not available for all models.” It notes that it may be running Linux kernel 2.6.12, busybox, uclibc, and Nanox. To get a CD (for a charge of distribution and media), within 3 years of distribution, I have to write to Opensource@lge.com which I think I’ll give a try. There’s a USB port and RS-232C in port on the back of the TV for “service only” which have the note “Used for software updates.”. I can’t find any other details so I guess it’s time to make some inquiries, and make sure I’ve got a nice null modem cable which I can use for lots of other projects.

I’d like to find a way to make use of the MPEG decoder that’s on my TV. A cheap encoder that I got the link for went for several hundered
dollars. I don’t know of any easily accessible digital television (DTV)
signals in my area. I’m wondering if Shaw offers free to air (FTA) DTV
that my TV will accept as CADTV (cable DTV?). I know PBS in Minnesota, and FOX in Pembina, ND may theoretically be accessible, but I don’t have time for that until it’s warm enough outside.

Since the TV has a nice “SVGA” input plug (that they call “RGB(PC)”) in
the form of a “D-sub 15 pin cable (VGA cable)”, I may try and hook up a computer to it. I’m conserned about the noise of the fans which seem to fail fast. I also would like to run another circut so I don’t have to stretch to the next circut’s plug. I’m thinking this could replace my Netgear EVA8000 – Digital Entertainer HD.

Netgear EVA8000 runs Linux

Netgear’s EVA8000 has a support page here, but the main forum and a restricted beta forum seem to have quite a bit of information not in their support site.

My Netgear EVA8000 runs Linux, and has several open ports on it. It
seems like the firmware is encrypted though. I can’t find anyone posting information like even a port scan so I may do that later. I’m worried that the Netgear EVA9000 will/has caused the developers to stop working on the EVA8000 which I hear ran out of memory.

Although for what they call GPL compliance, they offer to let you
download source code for the EVA8000, it seemed to be the original
version only (I later found the Feb 2008 release). It also seemed to be stripped of quite a bit of functionality. I also can’t easily figure out a way to upload the code which I think is intentional. I guessed it was a simple block device upload, but it didn’t mount in loopback. I should run testdisk on the file just in case. I think I remember reading somewhere about an encryption password being used to do updates, but it seems others have figured out how to dissect the image like this:

dd if=$FW of=crc bs=1 count=32
dd if=$FW of=bootkernel bs=1 skip=32 count=$((0x210000))
dd if=$FW of=jffsroot bs=1 skip=$((0x210020))

I just found a forum thread about how to edit the firmware images, and I’ve seen they’ve updated the source code to the latest non-beta release. Versions in between don’t seem to be available nor do beta versions. Unfortunately it seems you have to register to see this.

Another use for a null modem cable is connecting to the EVA8000 during boot and after interrupting the boot (by sending a few escape’s?), typing:

config cmd root=/dev/nfs ip=bootp
boot net

All at the boot prompts.

I see that it runs a 2.4 kernel which bothers me (2.4.22-uc0-sigma-20051018-nm). When I worked with embedded systems, I saw a few that updated 2.4 kernels to run with their reference boards as opposed to 2.6 kernels.

The EVA8000’s PC software called Digital Entertainer for Windows (DEW) seems to have at least one Windows audio driver which would be nice to learn how to use. I’m pretty sure that is what it is using to play iTunes music.

The DEW software comes with receiver.exe which seems to be what’s used to play things like YouTube videos. This makes me wonder if there are other videos that the DEW software manipulates (re-encodes, or redirects?) prior to going to the EVA8000.

Wireless network drivers

It’s a bit frustrating to see the software upgrade path for wireless
network devices stop. On old versions of Windows it’s easy to see that
the cost of maintaining the wireless network stacks for various
families of cards complicates things. On Linux, it’s easy to see the
problem is time and motivation. Now that there’s a standard wireless
stack on Windows Vista, and Linux, I hope that I can do things like
setup a Wireless Access Point, mesh network, etc. all with just a
software update and some configuration. I’ll have to be careful about
making sure my next devices work with the new standard wireless network stacks.

Mass storage

Now that I’m doing more with video, and I’m actively backing up many of the computers that I have, I’d like to get more storage. I evaluated
getting more drives, getting a Network Attached Storage (NAS) device
like the D-Link DNS-321, but for the cost, I think I should look at
online storage. I’ll likely still need a few extra drives, but not the
high capacity I was looking at.

I’ve decided that for home applications, I don’t need a RAID array. The
costs of maintaining the drives, the controller etc. is extremely high. I
seem to currently get all the relevant benefits with Bacula backups
plus the bonus of a long retention period.

Optical media (e.g. DVD’s) and other “removable” media seem to have a
very high time cost. They also require manual intervention on a regular
basis. Reloading any data requires finding the media and inserting it
which often doesn’t feel worth while for just verification.
Additionally, one should periodically do full backups and manage the
removal of old backups (AKA retention). Thus the removable media method of backup does not seem suitable for backups. Optical media seems less useful for movies too except that it’s so cheap.

I’ve been trying to think of the common modes of failure to help come up of ways of recovering from future failures. Most of my past failures
have been due to hardware problems, though a few seem like they may have been software triggered. Software for managing files like NTFS and ext3 seem to be a lot more reliable as are the OS’s that run the software. Hard drives are also more reliable with various SMART and related features. CD-R’s however have become less reliable from what I’ve read.

Power supply related failures causing hard drive failure has happened to me a few times. Drives failing to work after long periods of
inactivity… Most failures have resulted in the loss of an entire data

Some of the online data storage have a 1GB file size limit. This is
probably to prevent the storage of large amounts of data. The easy work around for me is to set bacula to 1GB volumes.

Drew Scott Daniels’ resume: http://www.boxheap.net/ddaniels/resume.html
Originally from: http://www.boxheap.net/ddaniels/notes/20090101.html

Powered by WordPress