Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If I have executed below commands,

dd if=/dev/zero of=/mnt/cdrom/usbfile.bin bs=1024 count=1048576

Getting error as

dd: opening `/mnt/cdrom/usbfile.bin': No such file or directory.

How to create a usbfile.bin file? I thought after executing above mentioned command, it will create usbfile.bin file. But I'm getting error.

share|improve this question
    
There exists the directory /mnt/cdrom? –  enzotib Jul 30 '13 at 6:35
    
yes.I have created that directories. –  Sujatha Jul 30 '13 at 6:36
    
Have you double checked its existence after the creation command? –  enzotib Jul 30 '13 at 6:40
    
Yeah.It is there.But usbfile.bin is not creating –  Sujatha Jul 30 '13 at 6:43
add comment

1 Answer 1

To simply create the file, use command touch /path/to/file. But you have to be sure that this path exists and you have write permissions into that directory.

Now, you choose /mnt/cdrom as path to file. This is obsolete path to CD-ROM. Since it was created manually (probably with sudo prefix), it allows writing there only to the root user. Correct path is /media/cdrom. And even if it was mounted, you would have no write permissions into that directory, because it is a CD-Read Only Memory. The only way you can write files directly onto CD filesystem is using DVD+R/DVD+RW disks.

So, the right command in your case would be such:

touch ~/usbfile.bin
dd if=/dev/zero of=~/usbfile.bin bs=1024 count=1048576

Then burn this file on DVD. I still have no idea why do you need this wasting of DVD, but if you want to do this, it is the right way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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