Ubuntu – Fix /dev/sdb after using dd with no device inserted

command lineddlive-usbpartitioningusb

I was creating a bootable usb with dd using this command, which I've used many times before on my system without issue. This time, however, I forgot to plug in the usb so it tried to write to a device that wasn't there. It exited with this message:

3821010944 bytes (3.8 GB, 3.6 GiB) copied, 48 s, 79.5 MB/s
dd: error writing '/dev/sdb': No space left on device
920+0 records in
919+0 records out
3857190912 bytes (3.9 GB, 3.6 GiB) copied, 48.4669 s, 79.6 MB/s

Now for any device I plug in to any port, as long as it's assigned sdb, my partition manager recognizes it as 'Unknown Device' with 3.59 GB of storage and no partition table, and dd returns the same error as before. The file system on the other hand can access, read, and write to the usb just fine.

Any advice on how to fix this?

Best Answer

I think you have created a file with the name /dev/sdb. If that is the case, there is a regular file, where you expect there should be a block device.

It should be possible to remove that file and after that (maybe after a reboot) your system should be able to create a block device /dev/sdb

Related Question