From owner-freebsd-questions@FreeBSD.ORG  Thu May 31 18:49:52 2012
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2ADD106566C
	for <questions@freebsd.org>; Thu, 31 May 2012 18:49:52 +0000 (UTC)
	(envelope-from freebsd@dreamchaser.org)
Received: from nightmare.dreamchaser.org (nightmare.dreamchaser.org
	[12.32.44.142]) by mx1.freebsd.org (Postfix) with ESMTP id 7126B8FC12
	for <questions@freebsd.org>; Thu, 31 May 2012 18:49:52 +0000 (UTC)
Received: from breakaway.dreamchaser.org (breakaway.dreamchaser.org.
	[12.32.36.73])
	by nightmare.dreamchaser.org (8.13.6/8.13.6) with ESMTP id
	q4VInpn5047250; Thu, 31 May 2012 12:49:51 -0600 (MDT)
	(envelope-from freebsd@dreamchaser.org)
Message-ID: <4FC7BD4F.20202@dreamchaser.org>
Date: Thu, 31 May 2012 12:49:51 -0600
From: Gary Aitken <freebsd@dreamchaser.org>
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
	rv:12.0) Gecko/20120528 Thunderbird/12.0.1
MIME-Version: 1.0
To: Jens Schweikhardt <schweikh@schweikhardt.net>
References: <20120531155704.GA2828@schweikhardt.net>
In-Reply-To: <20120531155704.GA2828@schweikhardt.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2
	(nightmare.dreamchaser.org [12.32.36.65]);
	Thu, 31 May 2012 12:49:51 -0600 (MDT)
Cc: questions@freebsd.org
Subject: Re: How to use an external USB3.0 drive with 4k sectors?
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: freebsd@dreamchaser.org
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 31 May 2012 18:49:52 -0000

On 05/31/12 09:57, Jens Schweikhardt wrote:

> so I decided to try two HW technology advancements in one go.
> I have a brand new shiny 1TB USB3.0 external disk, that when plugged
> to an USB2(two!) reports
> 
>      da5 at umass-sim2 bus 2 scbus6 target 0 lun 0
>      da5:<ST1000LM 024 HN-M101MBB 0000>  Fixed Direct Access SCSI-2 device
>      da5: 40.000MB/s transfers
>      da5: 953869MB (244190646 4096 byte sectors: 255H 63S/T 15200C)
> 
> and
> # diskinfo -v da5
> da5
>          4096            # sectorsize
>          1000204886016   # mediasize in bytes (931G)
>          244190646       # mediasize in sectors
>          0               # stripesize
>          0               # stripeoffset
>          15200           # Cylinders according to firmware.
>          255             # Heads according to firmware.
>          63              # Sectors according to firmware.
>          00A123456789    # Disk ident.
> 
> 
> (The vendor, Jmicron, has put an NTFS on it, with a disk manual as a pdf file.
> Strangely, I cannot mount it with
> # ll /dev/da5*
> crw-r-----  1 root  operator    0, 236 May 31 15:05 /dev/da5
> crw-r-----  1 root  operator    0, 237 May 31 15:05 /dev/da5s1
> # mount -t ntfs -o ro /dev/da5s1  /mnt
> mount_ntfs: /dev/da5s1: Invalid argument
> )
> 
> When I plug it to one of the two USB3.0 ports (using the xhci driver), I
> don't get device nodes in /dev created for it, but instead an ever
> growing list of
> 
>      ugen4.2:<Jmicron Corp.>  at usbus4
>      umass2:<Jmicron Corp. Usb production, class 0/0, rev 2.10/1.00, addr 1>  on usbus4
>      ugen4.2:<Jmicron Corp.>  at usbus4 (disconnected)
>      umass2: at uhub4, port 4, addr 1 (disconnected)
> 
> The USB3.0 ports otherwise work fine with a 16BG USB3.0 Stick. Windows 7
> can use the disk as well on the USB3.0 port, which makes me look for
> things I have missed. For example, my kernel config is stripped down
> quite a bit, so it might be that my custom kernel does not have all the
> necessary drivers built in or kldloaded. Do I need "device ada"? What is
> the magic needed to hook up 4k secotr drives via USB3.0?

According to the handbook you need all of the following drivers:

  scbus da pass uhci ohci ehci usb umass

Don't know if this helps, but 512K sectorsize on usb 3 seems to work fine here:

%diskinfo -v da0
da0
        512             # sectorsize
        1500301909504   # mediasize in bytes (1.4T)
        2930277167      # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        182401          # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        NA05EA2N        # Disk ident.

dmesg:

ugen0.2: <Seagate> at usbus0
umass0: <Seagate FreeAgent GoFlex, class 0/0, rev 3.00/1.00, addr 1> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:8:0:-1: Attached to scbus8
da0 at umass-sim0 bus 0 scbus8 target 0 lun 0
da0: <Seagate FreeAgent GoFlex 211> Fixed Direct Access SCSI-0 device 
da0: 400.000MB/s transfers
da0: 1430799MB (2930277167 512 byte sectors: 255H 63S/T 182401C)

Plugging it in adds only da0, da0s1, and ugen0.2 to /dev

My disk is bigger than what you're dealing with but not the big sector size; 
can't say about that difference.

Gary