I have just successfully followed all steps provided at the following pg. http://www.pyimagesearch.com/2015/10/26/how-to-install-opencv-3-on-raspbian-jessie/

When I want to compile the code with the following command pi@raspberrypi:~/opencv-3.0.0/build $ make -j4, I get the following error msg:

/home/pi/opencv-3.0.0/modules/imgcodecs/include/opencv2/imgcodecs.hpp:248:1: fatal error: can’t write PCH file: No space left on device } // cv ^ compilation terminated.

This is the awailable space I have on my Pi:n

  • /dev/root 6128M 5767M 28M 100% /n

  • devtmpfs 458M 0M 458M 0% /dev /n

  • tmpfs 462M 0M 462M 0% /dev/shm /n
  • tmpfs 462M 30M 433M 7% /run /n
  • tmpfs 5M 1M 5M 1% /run/lock /n
  • tmpfs 462M 0M 462M 0% /sys/fs/cgroup /n
  • /dev/mmcblk0p6 63M 22M 42M 34% /boot /n
  • tmpfs 93M 1M 93M 1% /run/user/1000 /n
  • /dev/mmcblk0p5 30M 1M 28M 2% /media/pi/SETTINGS /n

Any thoughts ?

1 Answer 1


I recently built opencv3.2 (including contrib) and it ate around 1 GByte, excluding the sources. If you see 28 M free, this is likely what has been freed on cleanup after the build failed.

Add a USB stick and do the build there. You really need more space than you have available.

  • 1
    Thx for answering. I have now added the following: /dev/sda1 7.5G 18M 7.1G 1% /mnt/usbdrive. My next question would now be. Should I start the entire download process as described in the following URL: pyimagesearch.com/2015/10/26/… and ensure that it is downloaded the the USB stick? Please guide me. Thank you Mar 16, 2017 at 12:31
  • Fine. Good luck. Let me know if you succeeded.
    – Philippos
    Mar 16, 2017 at 12:32
  • Sure I will keep you posted Philippos, but back to my question. Looking at my disk usage at my Pi, looks like I have used all awailable disk under root: /dev/root 6.0G 5.7G 21M 100% . Probably after all downloading done before I had mounted the USB. How can I remoove all unnecesay programs from the Pi, and then do a new re-install including the USB storage as a resource Mar 16, 2017 at 12:58
  • Oh, sorry, somehow I missed the second part of your comment. Delete the build directory on your root drive, create a new one on the USB stick and build opencv there (the sources did fit in the root partition, so leave them there. Delete them after the build. Two remarks: 1) I formatted the new drive to ext4; I'm not sure whether you will run into problems if your stick is vfat. 2) Are you sure you want opencv 3.0? The current version is 3.2 and has some new optimizations for the arm platform.
    – Philippos
    Mar 16, 2017 at 13:21
  • And about your idea in the latest comment: I would not include a usb drive as regular part of your system. If your system is really too full even after deleting the opencv sources and build, better get a bigger µSD card.
    – Philippos
    Mar 16, 2017 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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