0

I am using a Mac, booting in efi mode a Debian 10 live usb that I created. In live mode, I am attempting to create a FreeBSD install usb by downloading it and dd’ing it to another usb stick. Before doing so, I want to make sure my usb stick is zeroed. While zeroing my usb stick I noticed a difference in output from dd when using a capital “X” when referencing the drive /dev/sdX, and a lower case “x” when referencing the drive /dev/sdx I cannot find much information on case sensitivity in Debian using the dd command, and what the difference is between sdX and sdx when referencing drives.

Why do I get different outputs in the dd command when using of=/dev/sdx vs. using of=/dev/sdX ? For example, as referenced in the Imgur pic link, I will use the following example in Debian live:

$ dd if=/dev/zero of=/dev/sdc bs=1M conv=noerror status=progress && sync
15618539520 bytes (16 GB, 15 GiB) copied, 1067 s, 14.6 MB/s
dd: error writing ‘/dev/sdC’ : No space left on device
14901+0 records in
14900+0 records out
15623782400 bytes (16 GB, 15 GiB) copied, 1125.46 s, 13.9 MB/s

But if I do the command using of=/dev/sdC on the same usb drive, I get different results such as in the (2nd) example:

$ dd if=/dev/zero of=/dev/sdC bs=1M conv=noerror status=progress && sync
11725956096 bytes (1.7 GB, 1.6 GiB) copied, 3.3301 s, 575 MB/s
dd: error writing ‘/dev/sdC’ : No space left on device
1825+0 records in
1825+0 records out
1913491456 bytes (1.9 GB, 1.8 GiB) copied, 3.3301 s, 575 MB/s

Could someone please explain this phenomenon to me? What is the difference between the drive /dev/sdC and /dev/sdc?

Debian 10 Live dd command sdx vs sdX

  • Long story short, /dev/sdc is your actual device and /dev/sdC is a file which did not exist before running dd. You're mixing things up between writing conventions and the command you want to run in the end. BTW, it is not a "Debian thing". – Paradox Jul 29 at 3:52
4

dd doesn't care about case, that's up to the filesystem and kernel. And on Debian that'd be case-sensitive. So where /dev/sdc might have been a device node, /dev/sdC probably didn't exist until dd created it, as a regular file sdC inside /dev. /dev is probably a tempfs:

% df -hT /dev
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  440M     0  440M   0% /dev

And its size is usually limited to a fraction of RAM (default of 50%, I think).

So dd of=/dev/sdC created a file called sdC on a tmpfs filesystem, and then proceeded to fill it to the limit. You probably ~2GB of RAM being used for nothing (so maybe 4 GB RAM total?).

dd of=/dev/sdc wrote to the device, and filled it. Sherlock Holmes tells me that's a 16GB disk.

  • Ya know, this makes too much sense. If i thought about this a wee bit longer, i would have figured it out. Either way, THANKYOU good sir! – DanRan Jul 30 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.