From owner-freebsd-usb@FreeBSD.ORG Fri Apr 25 19:09:24 2014 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 595A28D9 for ; Fri, 25 Apr 2014 19:09:24 +0000 (UTC) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD341A9A for ; Fri, 25 Apr 2014 19:09:23 +0000 (UTC) Received: by mail-yk0-f176.google.com with SMTP id 19so3662377ykq.21 for ; Fri, 25 Apr 2014 12:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BuVqHfbBZ4Lj9x0wKwie4kPhRV/mhDv1ifQA0KMkgAY=; b=Vk+UBKZpPJ3sQiEfHmbtvTr7prbeLzT/B3A9q5rR5goAHU8fZIULWe0xQl4Dv60pdR u6pa/8cLTi1TKgsz6nxHtzEnSKzZN7BfvFLtWMBi60r/Nmb9ce20OUxEqOmi4ABObrfI MWz9hmRjJb8TWDNpXQuBkwTLdJnXmnFkx0uL9Zd7odZ/Klp9CFriwN2II4fRJDbeS8kJ GxwtEKndPhIfwHJlTv8skyyJ2urSZdMdqp/EmS8AU3eQhueSwFzPZY//1YcB+BcKNVix SocOM6OyB7NGodEymr74DQ+l8KnINcU0htju5uvIf0W6EA6bdDeddjdnoWcxsbILLzhC zp+A== X-Gm-Message-State: ALoCoQlMVk70SvLYi9nZ6KgA1g94doAsZ28RVh68vyyJPxwMAmJG1jodV631NjNOJBXNWvsOpF5h MIME-Version: 1.0 X-Received: by 10.236.130.37 with SMTP id j25mr5628343yhi.106.1398452957555; Fri, 25 Apr 2014 12:09:17 -0700 (PDT) Received: by 10.170.159.212 with HTTP; Fri, 25 Apr 2014 12:09:17 -0700 (PDT) X-Originating-IP: [67.10.123.128] In-Reply-To: <5353CF78.1080406@selasky.org> References: <5353CF78.1080406@selasky.org> Date: Fri, 25 Apr 2014 14:09:17 -0500 Message-ID: Subject: Re: LBA Error on 128GB Flash Drive From: Wes Morgan To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:09:24 -0000 On Sun, Apr 20, 2014 at 8:45 AM, Hans Petter Selasky wrote: > On 04/20/14 12:54, Wes Morgan wrote: > >> I've got an ADATA 128gb USB3 flash drive ( >> http://www.newegg.com/Product/Product.aspx?Item=N82E16820211819) that is >> giving me LBA errors. It appears that the drive is being mis-identified >> and >> reporting the wrong number of sectors. Camcontrol says the last block >> is 246960127, which I believe to be correct because any attempt to write >> to >> a block after that fails. However, the kernel thinks that the device >> has 247484416 sectors and pretty much everything fails to use the device >> properly because partition tables and filesystems like to store things at >> the end of devices. This is the second one of these I've had and both have >> the same error. My laptop is fairly old and USB2 only, but I've got some >> newer machines with USB3 ports and they have the same problem. Attaching >> the drive to a Linux machine reports the correct number of blocks. >> >> All my FreeBSD machines are running 10-stable. >> >> Camcontrol output: >> [morganw@mercury:~$]: camcontrol readcap da0 >> Last Block: 246960127, Block Length: 512 bytes >> > > Does the device have a bad disk label ? > > gpart show da0 > > vs > > diskinfo da0 > > > --HPS > > Turns out this device reports the wrong capacity with RC16 and needs a cam quirk to disable it. I'll submit a PR.