Subject: Re: USB memory reporting "fabricating a geometry"
To: None <port-i386@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: port-i386
Date: 09/02/2005 10:33:30
On Thu, 01 Sep 2005, Claes Leufven wrote:
> umass0 at uhub3 port 4 configuration 1 interface 0
> umass0: COWON iAUDIO 5, rev 2.00/1.10, addr 2
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, 1 lun per target
> sd0 at scsibus0 target 0 lun 0: <COWON, iAUDIO 5, 0100> disk removable
> sd0: fabricating a geometry
> sd0: 993 MB, 993 cyl, 64 head, 32 sec, 512 bytes/sect x 2035200 sectors

That looks fine so far.  I don't think "fabricating a geometry" is
an error.

> And the disklabel for sd0 looks like this
> 
> #        size    offset     fstype [fsize bsize cpg/sgs]
>  d:   2035200         0     unused      0     0   # (Cyl. 0 - 993*)
>  e:   2035147        53      MSDOS                # (Cyl. 0*- 993*)

What does "fdisk sd0" say?

Some USB memory sticks have an MBR in sector 0 (just like an MSDOS hard
disk), and a partition table that points to a FAT filesystem that starts
in some sector > 0 (often sector 63).  Other USB memory sticks don't
have an MBR at all, and have a FAT filestem starting in sector 0 (just
like an MSDOS floppy disk).

If the FAT filesystem starts in sector 0, then fdisk tries to interpret
some random data from sector 0 as if it was an MBR partition table, and
gets confused. disklabel might also get confused (I don't remember).
However, you should be able to mount the raw partition (/dev/sd0d in
your case).  I usually end up reformatting the device with an MBR (using
fdisk, disklabel, newfs_msdos).

--apb (Alan Barrett)