From owner-freebsd-usb@freebsd.org Sun Dec 1 07:28:07 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 982461C1FEE for ; Sun, 1 Dec 2019 07:28:07 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Qfwk11n1z4Xgp for ; Sun, 1 Dec 2019 07:28:05 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x433.google.com with SMTP id y11so36920129wrt.6 for ; Sat, 30 Nov 2019 23:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=wMlpkJKhQPk+5pMVzIMR8iymxdl1hnZp388Xlh6NZig=; b=I0oXvk5jL131vTVwdC7pvpHAxbSJnPh91nUxhME1GMJDaHuqB5Ze6Qg7wZu1K5hmS5 rFjMcUaxHdikR6OjbLrH2Sx8FsouiX6K6bc8MfKW8sJnJR2R/Ju5XJG4BHahkdAr8HGH x9KT1mhORf+0rDAF6h2muh06bNt6fGTOL8ZWTn7JdYH5s77PYsEscADkLSPYXCJGWPHO rT9sM3aKK6V+02jEtJXE2PEehXpIX9USKXoVHYr8QtyMgojatVGxIKxBsPmyaMHmAzz1 k6xEepzGpO8YTQfqvJsPXCYGswD9bWT8YMRA2J365gp7ZFn5wlkfJKiLK+M7rxawMB1g mJ2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=wMlpkJKhQPk+5pMVzIMR8iymxdl1hnZp388Xlh6NZig=; b=bAgzh2KB9fvBlcGiZ2ni7JYKQv2jnJKoQoPY9CaYoAMfz8ToHGSFJX1EvKvQavaoBq U9/MnG83sF+j11KDqjRWNTN3V6+BxwDgzyOdgo/orfDI4x5HspbYJs3riTJcjoB36vb2 8GabYFMLqsdYQJhFIFcknx3r0C0eMzVEJMF50zbE99kUw6zkwWeYfu14f5CUnOx5J/wJ lwOpS6uPJIpPAuLkNV+0z+tYfUO74SYW32gXtjqx6b6IynZQOXJXy9z1Hxa4WJ+VUXzS umYvIPDqzaubSpKQJA98F3n6JslnylB6IFlKblU8KGF5RN1xbpbo2DcaASSmxPJowKip o6zQ== X-Gm-Message-State: APjAAAX4gi2Xf8xoAEWwbL58rHZTVQTPaDcaU1ZK0rbHvF2UzI9HIr2X httFRw5qM0Z76iE1wvkJIuw= X-Google-Smtp-Source: APXvYqxDxKqIiqfm8SbyGmLs3Eil1HLBeRX9JHEva0OZGMvGQt8nOYsFlAJw7B0JUe/6RqCaCTNTJw== X-Received: by 2002:a5d:4481:: with SMTP id j1mr196718wrq.348.1575185282484; Sat, 30 Nov 2019 23:28:02 -0800 (PST) Received: from ernst.home (pD9E239E8.dip0.t-ipconnect.de. [217.226.57.232]) by smtp.gmail.com with ESMTPSA id a64sm21571228wmc.18.2019.11.30.23.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 23:28:01 -0800 (PST) Date: Sun, 1 Dec 2019 08:28:01 +0100 From: Gary Jennejohn To: Tomasz CEDRO Cc: Anatoly , Polytropon , "freebsd-usb@FreeBSD.org" Subject: Re: pendrive clone impossible ? Message-ID: <20191201082801.6a8c7639@ernst.home> In-Reply-To: References: <20191130223322.1028feab.freebsd@edvax.de> <20191130234900.81464b43.freebsd@edvax.de> <20191201050341.4a02879a@asd2> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47Qfwk11n1z4Xgp X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=I0oXvk5j; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[232.57.226.217.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-9.10), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.94), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Dec 2019 07:28:07 -0000 On Sun, 1 Dec 2019 03:52:50 +0100 Tomasz CEDRO wrote: > On Sun, Dec 1, 2019 at 3:03 AM Anatoly wrote: > > I've had a problem in the past with one of the first 32GB pendrives. > > Not quite similar problem, but may it be buggy RAM cache > > implementation too? What if: > > - Write sector(s) > > - usbconfig -d . power_off > > - usbconfig -d . power_on > > - Read and compare. > > > > As you saying some writes was succeful, some not. May it > > depend not on source of that bytes or their content, but on time passed > > between write and read? > > > > It turns out that Transcend pendrive I've got in 2010 had RAM cache > > (didn't remember exact cache size I measured out, as I remember > > something around 128K-512K), and all writes was cached. This amazingly > > speeds up random R/W fs operations in comparation with similar > > pendrives of those years, but I constantly losing the data and getting > > fs corrupted when used it with OSes that do not "power_off" or > > "suspend" that drive before I pull of it out of the socket. > > The first pendrive is physically smaller Kingston slower and more > expensive. The second Kingston (the one with write problems) is > physically bigger 30% cheaper and a bit faster (50% read, 10% write, > but not as advertised 2x read, 4x write). If its cheaper and faster > then Kingston is bullshitting their clients. Also one of their workers > admitted that they have various vendors of flash controllers and > different firmware among them. so their products looks more like a > lottery. Not cool. > > Thank you Anatoly! It looks then like a pendrive faulty tricky design > to fool users with exaggerated read/w/rite speeds. > The geom code protects certain parts of the data area on the drive, in particular GPT/MBR areas, unless ``sysctl kern.geom.debugflags=16'' is run beforehand. One can see this in many places in the geom code. I always set this sysctl when I know I'm going to overwrite the first sectors of a drive. -- Gary Jennejohn