Home Linux Community Forums Software Command Line Copying directories from removable media?

Copying directories from removable media?

Link to this post 09 Feb 12

Hi, I have a CD that has an important exam directory that i want to copy to my Linux Mint box. I subsequently ran this command:

sudo dd if=/media/LPIC\ I\ EC\ 2/ of=linux-exam bs=1 count=100

and receive this error message:

dd: reading `/media/LPIC I EC 2/': Is a directory
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000590019 s, 0.0 kB/s

Thanks in advance..9

Link to this post 10 Feb 12

I am really not sure if I understand correctly, but if you copy some cd-rom or usb flash or st. you have to use propriate file in the /dev directory eg. /dev/cdrom or /dev/sda. But I used it only for few times. Also I am not sure, if there is possible to make a copy of directory using this way, because there can be stored other directories everywhere in some device so i think that dd can be used only for coppying files eg. of devices.

So it could look somethink like:
dd if=/dev/cdrom of=/home/user/Desktop/MyCD.iso

I am not sure, but I think that you can erase part of your disk by using command like that, because I destroyed my system this way. I am using flash disc /dev/sdb until this time for this case.

Link to this post 10 Feb 12

dd works with file content and a directory has no content at all, that's why you are getting the error.

As 012345JOsh says, you should point your "if" to the file that represents your removable media.


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board