Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partitioning trouble
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
element432
n00b
n00b


Joined: 16 Dec 2016
Posts: 61

PostPosted: Thu Oct 25, 2018 10:18 pm    Post subject: Partitioning trouble Reply with quote

Hey, I was trying to partition my SSD and when formatting the EFI partition it has been throwing me this error.

Code:
gentoo # mkfs.vfat -F 32 /dev/sda2
mkfs.fat 4.0 (2016-05-06)
WARNING: Not enough clusters for a 32 bit FAT!


When searching/googling this issue, it recommended adding the -s2 option to the command, but it let to the same output.

Code:
gentoo # mkfs.vfat -F 32 -s2 /dev/sda2
mkfs.fat 4.0 (2016-05-06)
WARNING: Not enough clusters for a 32 bit FAT!


This is my current set up.

Code:
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3971DDC0-55E5-4736-87C8-8C49C41E882C

Device       Start       End   Sectors   Size Type
/dev/sda1     2048    264191    262144   128M Linux filesystem
/dev/sda2   264192    329727     65536    32M EFI System
/dev/sda3   329728   8718335   8388608     4G Linux swap
/dev/sda4  8718336 234441614 225723279 107.6G Linux filesystem


This is the first time I've had an issue like this, not really sure where to start. Thanks!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6635
Location: Saint Amant, Acadiana

PostPosted: Thu Oct 25, 2018 10:22 pm    Post subject: Reply with quote

AFAIK you do not need 32 bit FAT, just FAT will do. Works for me, see below.

Code:
file -s /dev/sda1
/dev/sda1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 8, reserved sectors 8, root entries 512, Media descriptor 0xf8, sectors/FAT 200, sectors/track 63, heads 255, hidden sectors 2048, sectors 407553 (volumes > 32 MB), reserved 0x1, serial number 0xa68d7dba, unlabeled, FAT (16 bit)

_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Thu Oct 25, 2018 10:40 pm    Post subject: Reply with quote

Jaglover wrote:
AFAIK you do not need 32 bit FAT, just FAT will do. Works for me, see below.

Code:
file -s /dev/sda1
/dev/sda1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 8, reserved sectors 8, root entries 512, Media descriptor 0xf8, sectors/FAT 200, sectors/track 63, heads 255, hidden sectors 2048, sectors 407553 (volumes > 32 MB), reserved 0x1, serial number 0xa68d7dba, unlabeled, FAT (16 bit)

Interesting. I've always read that FAT32 is mandatory, so I have just checked what the official UEFI specification document specifies. According to Section 13.3 (File System Format) in Version 2.7, May 2017 (my emphasis):

Quote:
The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI. To differentiate the EFI file system from pure FAT, a new partition file system type has been defined.

EFI encompasses the use of FAT32 for a system partition, and FAT12 or FAT16 for removable media. The FAT32 system partition is identified by an OSType value other than that used to identify previous versions of FAT. This unique partition type distinguishes an EFI defined file system from a normal FAT file system. The file system supported by EFI includes support for long file names.

Then Section 13.3.1.1 (File System Format) states:

Quote:
The EFI firmware must support the FAT32, FAT16, and FAT12 variants of the EFI file system. What variant of EFI FAT to use is defined by the size of the media. The rules defining the relationship between media size and FAT variants is defined in the specification for the EFI file system.

The UEFI system partition FAT32 Data region should be aligned to the physical block boundary and optimal transfer length granularity of the device(see Section 5.3.1).



Ref. http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf


EDIT: I notice that an earlier version of the Arch wiki article on UEFI from 5 August 2013 had the following advice, but it is not in the current version of that article:

Quote:
If you get the message WARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.vfat -s2 -F32 ... or -s1, otherwise the partition may be unreadable by UEFI.


Ref. https://wiki.archlinux.org/index.php?title=Unified_Extensible_Firmware_Interface&oldid=270040
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
mslt
n00b
n00b


Joined: 24 Oct 2017
Posts: 7
Location: Germany

PostPosted: Fri Oct 26, 2018 12:36 pm    Post subject: Reply with quote

Well I would guess that the partition is to small... AFAIK the FAT32 minimum size is 33,548,800 bytes. And I would bet that the partition is slightly below that.
_________________
Thinkpad T430
Core i5-3320M
NVIDIA NVS-5400M
8GB RAM
i3wm, zsh, vim, spaces > tabs
gentoo - Obviously
Back to top
View user's profile Send private message
element432
n00b
n00b


Joined: 16 Dec 2016
Posts: 61

PostPosted: Fri Oct 26, 2018 1:05 pm    Post subject: Reply with quote

I thought the size was too small too, so I made it 2GB just for fun. It still didn't work lol.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Fri Oct 26, 2018 1:09 pm    Post subject: Reply with quote

mslt wrote:
Well I would guess that the partition is to small... AFAIK the FAT32 minimum size is 33,548,800 bytes. And I would bet that the partition is slightly below that.

Well spotted. I didn't look at the size of his sda2. It has 65536 sectors x 512 bytes per sector = 33,554,432 bytes.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Fri Oct 26, 2018 1:14 pm    Post subject: Reply with quote

element432 wrote:
I thought the size was too small too, so I made it 2GB just for fun. It still didn't work lol.

Did you by any chance also try the '-s1' (one sector per cluster) option instead of the '-s2' (two sectors per cluster) option, as suggested in that old Arch Linux Wiki article? Would be interesting to see if it makes a difference when you have a partition size that is greater than the minimum allowable for FAT32.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
element432
n00b
n00b


Joined: 16 Dec 2016
Posts: 61

PostPosted: Fri Oct 26, 2018 1:19 pm    Post subject: Reply with quote

I tried with -s1, it gave the same output.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Fri Oct 26, 2018 1:35 pm    Post subject: Reply with quote

Curious. Wild guess, here, but have you tried booting a LiveCD/Pendrive (e.g. SystemRescueCd) and firing up GParted to do it? GParted also uses mkfs, but I recall seeing it issue several options. Worth a shot; you never know! To be honest, I use GParted more than the command line when I'm partitioning and formatting drives; it's easier and also offers granular control.


EDIT: I've just been double-checking the minimum size of a FAT32 partition. According to the Wikipedia article on FAT, for FAT32 it is:

32 MiB-4.5 KiB (with 65525 clusters and 512 byte sectors) = 33,549,824 bytes
256 MiB-36 KiB (with 65525 clusters and 4 KiB sectors) = 268,398,592 bytes
(That is not a typo; the Wikipedia article states 65525, not 65535.)

Also see Microsoft's Hardware White Paper: Microsoft Extensible Firmware Initiative FAT32 File System Specification.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum