If you're using the WiredTiger storage engine, data in the database is compressed (using snappy by default). In contrast, mongodump
output is not compressed. This is why 2TB may not be enough to backup a 1.5TB database.
To determine the uncompressed size of your database, you can run db.stats().dataSize
in the mongo
shell (see manual).
To determine the uncompressed collection size, use db.collection.stats().size
.
Having said that, there is no built-in way to "resume" a dump. However, you can pass a query into mongodump
using --query
parameter. If you have some kind of timestamp/ordering field in your collection, you may be able to use this parameter. This could also help you to split up your backup so you don't have to do all 1.5TB at once.
Alternatively, you also can pass --gzip
into mongodump
as suggested by JJussi to ensure the output is compressed.