1

Topic: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Hi,

I have SSD + HDD with GPT. I did not check all the informations about UEFI and GPT so I partitioned SSD more like for MBR

sudo fdisk -l -u                 

Dysk /dev/sda: 119.2 GiB, bajtów: 128035676160, sektorów: 250069680
Jednostki: sektorów, czyli 1 * 512 = 512 bajtów
Rozmiar sektora (logiczny/fizyczny) w bajtach: 512 / 512
Rozmiar we/wy (minimalny/optymalny) w bajtach: 512 / 512
Typ etykiety dysku: gpt
Identyfikator dysku: 21D7D166-26B5-4A0B-8DD0-28405E43144A

Device        Start       End   Sectors  Size Type
/dev/sda1      2048    206847    204800  100M Linux filesystem
/dev/sda2    206848  64311295  64104448 30.6G Linux filesystem
/dev/sda3  64311296  86839295  22528000 10.8G Linux filesystem
/dev/sda4  86839296  87248895    409600  200M EFI System
/dev/sda5  87248896  87511039    262144  128M Microsoft reserved
/dev/sda6  87511040 250068991 162557952 77.5G Microsoft basic data

Before I made changes /dev/sda1 was 500MB and /dev/sda4 was 100M.
I thought that 100M for EFI boot will be to small and I do not need sda1 as it was created for /boot (I did not know that with UEFI I will not need this sad )
So with gparted:
1. I shrinked sda1 from 500MB to 100MB
2. moved to the left sda2 and added 400MB
3. moved sda3 to the left
4. enlarged sda4 to 200MB

Gparted went through steps 1 - 3 with no problem but then it failed to resize sda4.
Gparted shows an exclamation mark with information that 100M is unallocated for this partition

sudo gdisk -l /dev/sda           

GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 250069680 sectors, 119.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 21D7D166-26B5-4A0B-8DD0-28405E43144A
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   8300  
   2          206848        64311295   30.6 GiB    8300  
   3        64311296        86839295   10.7 GiB    8300  
   4        86839296        87248895   200.0 MiB   EF00  EFI system partition
   5        87248896        87511039   128.0 MiB   0C01  Microsoft reserved ...
   6        87511040       250068991   77.5 GiB    0700  Basic data partition

but...

df -h
System plików  rozm. użyte dost. %uż. zamont. na
/dev/sda2        30G  6.1G   23G  22% /
dev             3.9G     0  3.9G   0% /dev
run             3.9G 1000K  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda4        96M   48M   49M  50% /boot
tmpfs           3.9G   16K  3.9G   1% /tmp
/dev/sda3        11G  1.2G  8.8G  12% /home
/dev/sdb5       357G   25G  332G   7% /mnt/data
tmpfs           791M     0  791M   0% /run/user/997
tmpfs           791M  4.0K  791M   1% /run/user/1000

I do not find this as a big problem now but maybe there is some easy way to fix it before it will blow  smile
I can not do "check partition" with gparted and I do not know how to do it with windows or with windows recovery console.

Any help will be appreciated.

Best regards!

2

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Would you be able to provide the output from the following two commands?

sudo blkid
sudo parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

3

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Hi gedakc!

Thanks for your reply! This is the output of commands you asked for:

 sudo blkid
