From owner-freebsd-questions@freebsd.org  Sat Nov 30 22:28:21 2019
Return-Path: <owner-freebsd-questions@freebsd.org>
Delivered-To: freebsd-questions@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 DBCED1BA933
 for <freebsd-questions@mailman.nyi.freebsd.org>;
 Sat, 30 Nov 2019 22:28:21 +0000 (UTC)
 (envelope-from tomek@cedro.info)
Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com
 [IPv6:2607:f8b0:4864:20::229])
 (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 47QQxw5KbYz4bxp
 for <freebsd-questions@freebsd.org>; Sat, 30 Nov 2019 22:28:20 +0000 (UTC)
 (envelope-from tomek@cedro.info)
Received: by mail-oi1-x229.google.com with SMTP id d62so4189068oia.11
 for <freebsd-questions@freebsd.org>; Sat, 30 Nov 2019 14:28:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=s23lRGmV1sbVGegu0t3aaLPUA5tCpExxgqLKXGcNxhU=;
 b=Hw01PlfuJzWUrhLQLcvFXv1Qi9jqp48jsvL7ThRppVyUOhkqWS/YYSZb8NKJQ/NbfX
 sFH/uujhCwB+HwW1Mkv6n9vGzgufhYFl35yJ62hm9HREqMyimtwPSd9PbKHBRUCp78lz
 9NnxFcUEb4r9iwlhUat/SYjF4gg8+WBldDvtiO6DGzHKP0CNROQlvruCBTwdsTWn03ZV
 SOyEQz486Q+gYHuKvlv6Ocb5nM2ShXPIG1z971vAaqMv9Uo1ng7CMNk+0Hfkv3uAx1mS
 BwLGhKPetKXrEWsF7N0mqRl68aYnOo/uv1D4a7ufMzG87xdkW0BrZWlooqlUqN0JmbuT
 sC5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=s23lRGmV1sbVGegu0t3aaLPUA5tCpExxgqLKXGcNxhU=;
 b=Qq3aokqr49aXnjle3pyoeghwNX6IsL9ghp5i5r45KadCUugAvQ/dLzKqyXhr632Kqp
 z+zJmKknksepZmZdf5HV53hWE2Mz2vy3AfBf7p3A/6aoX7hqpvtJoOYexNt4mRtITCmp
 FCTg+stBlSieF21UEm0BBkA8dIOX5j4WFdvu0NFdGkYGvJF7RqAKz3q456jCPvskq4t8
 ZWXnEAO+7YbJjRPPI68SBWt6ub15Zfwmy4UvELL+nEkGFYfTs71z1BVVI3mPPeonF+kW
 fvjeg/epdqP3q7G4Uk/xgskCJMjTbP2PWHdw6VbeDAUY6KBcuicAURQRzxWjH4ZCsOZb
 PY0Q==
X-Gm-Message-State: APjAAAVxgydOJzSC0bEand0F7d5mixwpMgv87NQlZPgzGsF/zOjNyMuk
 v3smWT6JKhKj3eksnxgJlIP3Mb2rak4=
X-Google-Smtp-Source: APXvYqzBgYoTz5Hkm7+9L04lLAWkXzx2Iehs6aa7tSnj4LDKLWdjta//9FhXSYyBDTfD/FADx14MZw==
X-Received: by 2002:aca:3889:: with SMTP id f131mr18131811oia.14.1575152899032; 
 Sat, 30 Nov 2019 14:28:19 -0800 (PST)
Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com.
 [209.85.167.180])
 by smtp.gmail.com with ESMTPSA id e25sm8852388otr.53.2019.11.30.14.28.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 30 Nov 2019 14:28:18 -0800 (PST)
Received: by mail-oi1-f180.google.com with SMTP id a67so10308700oib.6;
 Sat, 30 Nov 2019 14:28:17 -0800 (PST)
X-Received: by 2002:aca:39d4:: with SMTP id g203mr6864149oia.78.1575152897319; 
 Sat, 30 Nov 2019 14:28:17 -0800 (PST)
MIME-Version: 1.0
References: <CAFYkXjkHobPfNwCL3ssL98TgUjE=jvojXACH+iR0EV-tzK-pxA@mail.gmail.com>
 <20191130223322.1028feab.freebsd@edvax.de>
