I am using:

osm2pgsql version 0.96.0 (64 bit id space)
Compiled using the following library versions:
libosmium 2.15.1
Lua 5.2.4

The import statement I used was:

osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script ~/src/openstreetmap-carto/openstreetmap-carto.lua -S ~/src/openstreetmap-carto/openstreetmap-carto.style ~/Desktop/planet-190408.osm.pbf

taken from:

https://switch2osm.org/manually-building-a-tile-server-18-04-lts/

Although, in that tutorial they also used -C 2500 --number-processes 1 which I left out as they did not seem necessary as I read somewhere the code has ways to automatically determine good numbers to use.

The issue, as best I could determine, wasn’t with the HD space or number of cores, but with the ram required. It climbed to use all available ram and then the process was SIGKILLed. I am in the process of importing the north-american region and it took ~90gb of RAM during the import process. I used the same basic import statement as above and used htop to watch ram usage.

I can certainly try using the --flat-nodes. If you see any other issues with the import statement, please let me know. I would love to learn how to do this better.