delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/09/23/04:21:58

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAE52385770A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1695457316;
bh=7No74aCsLQ/i+elbz/Ab3HsZQbBobtoLlXD/7lnaukA=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=dKnz+PEUROvDRLrvo589t2zoS3B57eMcJ3Z6O6zUim5QIenzjBSqmpqlekoYQdraR
3YDnJrWtF8OsFU1aa1GM2AlzYiY7nyUt7YDWqkALvtgUSbWptPj8oqRGYXmncLlbQQ
Yj+x/TI8oTj2LtvDlRLrBH9Ieu5ZJW5B3E/Hax30=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1C6F3858C30
Subject: Re: /usr/bin/dd *.iso to USB stick?
To: cygwin AT cygwin DOT com
References: <CANH4o6O5eijgsjD_VsRDtZkRDZARONzfyfN2NdiKq3qkNeBv=Q AT mail DOT gmail DOT com>
<c8593576-f08e-41fb-ad2e-abf9682f5b90 AT jhmg DOT net>
Message-ID: <6f3e6584-d435-b084-dbc3-f130c259b026@t-online.de>
Date: Sat, 23 Sep 2023 10:21:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
SeaMonkey/2.53.16
MIME-Version: 1.0
In-Reply-To: <c8593576-f08e-41fb-ad2e-abf9682f5b90@jhmg.net>
X-TOI-EXPURGATEID: 150726::1695457262-E1583FD5-896C7060/0/0 CLEAN NORMAL
X-TOI-MSGID: 9b43c4cb-4308-4343-b97b-23f6c1e03041
X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM,
KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Christian Franke via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Christian Franke <Christian DOT Franke AT t-online DOT de>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 38N8Lv5W002122

Jim Garrison via Cygwin wrote:
> On 9/21/2023 22:40, Martin Wege via Cygwin wrote:
>> Hello,
>>
>> How can I use /usr/bin/dd to copy a *.iso image (Debian netinstall
>> boot image) to a USB stick as raw bytes?
>
> I do this frequently.  You must start the Cygwin shell with admin
> rights, then use Windows Disk Management mmc app to identify
> the disk and convert from Disk n to /dev/sd[x], where Disk 0 is
> /dev/sda, Disk 1 is /dev/sdb, etc.
>
> BIG CAVEAT: You're in admin mode.  Use the wrong device name and you
> will trash target device if it's writable, including your Windows boot
> drive.  And no, the boot drive is not always Disk0 /dev/sda.
>
> I always use hexedit to examine enough of the target device to assure
> myself that it's the correct target.

This is much easier if 'ddrescue --ask' is used instead of 'dd' 
(https://cygwin.com/packages/summary/ddrescue.html). It prints device 
size, identify string and serial "number" string if available and asks 
for confirmation then:

# ddrescue --ask --force image.iso /dev/sde
GNU ddrescue 1.27
About to copy 4671 MBytes
from 'image.iso' (4_562_040Ki)
   to '/dev/sde' [Kingston DataTraveler 3.0::EE03D85142E0] (14_784Mi)
Proceed (y/N)? y
...

Device identity is also printed if the destination is a partition 
(/dev/sde1) on that device. The --force (-f) option is required if the 
destination is not a regular file. Note that for (S)ATA devices, the 
serial may be printed in the unusual LE word string byte order from ATA 
IDENTIFY data. This is a minor bug in some layer behind 
IOCTL_STORAGE_QUERY_PROPERTY.

ddrescue also works with some /proc/sys block devices as source, for 
example /proc/sys/Device/HarddiskVolumeShadowCopy2 or 
/proc/sys/Device/VeraCryptVolumeF  It could also be run from the limited 
WinPE environment, for example to create an image of C: if not booted.

-- 
Regards,
Christian



-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019