diff --git a/meta/conf/fragments/yocto/monitor-disk-space.conf b/meta/conf/fragments/yocto/monitor-disk-space.conf
new file mode 100644
index 0000000000..95ff54465f
--- /dev/null
+++ b/meta/conf/fragments/yocto/monitor-disk-space.conf
@@ -0,0 +1,18 @@
+BB_CONF_FRAGMENT_SUMMARY = "Monitor disk space during the build"
+BB_CONF_FRAGMENT_DESCRIPTION = "Monitor the disk space during the build. If \
+there is less that 1GB of space or less than 100K inodes in any key build \
+location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully shutdown the build. If there \
+is less than 100MB or 1K inodes, perform a hard halt of the build. The reason \
+for this is that running completely out of space can corrupt files and damages \
+the build in ways which may not be easily recoverable. It's necessary to monitor \
+/tmp, if there is no space left the build will fail with very exotic errors."
+
+BB_DISKMON_DIRS = "\
+    STOPTASKS,${TMPDIR},1G,100K \
+    STOPTASKS,${DL_DIR},1G,100K \
+    STOPTASKS,${SSTATE_DIR},1G,100K \
+    STOPTASKS,/tmp,100M,100K \
+    HALT,${TMPDIR},100M,1K \
+    HALT,${DL_DIR},100M,1K \
+    HALT,${SSTATE_DIR},100M,1K \
+    HALT,/tmp,10M,1K"
