So that people with special requirements (e.g. SSDs with unusual block
allocations) can customise it for their setup.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
# head/sectors for devices such as drbd which don't
# report geometry
sfdisk -H 64 -S 32 -u S --quiet --Linux "$1" <<EOF
-2048,,L,*
+${PARTITION_ALIGNMENT},,L,*
EOF
}
: ${VARIANTS_DIR:="@sysconfdir@/ganeti/instance-debootstrap/variants"}
: ${GENERATE_CACHE:="yes"}
: ${CLEAN_CACHE:="14"} # number of days to keep a cache file
+: ${PARTITION_ALIGNMENT:=2048} # sectors to align partition (1Mib default)
if [ -z "$OS_API_VERSION" -o "$OS_API_VERSION" = "5" ]; then
DEFAULT_PARTITION_STYLE="none"
else
# The default is "msdos" from ganeti 2.0 onwards, but none if installing under
# Ganeti 1.2 (os api version 5)
# PARTITION_STYLE="none"
+
+# PARTITION_ALIGNMENT: the alignment of the partitions in sectors
+# (512B); this defaults to 1MiB to give grub enough space for
+# embedding and for better alignment with modern media (HDDs and
+# SSDs), feel free to increase it if your media has even bigger
+# allocation blocks
+# PARTITION_ALIGNMENT=2048