5

My / only has about 800MB free space left. I guess it is the reason that

$ convert * book.pdf
Segmentation fault (core dumped)
bash: cannot create temp file for here-document: No space left on device

I think convert (from Imagick) use /tmp to store temporary files. The files in the current directory are 188 png and jpg files about 70MB in total. Why 800MB free space in \ can't satisfy convert?

Can I get around the limit space on /? I still have more space on ~ and other partitions, and I also have external USB storage. Thanks.

  • Try setting the environment variable TMPDIR to point to another directory on another device with lots of space. Set permissions on the directory with chmod 1777 [path to dir/dirname] – jim mcnamara Nov 6 '14 at 1:53
  • Thanks. How to set the environment variable TMPDIR to point to another directory? – Tim Nov 6 '14 at 1:58
  • Most distros would have disabled core dumps, as "normal" users can't do anything useful with them. I recommend putting ulimit -c 0 in your .profile to prevent core dumps, which just take up space. I hope you did remove the core dump that was generated? Maybe also search for other "core" files on your system. – wurtel Nov 6 '14 at 10:50
  • @wurtel: where is the core dump saved? – Tim Nov 6 '14 at 12:43
  • Core dumps (named core) are written in the working directory of the process that dumped core. That's usually the directory where you started the command, but some commands or scripts change directories themselves so in that case "it depends". – wurtel Nov 6 '14 at 15:03
5
# do this part one time only
mkdir /path/to/mytmp
chmod 1777 /path/to/mytmp

# put this in .bashrc or your login .profile  file
# it has to execute BEFORE you want TMPDIR to work
export TMPDIR=/path/to/mytmp

FWIW- 800 MB free on the root "/" directory does not sound like a long term good idea. If the / directory becomes full your system will freeze and/or you will get all kinds of errors. Don't let that happen.

  • Thanks. Is it possible to guess how much space convert will need? – Tim Nov 6 '14 at 2:11
  • Does the documentation say anything useful? - I do not know offhand. The mytmp directory should be on a device with LOT of free space, more than 10GB. – jim mcnamara Nov 6 '14 at 2:13
1

I had the same issue.

The solution was to:

restart linux

When I read that it could be a temp file problem, I remembered that the machine had not been restarted for a while.

After restarting the problem fixed itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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