GNU bug report logs - #59695
ESP partition uses 1024 byte sectors

Previous Next

Package: guix;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Tue, 29 Nov 2022 20:52:02 UTC

Severity: normal

To reply to this bug, email your comments to 59695 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#59695; Package guix. (Tue, 29 Nov 2022 20:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 29 Nov 2022 20:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: bug-guix <at> gnu.org
Subject: ESP partition uses 1024 byte sectors
Date: Tue, 29 Nov 2022 22:51:42 +0200
[Message part 1 (text/plain, inline)]
I was working on using a grub-efi system image for aarch64 and I got the
following error:
'Error: FAT sector size mismatch (fs=1024, dev=512)'
I traced it back to u-boot¹. u-boot wouldn't chainload grub if the
device block size and the filesystem sector size doesn't line up. I
changed the line in (gnu build image) in make-vfat-image to use '-S 512'
for esp partitions and was able to load the grub menu from u-boot.

I spent some time looking through the git history but I wasn't able to
find anything to suggest why we have 1024 byte sectors there
specifically.

¹ https://source.denx.de/u-boot/u-boot/-/blob/master/fs/fat/fat.c#L589

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#59695; Package guix. (Thu, 01 Dec 2022 08:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 59695 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 59695 <at> debbugs.gnu.org
Subject: Re: bug#59695: ESP partition uses 1024 byte sectors
Date: Thu, 1 Dec 2022 10:24:17 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 29, 2022 at 10:51:42PM +0200, Efraim Flashner wrote:
> I was working on using a grub-efi system image for aarch64 and I got the
> following error:
> 'Error: FAT sector size mismatch (fs=1024, dev=512)'
> I traced it back to u-boot¹. u-boot wouldn't chainload grub if the
> device block size and the filesystem sector size doesn't line up. I
> changed the line in (gnu build image) in make-vfat-image to use '-S 512'
> for esp partitions and was able to load the grub menu from u-boot.
> 
> I spent some time looking through the git history but I wasn't able to
> find anything to suggest why we have 1024 byte sectors there
> specifically.
> 
> ¹ https://source.denx.de/u-boot/u-boot/-/blob/master/fs/fat/fat.c#L589

Normally I'd be ok with hardcoding 512 for the sector size to fix this,
but then I remembered that there are 4k block size disks which actually
declare themselves as having 4k blocks and not emulating 512 byte
blocks.

What do you think? I suppose one option would be to patch u-boot to not
demand they be equal, but that only works with guix build u-boot. We
could force 512, u-boot is the only thing I've come across so far that
cares and most people² use µSD cards which advertise 512 byte blocks.

Maybe change it to 512 and add a TODO to revisit it later as needed?

² citation needed

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.