From owner-freebsd-geom@freebsd.org Sat Apr 22 19:38:20 2017 Return-Path: Delivered-To: freebsd-geom@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D3FD4B8BE for ; Sat, 22 Apr 2017 19:38:20 +0000 (UTC) (envelope-from leeb@ratnaling.org) Received: from mail-vk0-x22b.google.com (mail-vk0-x22b.google.com [IPv6:2607:f8b0:400c:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB9548B4 for ; Sat, 22 Apr 2017 19:38:20 +0000 (UTC) (envelope-from leeb@ratnaling.org) Received: by mail-vk0-x22b.google.com with SMTP id 198so3041117vkk.2 for ; Sat, 22 Apr 2017 12:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ratnaling-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pLVNRh4K2LDpNOwrVKN4ZSDykp21aAwiYjYBjVldOx4=; b=luNV/sNwqqtBqVXuzuuXLE2CHcpKQYPTMY6esY+Eb1VI5NgOm+D64iQhP386GB0CFC UBGQ55F/BMsZhQMhtNN0IMB9UstWi4rVuswJR/u73I++9KuOnbuSvzp0jfG+PrkJijux uUKv+ICjmZ62Z4s8Sr6R0b+EqD8XFra/UNq/uF5FF+DZCPLbw5WAb+PozBr5TZonOuW3 B0iXCbUuCNxO9OpX9BSq+6JBgJ0MJU+g+ZoTrUH/XK3mfn14LqAqkeBrQg4stnz8YgEe DNaJV01tEZ0zYEdjkkCLl7rn7QD0RBaURzvgseqHkjs5f2tMkHker884ouJASDzamxrj t2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pLVNRh4K2LDpNOwrVKN4ZSDykp21aAwiYjYBjVldOx4=; b=MrPod9ZKS1Axj3u36HbgmKuyBVCF7igTscy84/6rkAud/74la5pqLwe3JLSir1ipKA iL+w+Law9vZx0yF0O+DbmdM53EqrM7pVjsD34n0oOdbIPBfC9InQCD/unJLG3xjpE7gN q7vlSMwqNvI0bpN6Jl8Mq72wsvIkHC4Xv8FnihxEd04V1K/ryBPvB7yI6etEtM/ROqN+ YWtXro+B+xMdPH0489jPc6oqLB+N4Vx3qe3RDW+5emcoLhjvFNgoh2ecY832x7LStxOw N2/9iWG7IFBKPjQS+QLQ5qo8i+l4Pfra1M31tTC9mP9pI7/vBjpEfiXljraLm8C5F3pW d7aQ== X-Gm-Message-State: AN3rC/5e0aV3Du9cxQVrZk2THajzv8AXOubFbq+i6FFX95U7mIh8PyEA sRdPz1gcKpdl/GAOkLIx2dGBeD75aQ== X-Received: by 10.31.60.65 with SMTP id j62mr1033744vka.25.1492889899597; Sat, 22 Apr 2017 12:38:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.92.133 with HTTP; Sat, 22 Apr 2017 12:38:19 -0700 (PDT) In-Reply-To: <58FBAAE7.9090508@quip.cz> References: <58FABB3A.6040704@quip.cz> <58FBAAE7.9090508@quip.cz> From: Lee Brown Date: Sat, 22 Apr 2017 12:38:19 -0700 Message-ID: Subject: Re: glabel problem To: Miroslav Lachman <000.fbsd@quip.cz> Cc: freebsd-geom@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2017 19:38:21 -0000 On Sat, Apr 22, 2017 at 12:11 PM, Miroslav Lachman <000.fbsd@quip.cz> wrote: > Lee Brown wrote on 2017/04/22 21:02: > >> >> >> On Fri, Apr 21, 2017 at 7:08 PM, Miroslav Lachman <000.fbsd@quip.cz >> > wrote: >> >> Lee Brown wrote on 2017/04/22 03:26: >> >> [..] >> >> root@apron:~ # glabel label -v TEST da2 >> Metadata value stored on da2. >> Done. >> >> but >> root@apron:~ # glabel status da2 >> root@apron:~ # >> >> >> Did you tried to disconnect and reconnect after "glabel label". >> Sometimes label is not visible until retaste of the device (true > >> /dev/da2) >> >> Yes, I also tried a usb power-off/on cycle. >> >> >> I zero'd the first and last 1MB and re-tried the label >> operation, but all >> the sectors were still zero. >> I tried to use the usbdump utility and I can see *something* is >> written. >> >> gpart appears to do the right thing. >> newfs on the raw device appears to do the right thing. >> geli init complains it can't find the metadata. >> >> >> What about partitioning by gpart GPT with gpt partition label and >> then use this label for geli instead of whole device? >> >> geli complains in the same way, this is what I tried: >> root@apron:~ # dd if=/dev/zero of=/dev/da2 bs=1m count=1 >> 1+0 records in >> 1+0 records out >> 1048576 bytes transferred in 0.124755 secs (8405050 bytes/sec) >> >> root@apron:~ # dd if=/dev/zero of=/dev/da2 bs=1m oseek=1023999 >> dd: /dev/da2: end of device >> 2+0 records in >> 1+0 records out >> 1048576 bytes transferred in 0.039043 secs (26856688 bytes/sec) >> >> root@apron:~ # gpart create -s GPT da2 >> da2 created >> root@apron:~ # gpart add -t freebsd-ufs -a 4k -l test da2 >> da2p1 added >> >> root@apron:~ # glabel status >> Name Status Components >> gpt/test N/A da2p1 >> gptid/292e8661-2789-11e7-af35-001ec944dcb4 N/A da2p1 >> >> root@apron:~ # geli init -a HMAC/SHA256 -J /root/empty-password -K >> /root/geli.CANI-RL.key -s 4096 gpt/test >> geli: Unable to read metadata from gpt/test: Invalid argument. >> >> I tried with and without /dev prefix, with and without -s 4096 and even >> da2p1 which all gave me the same message. >> >> Other info: >> ugen3.2: at usbus3, cfg=0 md=HOST >> spd=HIGH (480Mbps) pwr=ON (100mA) >> >> Now: >> root@apron:~ # gpart show da2 >> => 40 2097151920 da2 GPT (1.0T) >> 40 2097151912 1 freebsd-ufs (1.0T) >> 2097151952 8 - free - (4.0K) >> root@apron:~ # usbconfig -d 3.2 power_off >> root@apron:~ # usbconfig -d 3.2 power_on >> >> root@apron:~ # gpart show da2 >> => 40 2097151920 da2 GPT (1.0T) [CORRUPT] >> 40 2097151912 1 freebsd-ufs (1.0T) >> 2097151952 8 - free - (4.0K) >> >> root@apron:~ # dd if=/dev/da2 iseek=1023999 bs=1m | od -ha >> 0000000 0000 0000 0000 0000 0000 0000 0000 0000 >> nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul >> * >> 4000000 >> 1+0 records in >> 1+0 records out >> 1048576 bytes transferred in 0.049774 secs (21066694 bytes/sec) >> >> Could the device simply be faulty? It's quite slow, it'll take 28hrs to >> wipe it, so I filled the last 2mb and 1gb with random >> >> root@apron:~ # dd if=/dev/random of=/dev/da2 bs=1m oseek=1023998 >> dd: /dev/da2: end of device >> 3+0 records in >> 2+0 records out >> 2097152 bytes transferred in 0.111204 secs (18858633 bytes/sec) >> root@apron:~ # dd if=/dev/da2 iseek=1023998 bs=1m | od -ha >> 0000000 0000 0000 0000 0000 0000 0000 0000 0000 >> nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul >> * >> 10000000 >> 2+0 records in >> 2+0 records out >> 2097152 bytes transferred in 0.098105 secs (21376560 bytes/sec) >> >> root@apron:~ # dd if=/dev/random of=/dev/da2 bs=1m oseek=1023000 >> dd: /dev/da2: end of device >> 1001+0 records in >> 1000+0 records out >> 1048576000 bytes transferred in 51.457299 secs (20377595 bytes/sec) >> root@apron:~ # dd if=/dev/da2 iseek=1023000 bs=1m | od -ha >> 0000000 0000 0000 0000 0000 0000 0000 0000 0000 >> nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul >> * >> 1000+0 records in >> 1000+0 records out >> 1048576000 bytes transferred in 49.336478 secs (21253564 bytes/sec) >> 7640000000 >> >> It looks like it's just not writing beyond a certain point. >> >> Thanks for helping, this is really strange. >> > > This is really strange. It seems faulty to me. > > There are other things you can try: > 1) try to create gpt partition of a small size - about 4GB a test geli on > it. If it works then try to destroy this partition and create it again but > big, about 10MB smaller than the device size (maybe there is some problem > at the end of the device) > > 2) if it is not working with geli, try it with simple gpart GPT + newfs > UFS or with ZFS. Once you have ZFS on it, you can put some files on it and > then run zfs scrub - if device is faulty there should be some checksum > errors in zpool status output. > > Miroslav Lachman > Thanks for that tip. 4GB worked and after some chopping I found over 8GB failed. Therefore I believe I've purchased an 8GB flash disk that's been engineered to report 1TB. I very much appreciate your help Miroslav -- lee