Linux Swap Space & "Data Destroyer"

This has been a great night so far!

There are 2 kinds of things you can do while debugging an issue,
1. Copy paste & Fix
2. Read Read READ!!

So, I opted for the 2nd one tonight, because ofcourse I’ve a lot of free time (no I don’t).

The issue at hand was the classic “composer install” swap space issue –

The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:974

Good Stuff! So, as I said read read read!

So I read on the basic 3 line instructions (like I usually do and was going to copy paste it, like I usually do *yes I tend to have command-c, command-v capabilities when I don’t want to use my head), but then it struck me. “mkswap” “swapon” out of nowhere I started remembering this System Admin class lecture. They sound like familiar names. Interesting…… (I knew what /sbin and /bin were, DUH!!!, I’m not that lazy..)

Interesting things happening in my head, and then it struck me OH!!! so this is what we were talking about (yes I have sleeping tendencies when something boring is taught in college, or I thought it was boring, but now! BOOM).

Then I started to think, what’s “dd” ? what’s if, of and bs

time for some research

a quick dd --help helped me start on what it actually was!

Copy a file, converting and formatting according to the operands.

Nice! (wait, I’m still wondering what’s if and of, if-of …. i/o f, wow,, very wow)
I kind of deduced it was, maybe, input file and output file (and it was!) bs stood for block size (from years of PC formatting I kind of knew what it was) and count (ofcourse..)

so here I was with all this information, what did I do? Created that fucking swap space yeah! Cheers!

Interesting thing, dd has a funny nickname, Data destroyer, because if someone references the wrong input file and output file it can easily wipe down things to “zero” (like seriously that’s badass). So beware

Also read...

Leave a Reply

Your email address will not be published. Required fields are marked *