I was curious to find out what would happen if all the data storage is used up and the limit exceeded in the middle of a batch apex job. Would the job be interrupted and the status changed to failed? Please let me know. Thanks in advance.
Refer to the extract below from this documentation
If your organization's active production instance shows as nearing, almost over, or at 100% of its available storage, it will continue to run as expected without any effect on your applications. At some point, beyond 100%, performance will be degraded. The exact point at which degradation will occur depends on the specifics of your implementation and cannot be predicted exactly. For this reason, it is recommended that you do not exceed available storage limits, or otherwise increase your storage limit
It will depend by how much the storage is exceeded during the batch execution. Salesforce allows for some extra buffer above 100% but this buffer varies by org.
If storage level is at 100% and the batch inserts data within the overflow buffer, then the batch may not fail.
However, if storage level is more than 100% and well above the buffer, then the batch will indeed fail and result in error "Storage limits exceeded".
Be careful because if this error occurs, then users won't be able to insert data at all in the org.
It is recommended to reach out to Salesforce to increase the data storage capacity to prevent this issue.
Hope this helps