Bug#1005729: Automatic partitioning fails on arm64 d-i with error message partman: mkfs.vfat: Not enough or too many clusters for filesystem
Source: partman-efi
X-Debbugs-Cc: thomas@glanzmann.de
Version: 94
Severity: normal
Tags: d-i patch
Hello,
when installing Debian on an arm64 m1 machine, I get the following error during
auto partitioning or when creating a EFI System Partition with more than 256 MB:
partman: mkfs.vfat: Not enough or too many clusters for filesystem - try less or more sectors per cluster
When I try to manually create mkfs.vfat on the same system it works:
(air) [~] lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465.9G 0 disk
├─nvme0n1p1 259:1 0 500M 0 part
├─nvme0n1p2 259:2 0 371.6G 0 part
├─nvme0n1p3 259:3 0 2.3G 0 part
├─nvme0n1p4 259:4 0 1G 0 part /boot/efi
├─nvme0n1p5 259:5 0 85.5G 0 part /
└─nvme0n1p6 259:6 0 5G 0 part
nvme0n2 259:7 0 3M 0 disk
nvme0n3 259:8 0 128M 0 disk
(air) [~] umount /boot/efi
(air) [~] mkfs.vfat /dev/nvme0n1p4
mkfs.fat 4.2 (2021-01-31)
(air) [~] mkfs.vfat -F 16 /dev/nvme0n1p4
mkfs.fat 4.2 (2021-01-31)
The sector size is report as 4096:
(air) [~] blockdev --getss /dev/nvme0n1
4096
The issue seems to be related to:
https://sources.debian.org/src/partman-efi/94/commit.d/format_efi/?hl=15#L66
Since mkfs.vfat don't have issue with creating file systems on block devices
with a sector size other than 4096, it is probably best to remove the whole code
block that sets the sectors per cluster and sector size. Find attached a patch.
-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: arm64 (aarch64)
Kernel: Linux 5.16.0-asahi-next-20220118-g5fa3c85b5f14 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Report will be sent to Debian Bug Tracking System <submit@bugs.debian.org>
--- ./wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml.orig 2022-02-13 09:33:30.099608502 +0100
+++ ./wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml 2022-02-13 09:33:51.187037059 +0100
@@ -45,8 +45,8 @@
EAP-TLS as work network.</para>
<blockquote><programlisting>
-# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+# allow frontend (e.g., wpa_cli) to be used by all users in 'root' group
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
#
# home network; allow all valid ciphers
network={
@@ -79,7 +79,7 @@
Aegis, Interlink RAD-Series)</para>
<blockquote><programlisting>
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
network={
ssid="example"
scan_ssid=1
@@ -101,7 +101,7 @@
<blockquote><programlisting>
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
network={
ssid="example"
scan_ssid=1
@@ -123,7 +123,7 @@
authentication</para>
<blockquote><programlisting>
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
network={
ssid="1x-test"
scan_ssid=1
@@ -148,7 +148,7 @@
use.</para>
<blockquote><programlisting>
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
network={
ssid="example"
scan_ssid=1
@@ -178,7 +178,7 @@
(-Dwired or -Droboswitch on command line).</para>
<blockquote><programlisting>
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
ap_scan=0
network={
key_mgmt=IEEE8021X
--- format_efi.orig 2022-02-14 04:42:29.023205868 +0100
+++ format_efi 2022-02-14 04:46:31.407838463 +0100
@@ -62,22 +62,8 @@
db_progress START 0 3 partman/text/formatting
db_progress INFO $template
db_progress SET 1
- log_sector_size="$(blockdev --getss "$(cat device)")"
- if [ "$log_sector_size" = 512 ]; then
- mkdosfs_opts=
- else
- # mkdosfs has trouble handling cluster
- # calculations for non-512-byte logical
- # sectors. Forcing one sector per cluster
- # avoids this as long as the filesystem
- # isn't too large, but that shouldn't be a
- # problem for EFI System Partitions.
- mkdosfs_opts='-s 1'
- fi
if log-output -t partman --pass-stdout \
$MKFS_FAT -F "${new_efi_fs#fat}" \
- -S "$log_sector_size" \
- $mkdosfs_opts \
"$device" >/dev/null; then
sync
status=OK
Reply to: