From nobody@FreeBSD.org  Mon Jun 18 20:03:22 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E501B16A46E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jun 2007 20:03:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id D451813C4C1
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jun 2007 20:03:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5IK3MQt044831
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jun 2007 20:03:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l5IK3MD5044830;
	Mon, 18 Jun 2007 20:03:22 GMT
	(envelope-from nobody)
Message-Id: <200706182003.l5IK3MD5044830@www.freebsd.org>
Date: Mon, 18 Jun 2007 20:03:22 GMT
From: Bernard Steiner <fbsd-send-pr@anydomain.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: unable to access 1024 sector size storage
X-Send-Pr-Version: www-3.0

>Number:         113837
>Category:       kern
>Synopsis:       [geom] unable to access 1024 sector size storage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-geom
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 18 20:10:02 GMT 2007
>Closed-Date:    
>Last-Modified:  Wed Jun 27 23:00:07 GMT 2007
>Originator:     Bernard Steiner
>Release:        6.2-STABLE
>Organization:
n/a
>Environment:
FreeBSD grimma 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Jun 10 15:45:01 CEST 2007     root@grimma:/mnt/usr2/obj/mnt/usr2/src/sys/GRIMMA  i386

>Description:
kernel refuses to handle 2GB secure digital cards correctly.
2GB (transcend 150x, fwiw) inserted into SD slot in 4-slot card reader;
attaching card reader yields:

umass0: SMSC 223 USB97C223, rev 2.00/1.95, addr 3
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SMSC 223 U HS-CF 1.95> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
da1 at umass-sim0 bus 0 target 0 lun 1
da1: <SMSC 223 U HS-MS 1.95> Removable Direct Access SCSI-0 device 
da1: 40.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
da2 at umass-sim0 bus 0 target 0 lun 2
da2: <SMSC 223 U HS-SM 1.95> Removable Direct Access SCSI-0 device 
da2: 40.000MB/s transfers
da2: Attempt to query device size failed: NOT READY, Medium not present
da3 at umass-sim0 bus 0 target 0 lun 3
da3: <SMSC 223 U HS-SD/MMC 1.95> Removable Direct Access SCSI-0 device 
da3: 40.000MB/s transfers
da3: 1962MB (2009600 1024 byte sectors: 255H 63S/T 125C)

Note that card is detected correctly as da3 (and also da3s1 pops up in /dev).

Trying to access da3s1 (mount_msdosfs) yields:

g_vfs_done():da3s1[READ(offset=512, length=4096)]error = 22

Also fdisk seems to go through something similar:
# fdisk da3
fdisk: could not detect sector size

# fdisk-linux -b 1024 /dev/da3

Unable to read /dev/da3

The card works fine in the same card reader under WinME (sorry...) and
also works fine in the DigiMate II-plus for copying its contents to
external storage and also works fine in two digital cameras (and, yes,
as 2GB).
>How-To-Repeat:
Plug in said 2GB SD card and try to access it
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-usb 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jun 20 07:13:29 UTC 2007 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113837 
Responsible-Changed-From-To: freebsd-usb->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jun 20 20:14:52 UTC 2007 
Responsible-Changed-Why:  
mjacob suggests this reassignment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113837 

From: Arne "Wrner" <arne_woerner@yahoo.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/113837: [umass] unable to access 1024 sectot size storage
Date: Wed, 20 Jun 2007 13:28:10 -0700 (PDT)

 It looks like msdosfs cannot handle sector sizes different than 512B...
 
 What if u try this:
 1. dd if=/dev/da3 of=/tmp/da3.cpy ibs=1k obs=1m
 2. mdconfig -a -f /tmp/da3.cpy
 3. mount_msdosfs /dev/md0s1 /mnt
 ?
 
 -Arne
 
 
        
 ____________________________________________________________________________________
 Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
 http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

From: Bernard Steiner <fbsd-send-pr@anydomain.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/113837: [geom] unable to access 1024 sector size storage
Date: Thu, 21 Jun 2007 12:32:43 +0200 (MET DST)

 [sorry I goofed up with send-pr; this is my first bug report...]
 
 No, it's not a geom issue.
 Same thing happens with geom disabled.
 Nothing to do with msdosfs, either.
 
 I have since tried the following:
 1) booted into single user without any geom modules; same effect
 2) dd with conv=noerror seems to deliver some data of some sort
    (though not sufficient for a valid file system)
 3) reading 512, 1k, 2k, 4k off da3 fails.
    lseek() to 512, 1024, 1536, 2048 and *then* reading 512, 1k, 2k, 4k
    fails as well.
 
 Bernard

From: "Bernard Steiner" <fbsd-send-pr@anydomain.de>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/113837: [geom] unable to access 1024 sector size storage
Date: Thu, 21 Jun 2007 21:39:19 +0200

 Luckily the WinME machine is a laptop which has a PCMCIA slot and also has a 
 slightly elderly 6.2 pre-release on it.
 So I grabbed hold of a pcmcia (cardbus) SD card reader, inserted card.
 Voila: ad4 at ata2 got detected, ad4 accessible by fdisk, ad4s1 mountable
 msdosfs.
 
 May i humbly suggest that the bug is somewhere in either umass or cam or both.
 
 Bernard
 

From: "Bernard Steiner" <fbsd-send-pr@anydomain.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/113837: [geom] unable to access 1024 sector size storage
Date: Thu, 28 Jun 2007 00:51:15 +0200

 Well... that was pretty fast :-(
 
 Address validator or Nigeran scammer:
 
 > Received: from sun.com (125.84.217.87.dynamic.jazztel.es [87.217.84.125])
 >         by $CENSORED (Postfix) with SMTP id 872F82A674
 >         for $MYADDRESS; Wed, 27 Jun 2007 21:01:09 +0200 (CEST)
 > From: BMW PROMOTION <infobmwpromotoon@aol.com >
 > To: fbsd-send-pr $MYADDRESS
 > Subject: CONGRATULATIONS YOU HAVE WON THE BMW CAR PROMOTION
 > X-MSMail-Priority: Normal
 > Reply-To: BMW PROMOTION <infobmwpromotoon@aol.com >
 
 I'll toss that address and monitor the PR instead.
 Damn spammers.
 
 Anyway... some Linuxen seems to get a little friendlier with the concept of 1024 byte bocks:
 
 $ fdisk -b 1024 /dev/discs/disc4/disc
 You will not be able to write the partition table.
 
 Command (m for help): p
 
 Disk /dev/discs/disc4/disc: 2057 MB, 2057830400 bytes
 53 heads, 52 sectors/track, 729 cylinders
 Units = cylinders of 2756 * 1024 = 2822144 bytes
 
                 Device Boot    Start       End    Blocks   Id  System
 /dev/discs/disc4/part1               1        1459     4018957    6  FAT16
 Partition 1 has different physical/logical beginnings (non-Linux?):
      phys=(0, 3, 55) logical=(0, 4, 36)
 Partition 1 has different physical/logical endings:
      phys=(996, 52, 52) logical=(1458, 18, 16)
 
 I haven't managed to mount the card on the router yet, though.
 Bernard
>Unformatted:
