Mounting a raw dump (using dd and losetup)

I’ve just picked up a DT Research WebDT366 Tablet. I’m in need of a good touchscreen for a CarPC project, and the Lilliputs are a little more expensive than I had hoped to go (Appx, $250.00 on Ebay).

First boot (I'm finishing up the Gentoo Linux Image)
First boot (I'm finishing up the Gentoo Linux Image)

The WebDT366 was only $90 (in fairly good condition), and I figured if I didn’t end up using it for a CarPC (or as simply the touchscreen for the CarPC), I could certainly find something else to do w/ it.

tschak909 has already done a good amount of work getting Linux to run on the device. (http://forum.linuxmce.org/index.php?topic=6663.0). Thankfully it’s x86, so life should be a little easier when building custom images.

Wanting to know what packages and configuration Thom has used in his installation, I needed a way to mount the raw disk image (http://www.localeconcept.com/private/webpad-beta2.dd.bz2). Googling didn’t get me at the exact answer, but it got me close enough to figure it out.

First off, use losetup and and offset (flagged by -o).  When running “file” on the image, you’ll see something like this:

lennybruce ~ # file /tmp/webpad-beta2.dd
/tmp/webpad-beta2.dd: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 1023057 sectors

As you can see, partition one starts at sector 63. (512 bytes * 63 = 32256). Having this information, mounting is easy:

lennybruce ~ # losetup -o 32256 /dev/loop0 /tmp/webpad-beta2.dd
lennybruce ~ # mount /dev/loop0 /mnt/loop
lennybruce ~ # ls /mnt/loop/
bin   cdrom  etc   initrd      lib         media  opt   root  selinux  sys   tmp  var
boot  dev    home  initrd.img  lost+found  mnt    proc  sbin  srv      temp  usr  vmlinuz
lennybruce ~ #

That’s it for mounting a raw disk image. Using the information Thom has provided in his image (video driver, input drivers, etc)… I’m building a custom Gentoo image that will hopefully be the basis or front-end of a CarPC.