postgresql – Does the simultaneous addition of a postgres index take up disk space in a progressive or simultaneous way?

I'm adding a single index (over several hours, or even days, on a column of 5 billion bigints, all of them void) on a Postgres 9.6 server whose disk space is insufficient. I notice that disk usage has increased from 94% to 95%, and I'm not sure if it has all the space you want, or if it is recording more to disk and disabling the server during the weekend.
Does Postgres reserve disk space in advance for indexes, does it use more disk space gradually throughout the indexing process or does it write? intermittently?