From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by sourceware.org (Postfix) with ESMTPS id C1C6F3858C30 for ; Sat, 23 Sep 2023 08:21:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1C6F3858C30 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd83.aul.t-online.de (fwd83.aul.t-online.de [10.223.144.109]) by mailout08.t-online.de (Postfix) with SMTP id D64291200 for ; Sat, 23 Sep 2023 10:21:02 +0200 (CEST) Received: from [192.168.2.101] ([79.230.174.139]) by fwd83.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1qjxss-1Ezh200; Sat, 23 Sep 2023 10:21:02 +0200 Subject: Re: /usr/bin/dd *.iso to USB stick? To: cygwin@cygwin.com References: From: Christian Franke 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 List-Id: 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