Benq Digital Camera 1500 on Linux

This USB digital camera implements the mass storage device interface and is recognised by Linux. The mass storage implementation is not fully compliant so a stock 2.4.18 kernel will not allow to mount the device.

The proper solution is to register it as a special device as described in this usenet article and this will probably be done in a future kernel (or is done in a kernel newer than mine).

For people who do not want to update their kernel it is possible to dump the device and mount the filesystem. The content of the device is dumped using cdrecord utilities. First, let's find out the SCSI device number:

# cdrecord -scanbus                       
Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Joerg Schilling
Linux sg driver version: 3.1.22
Using libscg version 'schily-0.5'
scsibus0:
...
scsibus1:
...
scsibus2:
        2,0,0   200) 'BenQ    ' 'DC1500          ' '1.00' Removable Disk
        2,1,0   201) *
...

Now let's dump the whole of device 2,0,0 (8MB in this case) to a file:

#readcd -dev=2,0,0 -f=disk.out

Now we need to find where the FAT partition is. It's likely to be the first sector something other than mostly 0s, and particularly the "FAT12" identifier. Through trial and error I quickly found out that it was the 26th sector for this camera. The tool dd is used to copy sections of a file, and od to display them. Any hex editor would do.

$dd if=disk.out skip=25 count=1 bs=512 | od -ax
0000000   i nul nul   S   U   N   P   L   U   S  sp nul stx dle soh nul
        00e9 5300 4e55 4c50 5355 0020 1002 0001
0000020 stx nul soh   W   =   x etx nul dle nul eot nul  em nul nul nul
        0002 d701 f83d 0003 0010 0004 0019 0000
0000040 nul nul nul nul nul nul   ) nul nul nul nul  sp  sp  sp  sp  sp
        0000 0000 0000 0029 0000 2000 2020 2020
0000060  sp  sp  sp  sp  sp  sp   F   A   T   1   2  sp  sp  sp nul nul
        2020 2020 2020 4146 3154 2032 2020 0000
0000100 nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul
        0000 0000 0000 0000 0000 0000 0000 0000
*
0000760 nul nul nul nul nul nul nul nul nul nul nul nul nul nul   U   *
        0000 0000 0000 0000 0000 0000 0000 aa55

Now we can mount the filesystem through the loopback system, skipping 25*512=12800 bytes to reach the FAT partition:

#mount -o loop,offset=12800 -t vfat disk.out /mnt

Thanks to Piotr Pawlow for his original usenet message describing this process. This document only adds the explanation on how to find the start sector of the FAT partition.


up | last updated 2003-05-01