/dev/sda1: LABEL="dummy" UUID="ae82b751-3c9a-4bc3-ad9c-6a6f0105b16f" TYPE="ext4" PARTUUID="696beea5-372d-4298-b44b-50422b409c4c"
/dev/sda2: LABEL="linux" UUID="ef43d207-e721-4a55-9765-7f142287c562" TYPE="ext4" PARTUUID="888626e8-514c-405e-b8de-8195a61b076a"
/dev/sda3: LABEL="home" UUID="2b6edd81-825f-440a-94f7-f55d67523757" TYPE="ext4" PARTUUID="130d224f-0ab5-4b44-ac04-e96d23c6b9c3"
/dev/sda4: UUID="38F2-295A" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="6af76a1e-b97a-4c0d-aa8c-9efa8d274207"
/dev/sda6: UUID="646AF9406AF90F92" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="985f06d7-6e03-4fd6-ad28-14f91336ab9d"
/dev/sdb2: UUID="44482AFA482AE9FE" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="8f1de5c8-8a45-4d60-933e-598ba86a10eb"
/dev/sdb3: UUID="721CF3631CF320B1" TYPE="ntfs" PARTUUID="6dca3641-db9a-48e3-92eb-309817f7c761"
/dev/sdb4: LABEL="APPS" UUID="323A2AFE3A2ABEAB" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="154eca24-4903-4f97-a913-5c351c9557d7"
/dev/sdb5: LABEL="DATA" UUID="AEAA22B7AA227BC9" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="5d16402d-c22a-4f33-be4d-950423d9787d"
/dev/sdb6: LABEL="BKP" UUID="8C4C19E54C19CB3A" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="e582c0ca-f46f-4341-8dc7-9abcb979a93b"
/dev/sda5: PARTLABEL="Microsoft reserved partition" PARTUUID="adbcbe18-568a-4583-9327-18f0bc82b1af"
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="3d00549c-2957-4e2d-a83d-fed3582449f3"
sudo parted /dev/sda unit s print
Model: ATA PLEXTOR PX-128M6 (scsi)
Dysk /dev/sda: 250069680s
Rozmiar sektora (logiczny/fizyczny): 512B/512B
Tablica partycji: gpt
Flagi dysku: 

Numer  Początek   Koniec      Rozmiar     System plików  Nazwa                         Flaga
 1     2048s      206847s     204800s     ext4
 2     206848s    64311295s   64104448s   ext4
 3     64311296s  86839295s   22528000s   ext4
 4     86839296s  87248895s   409600s     fat32          EFI system partition          ładowalna, esp
 5     87248896s  87511039s   262144s                    Microsoft reserved partition  msftres
 6     87511040s  250068991s  162557952s  ntfs           Basic data partition          msftdata

4

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

From the output it appears that parted recognizes sda4 as a partition containing a fat32 file system, though I am not familiar with the flags listed for the partition.

On reason GParted shows an exclamation point beside a partition occurs when the file system is in an inconsistent state (requires repair).  You might try using the GParted menu option Partition -> Check to see if the partition can be repaired with the dosfsck/fsck.fat command.  If that does not work, then you might try repairing the partition from Windows.

5 (edited by levy 2014-12-05 12:02:15)

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

flags are: boot and esp (in english)

So I found the way to mount ESP partition in windows LINK (it is not so streight forward but enough for me)
I did chkdsk /r and chkdsk /f on this partition and windows did not find anything wrong
So I booted ubuntu 14.10 live and checked it out with gparted:

6 (edited by levy 2014-12-05 12:06:56)

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

https://www.mediafire.com/convkey/7f40/tiickrk1k5is9cu6g.jpg

7

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Thank for providing the extra details.  I can see the problem now.  Unfortunately, the libparted library used to resize FAT file systems will not work with partitions less than 256 MiB in size.

See Bug 649324 - failure to move / resize fat32 partitions less than 256 MB in size

8

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Ok, so if I resize it to >256MB will it work?

9

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

Unfortunately FAT resizing for filesystems < 256 MB (before or after) does not work.   ;-(

10

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

So I can not resize it back to 100MB or to (for example) 300MB?
Is there any other tool I can try to use to make it?

11

Re: Problem with resizing EFI boot partition multi-boot win7/win8/arch

I'm not sure, but you might try searching for other FAT file system resizing tools.  Perhaps Windows 7 would work too?

If GParted grew the partition to 300MB but not the FAT file system then you might use a command line tool like fdisk or sfdisk to set the partition back to a smaller size.

For an example of how I use sfdisk to adjust partitions, see How-to Fix Invalid MSDOS Partition Tables