Subject: Re: 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 23:08:54
Stéphane Witzmann wrote:

> 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

Thanks to Chavdar Ivanov who provided some help.

Mounting the memory image with vnd worked. Below is what the kernel says
about another digital camera :

umass0 at uhub0 port 1 configuration 1 interface 0
umass0: ViewQuest Technologies Inc. 1.3M DigitalCAM, rev 1.00/1.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <, 1.3M DigitalCAM, 1.00> disk removable
sd0: fabricating a geometry
sd0: 121 MB, 121 cyl, 64 head, 32 sec, 512 bytes/sect x 247808 sectors

The difference is that mine attaches to atapibus, and this one to scsibus
(as my usb stick does). Why ?

Stéphane Witzmann