diff --git a/man/repart.d.xml b/man/repart.d.xml
index 648d32625f..32df1e3d7f 100644
--- a/man/repart.d.xml
+++ b/man/repart.d.xml
@@ -292,7 +292,8 @@
SizeMaxBytes=) otherwise. If the backing device does not provide enough space to
fulfill the constraints placing the partition will fail. For partitions that shall be created,
depending on the setting of Priority= (see above) the partition might be dropped
- and the placing algorithm restarted. By default no size constraints are set.
+ and the placing algorithm restarted. By default a minimum size constraint of 10M and no maximum size
+ constraint is set.
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 76fc8bd1c9..d3706fe180 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -49,6 +49,12 @@
#include "terminal-util.h"
#include "utf8.h"
+/* If not configured otherwise use a minimal partition size of 10M */
+#define DEFAULT_MIN_SIZE (10*1024*1024)
+
+/* Hard lower limit for new partition sizes */
+#define HARD_MIN_SIZE 4096
+
/* Note: When growing and placing new partitions we always align to 4K sector size. It's how newer hard disks
* are designed, and if everything is aligned to that performance is best. And for older hard disks with 512B
* sector size devices were generally assumed to have an even number of sectors, hence at the worst we'll
@@ -322,7 +328,9 @@ static uint64_t partition_min_size(const Partition *p) {
/* Calculate the disk space we really need at minimum for this partition. If the partition already
* exists the current size is what we really need. If it doesn't exist yet refuse to allocate less
- * than 4K. */
+ * than 4K.
+ *
+ * DEFAULT_MIN_SIZE is the default SizeMin= we configure if nothing else is specified. */
if (PARTITION_IS_FOREIGN(p)) {
/* Don't allow changing size of partitions not managed by us */
@@ -330,11 +338,8 @@ static uint64_t partition_min_size(const Partition *p) {
return p->current_size;
}
- sz = p->current_size != UINT64_MAX ? p->current_size : 4096;
- if (p->size_min != UINT64_MAX)
- return MAX(p->size_min, sz);
-
- return sz;
+ sz = p->current_size != UINT64_MAX ? p->current_size : HARD_MIN_SIZE;
+ return MAX(p->size_min == UINT64_MAX ? DEFAULT_MIN_SIZE : p->size_min, sz);
}
static uint64_t partition_max_size(const Partition *p) {