In-Reply-To: <20191130223322.1028feab.freebsd@edvax.de>
From: Tomasz CEDRO <tomek@cedro.info>
Date: Sat, 30 Nov 2019 23:28:04 +0100
X-Gmail-Original-Message-ID: <CAFYkXjk3HOmfXkd=L2CYpbV9=YmzP_dP1RxS37D817iW_Bqftg@mail.gmail.com>
Message-ID: <CAFYkXjk3HOmfXkd=L2CYpbV9=YmzP_dP1RxS37D817iW_Bqftg@mail.gmail.com>
Subject: Re: pendrive clone impossible ?
To: Polytropon <freebsd@edvax.de>
Cc: FreeBSD Questions Mailing List <freebsd-questions@freebsd.org>, 
 "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org>
Content-Type: text/plain; charset="UTF-8"
X-Rspamd-Queue-Id: 47QQxw5KbYz4bxp
X-Spamd-Bar: ---
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=cedro.info header.s=google header.b=Hw01Plfu;
 dmarc=none;
 spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when
 checking 2607:f8b0:4864:20::229) smtp.mailfrom=tomek@cedro.info
X-Spamd-Result: default: False [-3.82 / 15.00]; ARC_NA(0.00)[];
 TO_DN_EQ_ADDR_SOME(0.00)[];
 R_DKIM_ALLOW(-0.20)[cedro.info:s=google];
 RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain];
 PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org];
 DMARC_NA(0.00)[cedro.info]; RCVD_COUNT_THREE(0.00)[4];
 TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+];
 RCVD_IN_DNSWL_NONE(0.00)[9.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org
 : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[];
 SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+];
 ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
 RCVD_TLS_ALL(0.00)[];
 IP_SCORE(-2.52)[ip: (-8.38), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94),
 country: US(-0.05)]
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/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: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Nov 2019 22:28:21 -0000

It looks like either GEOM is hiding something from application/me, or
pendrive itself is preventing MBR to be modified, or some sort of
mix..?

I guess the first is more probable because DD'ing from /dev/md0,
/dev/zero, /dev/random devices always works, while DD'ing from da0.mbr
file never works. If pendrive was defending itself none of them would
be possible, right?

The Source pendrive was MBR. This is why I did /dev/zero -> /dev/da1
just to make sure there is no GPT of any sort on the Target pendrive,
nor MBR, also I could see where write was skipped.

This is the first time ever dd if=/dev/da0 of=/dev/da1 did NOT copy
the entire drive (the da1 attached GEOM noted inegrity checked MBR was
left blank the rest seems to be there). DD reported NO ERROR.. in fact
I got a standard summary on transferred bytes as operation was
completed successfully. I did not count all bytes transferred because
I never had to before. Is the OS hiding something from me? And from
DD? Is Penrdive messing with the GEOM / OS?

Because I need to finish quickly, I have used GPART to create and add
partitions by hand and I am DD'ing partition by partition. So far so
good.

The Target pendrive is Kingston 128GB DTSE9 G2 USB3.0. Be careful with
that fellow!

Below is a Kingston's response cut-and-paste found on a forum where
another folk tried to install bootable system on a 32GB DTSE9 G2 ;-)

"
The first thing to point out is that a USB drive needs to be set as a
fixed drive which requires a tweak in the firmware, commonly refereed
to as "flipping the RMB". Not every firmware is suitable for such an
operation and since we use different flash controller providers to
meet the supply and demand for our products, we cannot check the
suitability of every firmware to be altered to accomodate booting from
USB.

Furthermore a standard USB drive is designed for sequential read and
writes, rather than random read and write speeds.

Booting from the USB will be very slow and will be a detriment to the
product, affectively its longevity.

Therefore we cannot guarantee the longevity and reliability of the
drive within the warranty period, and could offer no further support
in case of a drive failure.

This is the reason why we at Kingston do not support the bootability
of our commodity USB products.

If you purchased the DTSE9G2/32GB to be used specifically for this
purpose, we can only recommend that you return it to your supplier for
a refund and we apologise for any inconvenience this may cause.
"

WELL, KINGSTON LOOKS LIKE A LOTTERY AND I FEEL LIKE A WINNER! ;-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info