You are not logged in.
Pages: 1
Usually I pay rapt attention to the destinations of dd and shred commands for obvious reasons. Today I executed the following command:
sudo dd if="a-linux-distro" of=/dev/sdc
Except that there was no /dev/sdc device. There was only /dev/sda and /dev/sdb. I wasn't paying close attention. The command executed for a few seconds and then returned normally. However, I would have expected that it would have returned immediately with some kind of error message: "Hey, blockhead, there is no /dev/sdc device!"
So what happened? Is this another obscure way of sending unwanted bits to the bit bucket or did it actually overwrite something?
Last edited by nobodyuknow (2020-03-01 23:10:08)
Offline
I guess you now have a file at /dev/sdc that holds the contents of "a-linux-distro". If there is no disk /dev/sdc, you can delete the file.
Offline
Thanks for the reply. I looked at /dev and sdc seems to be no different than sda and sdb. However, it's hosed, because I tried "burning" another USB flash drive using sdc and it returned immediately with zero bytes copied, while sdd works just fine. Time for a reinstall.
Offline
I think you should be able to delete both of those without any problems. Maybe reboot, but that's probably not necessary.
Offline
You can delete an over written /dev file, but it is a bit more complicated than a normal directory file to re instate, if I remember rightly, (I did it a couple of times too ).
Edit: Check out mknod. (These are 'node' files.)
Last edited by Camtaf (2020-03-02 11:55:43)
Offline
@fsmithred
I reboot once per day at a minimum. I often reboot a few times each day because I switch back-and-forth between different Linux distributions and Windows 10.
@Camtaf
The mknod man page is pretty sparse. One webpage suggested to determine major and minor numbers by looking at /usr/src/linux, but that directory does not exist. I found a webpage from kernel.org (https://git.kernel.org/pub/scm/linux/ke … evices.txt) which appears to be the bible for device numbers. According to that, my command should be "mknod /dev/sdc b 8 32." I rolled the dice and it appeared to complete a dd. I'll post again later after I test it to see if it was a success.
Offline
Yup, that mknod command did the trick. Much easier than a reinstall. Thanks to fmithred and Camtaf for their assistance. Usually my questions are not something someone would find useful, but this one just might be.
Offline
I didn't think you would need to use mknod. Since there was no actual device for /dev/sdc, I would expect that there was no /dev/sdc in the filesystem until you made it. I only see as many devices listed as actually exist on my systems. Those get created by udev at boot or when you plug in a removable drive.
Offline
Pages: 1