5

I'm trying to put Ventoy on a 128 GB flash drive, but when I tried to use the dd command, I got this error:

wolfy@penguin:~$ sudo dd if=ventoyiso.iso of=/dev/sda bs=4M status=progress
dd: error writing '/dev/sda': No space left on device
1+0 records in
0+0 records out
503808 bytes (504 kB, 492 KiB) copied, 0.0258977 s, 19.5 MB/s

I'm really new to this so I don't know why this is happening.

The output of ls -ls /dev/sda is

492 -rw-r--r-- 1 root root 503808 Oct 30 13:09 /dev/sda

What happened? How can I fix it and make the dd command work?

New contributor
Wolfy Master is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 2
    Don't use dd, by the way. That just complicates things and increases the possibility of error for no good reason. Simply cat your.iso > /dev/your_device should be enough. See dd vs cat -- is dd still relevant these days? Commented yesterday
  • 3
    @terdon Or pv your.iso > /dev/your_device if all you want is a progress bar (which apparently is a very common reason why people prefer dd to cat). Commented yesterday
  • 1
    Could you please run lsscsi or lsusb or run sudo dmesg | grep /dev/sd to try and identify where your USB disk really is. Commented 20 hours ago
  • Any advice that includes >/dev/your_device may be somewhat problematic because you need sudo for writing. Either use an elevated shell (sudo -i) or the trick with sudo tee (here, without -a in your case). An example command with sudo tee is <your.iso sudo tee /dev/your_device >/dev/null or (if you need a progress bar) pv your.iso | sudo tee /dev/your_device >/dev/null. Commented 9 hours ago

1 Answer 1

15

In the output of ls -l /dev/sda there should be brw-rw---- os so, where b denotes a block device file. In your case it's -rw-r--r-- where the first - denotes a regular file. This is wrong.

The easiest explanation is /dev/sda did not exist when you run your dd command and the command created it as a regular file.

/dev/sda may have not existed because you had removed it or because your flash drive was (and maybe still is) something else, e.g. /dev/sdb. (I don't know Chrome OS; in Debian/Ubuntu the right tool to find out is lsblk.)

You got No space left on device because the regular file grew inside your /dev which is a virtual filesystem in memory and has a low size limit. It is only meant to contain device files, directories and symlinks, not regular files.

Remove the regular file: sudo rm /dev/sda. Disconnect the flash drive and connect it again. Find out the right device file (sudo dmesg or lsblk may be handy). Confirm that in the output of ls -l /dev/right_device_file there is b just before rw…. Then proceed with dd, this time using the right device file.

3
  • 3
    ls -l /dev/disk/by-id may be useful to actually see what device corresponds to what device file. Commented yesterday
  • 1
    I'm surprised one can even create a regular file on /dev if it's really a devfs... Commented yesterday
  • 4
    devfs was replaced by udev and devtmpfs years ago. Afaict other than being pre-populated by the kernel, devtmpfs acts like a regular tmpfs. Commented yesterday

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.