dd not performing as expected in Cygwin

1

I am trying to backup an entire drive to an image file in Cygwin.

$ dd if=/dev/sdc of=/cygdrive/i/Storage$/backups/2018-09-18.img  conv=noerror,sync status=progress bs=1M
0+0 records in
0+0 records out
0 bytes copied, 0.00137615 s, 0.0 kB/s    

$ ../../listdrives.sh
major minor  #blocks  name   win-mounts

8     0 3907018584 sda
8     1      16384 sda1
8     2 3907000320 sda2
8    16  244198584 sdb
8    17     510976 sdb1
8    18     102400 sdb2
8    19      16384 sdb3
8    20  243567616 sdb4   C:\
8    32          0 sdc
8    33     409600 sdc1
8    34     510976 sdc2
8    35     131072 sdc3
8    36  248083517 sdc4   F:\
8    37     920576 sdc5
8    48          0 sdd
8    64   15314688 sde
8    65   15313664 sde1   G:\
8    80    7831552 sdf
8    81    7830528 sdf1   H:\
8    96 3903062016 sdg
8    97     131072 sdg1
8    98 3902929900 sdg2   I:\

It appears that /dev/sdc is empty, but then how would I backup the partition as well if I am getting the same results?

$ dd if=/dev/sdc4 of=/cygdrive/i/Storage$/backups/2018-09-18.img conv=noerror,sync status=progress bs=1M
0+0 records in
0+0 records out
0 bytes copied, 0.00144819 s, 0.0 kB/s

user1023102

Posted 2018-09-18T19:40:23.417

Reputation: 11

Is sdc a local disk or a network one ? In addition the $ has special meaning, so if the name is really Storage$ probably you need to escape it as Storage\$ – matzeri – 2018-09-18T19:57:58.803

sdc is a local disk. Will try with escaping. – user1023102 – 2018-09-18T20:04:17.627

Escaping wasn't the issue.

`dd if=/dev/sdb of=/cygdrive/i/Storage$/backups/2018-09-18.img conv=noerror,sync status=progress bs=1M`
`8567914496 bytes (8.6 GB, 8.0 GiB) copied, 57.0005 s, 150 MB/s`
 – user1023102  – 2018-09-18T20:06:35.107

so what is special about sdc and sdd ? – matzeri – 2018-09-18T20:16:44.453

Nothing in particular. I wanted to backup sdc. It is an NVMe (PCI) if that makes any difference. sdb is C: on this system (also on an NVMe, albeit m.2). – user1023102 – 2018-09-18T20:22:17.230

Answers

0

You can't access Windows drives that have drive letters assigned. You need to umount and detach them from Windows first, using DISKPART.exe, etc. Naturally, you can't do this to the system partition (Usually C:).

A better alternative is to use a shadow copy. See: https://en.wikipedia.org/wiki/Shadow_Copy and: assign drive letters to VSS shadow copies

R Gz

Posted 2018-09-18T19:40:23.417

Reputation: 1

1I've been able to backup C: just fine without issue using dd in cygwin. – user1023102 – 2018-11-15T00:24:51.373