Why I have 5.8G space but when rebuilding space is not enough

Which version are you upgrading from? Backups are compressed, some upgrades include an upgrade to Postgres which uses significantly more disk space than usual.