ya-mouse / fatresize

Resize FAT partitions using libparted
GNU General Public License v3.0
14 stars 21 forks source link

ESP, a FAT32 FS, rejected #23

Open HughR opened 3 years ago

HughR commented 3 years ago

My EFI System Partition is too small (100m; Microsoft's fault). So I'm trying to grow it, with mixed results.

$ sudo fatresize -i /dev/sda2 fails with the message: Error: /dev/sda2 is ntfs, not a valid FAT16/FAT32 partition.

(The wording has changed due to a commit (I just issued a pull request for it.))

So: fatresize thinks that the FS (or, perhaps, the partition type) is ntfs. Why?

parted does not think that this is an NTFS. It says:

Number Start End Size File system Name Flags 2 524MB 733MB 209MB fat32 EFI System Partition boot, esp

Why does fatresize thinks that this partition is ntfs? Any recommendations on how to proceed?

(I don't know if there are fancy things about an ESP that I should beware of.)

bigla commented 1 year ago

I have the same Situation as OP i believe. GPT Partition Table, the Partition type marked being ef00 according to gdisk.

I changed the partition type to Microsoft Basic Data (assuming fatresize checks for partition type) and then reran fatresize and still I had no luck with resizing.

I assume (did not test myself but read on StackOverflow) the Linux-only approach is:

  1. Backup (files from) ESP
  2. Resize/reformat partition
  3. Create filesystem
  4. Restore the backup

Last resort (Please remove this paragraph if considered an advertisement.) For anyone running into this issue with dual boot available: There is a free partition assistant from AOMEI for free which can do the resize of the volume (= filesystem) (even after partition resizing). The other options I tried were either paid software or just worked on a partition, not volume (= filesystem) level. The keyword is Volume Resizing.

One more question to the devs: Is the "small" partition/fs limit referring to the size after resizing, or before, or both?

EDIT: According to this line I assume the parted-detected type of partition is checked. Parted prints "File system" is "fat32" and strncmp compares the first 3 characters, which should be the same with "fat". It is unclear to me why this error message is issued then.

bbonev commented 3 months ago

I am observing the same problem:

# fatresize /dev/sdc2 -s max
fatresize 1.0.3 (20240726)
Error: /dev/sdc2 is not valid FAT16/FAT32 partition.

It is an ESP on a DOS disklabel

# fdisk -l /dev/sdc|grep sdc2
/dev/sdc2  *    542720 1874999 1332280 650.5M ef EFI (FAT-12/16/32)