Subject: Can't mount digital camera
To: None <netbsd-users@netbsd.org>
From: =?ISO-8859-1?Q?St=E9phane?= Witzmann <stephane.witzmann@gmail.com>
List: netbsd-users
Date: 10/31/2005 16:33:55
I've got a digital camera with a USB interface. This device works well with
Linux and Windows, but I couldn't do anything with it on NetBSD. See the
details below.

Here is what the kernel (tested current, 2.1 and 2.0.2) says when the device
is plugged:

umass0 at uhub0 port 2 configuration 1 interface 0
umass0: ZORAN COACH DSC, rev 1.00/1.00, addr 2
umass0: using ATAPI over Bulk-Only
atapibus1 at umass0: 2 targets
sd0 at atapibus1 drive 0: <ZORAN, DIGITAL CAMERA, 1.00> disk removable
sd0(umass0:0:0): readonly device
sd0: drive offline

Then when trying to mount or access it:

# mount /dev/sd0e /mnt
mount: cannot open `/dev/sd0e': Read-only file system

# mount -r /dev/sd0e /mnt
mount: cannot open `/dev/sd0e': Read-only file system

# mount -t msdos /dev/sd0e /mnt
mount_msdos: /dev/sd0e on /mnt: Read-only file system

# mount -r -t msdos /dev/sd0e /mnt
mount_msdos: /dev/sd0e on /mnt: Read-only file system

# mount -o rdonly -t msdos /dev/sd0e /mnt
mount_msdos: /dev/sd0e on /mnt: Read-only file system

# mount
/dev/wd0a on / type ffs (soft dependencies, local)
/dev/wd0e on /home type ffs (soft dependencies, local)
kernfs on /kern type kernfs (local)

# fdisk /dev/sd0
fdisk: /dev/sd0d: Read-only file system

# cat /dev/rsd0d
cat: /dev/rsd0d: Read-only file system

According Linux fdisk there is a partition table, and partition 1 type is
FAT12 :

hub 2-0:1.0: new USB device on port 1, assigned address 2
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: ZORAN     Model: DIGITAL CAMERA    Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 32000 512-byte hdwr sectors (16 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2

root@ttyp0[knoppix]# fdisk /dev/sda

Disk /dev/sda: 16 MB, 16384000 bytes
4 heads, 16 sectors/track, 500 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         472       15083+   1  FAT12
Partition 1 has different physical/logical endings:
     phys=(499, 3, 16) logical=(471, 3, 16)


After copying /dev/sda to a file (mem) then going back to NetBSD:

bash-3.00$ fdisk -r mem
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 77520, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 78140160

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 78140160

Partition table:
0: Primary DOS with 12 bit FAT (sysid 1)
    start 41, size 30167 (15 MB, Cyls 0/0/42-1/224/32), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>


Any clues ? I'd like to try mounting the filesystem from the file (mem) but
I don't know how to do it.


Stéphane Witzmann