2

Very often I get an error message on the terminal "cp: .: Invalid argument". It also happens with other commands than "cp". For example:

me@iMac:/Volumes/boot$ cp ~/Documents/wpa_supplicant.conf .
cp: .: Invalid argument
me@iMac:/Volumes/boot$ cp ~/Documents/wpa_supplicant.conf .
me@iMac:/Volumes/boot$

Note that I did not re-type the command on line three, I just hit up-arrow and enter. Does anyone know what the problem could be, or have an idea how to debug?

Thanks, Martin

  • In general it had a problem reading '.', or that directory no longer exists (e.g. it got deleted by another terminal/process) – smci Sep 2 '17 at 11:37
2

Set your hard disks to never sleep in System Preferences and see if the issue still persists.

  • Your answer put me into the right direction. The path '/Volumes/boot' is an SD card. Apparently two things combine to produce the error: First, the SD card is not ready to be written, and second, 'cp' produces an error message 'Invalid argument' if the file can't be written, even though the argument as such is correct. Thanks! – Martin Sep 1 '17 at 13:48
0

Why not use the absolute path for the destination?

cp ~/Documents/wpa_supplicant.conf /Volumes/boot

Hope it helped,

  • Thanks, see my comment above: Your proposal would change the error message a bit, but not solve the issue. But it helped to diagnose the problem! – Martin Sep 1 '17 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .