You are not logged in.

#1 2019-04-08 19:27:48

jLuca
Member
From: Italy
Registered: 2016-12-06
Posts: 24

[SOLVED] Resizing EFI partition dualbooting Windows

Hello guys, I need to resize my EFI partition because both Windows and Arch won't update due to it. The problem is I can't resize because of the adjacent Microsoft reserved partition. I couldn't find relevant information about Windows system partitions so I don't know their role and importance. My idea was to shrink /dev/sdb3 that is the OS partition of Windows, then move first /dev/sdb3 and later /dev/sdb2 (by making a copy and deleting the old. In the end, I guess I should notify Windows and Arch of the moving of those partitions, maybe with fstab under Arch and I don't know what on Windows. Do you have any tips? Did someone try this in the past?

This is my partitioning scheme:

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048    923647    921600   450M Windows recovery environment
/dev/sdb2     923648   1128447    204800   100M EFI System
/dev/sdb3    1128448   1161215     32768    16M Microsoft reserved
/dev/sdb4    1387632 330807184 329419553 157.1G Microsoft basic data
/dev/sdb5  330807296 332541951   1734656   847M Windows recovery environment
/dev/sdb6  332544000 488397134 155853135  74.3G Windows recovery environment
[root@lightlux /]# ls /boot/
 EFI    initramfs-linux-fallback.img  'System Volume Information'
 grub   initramfs-linux.img            vmlinuz-linux

Last edited by jLuca (2020-01-26 00:03:06)

Offline

#2 2019-04-08 19:43:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,425

Re: [SOLVED] Resizing EFI partition dualbooting Windows

If you are using GRUB anyway, a far safer and less cumbersome option would be to mount your EFI partition somewhere else than /boot move the kernel images to  the /boot directory on your root partition and reconfiguring GRUB to read the kernel from there.

Offline

#3 2019-04-08 20:15:00

jLuca
Member
From: Italy
Registered: 2016-12-06
Posts: 24

Re: [SOLVED] Resizing EFI partition dualbooting Windows

I'm reading the wiki about your suggestion which seems flawless. Can you guide me through that to be safe? In particular, I don't know the right way to configure GRUB because when I installed it the Arch kernel configuration was done automatically, I had only to add the Windows entries.

What I did so far:
- Created a folder /efi
- Mounted /dev/sdb2 to /efi
- Checked up /etc/fstab (it seems like I have only to change /boot to /efi there, I will do it in the end when I'm sure about this: I don't have a rescue usb stick right here)

Offline

#4 2019-04-09 09:16:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,425

Re: [SOLVED] Resizing EFI partition dualbooting Windows

Been a while since I've used GRUB, but it should probably be sufficient to do these changes and then regenerate the GRUB config file

mv /efi/initramfs* /efi/vmlinuz-linux /boot/ #Or do a copy to be safe
grub-mkconfig /efi/grub/grub.cfg

of course before you do this, ensure GRUB has support for your filesystem, but afaik if you use standard ext or btrfs with no encryption that should just(tm) work

Offline

#5 2019-04-09 11:55:21

jLuca
Member
From: Italy
Registered: 2016-12-06
Posts: 24

Re: [SOLVED] Resizing EFI partition dualbooting Windows

Do you know if I can do that while booting Arch, e.g. on my running OS? (the grub documentation says: "Installing a boot loader on a running OS may be extremely dangerous").

By the way, your idea is to separate the position of the mounted EFI partition from grub directory and linux images in order to free up space (e.g. moving the two kernels images and the vmlinuz-linux to the /boot/ directory where grub is installed). If I'm correct I could also achieve that calling the following or would I be messing up the old installation?

grub-install --target=x86_64-efi --efi-directory=/efi --boot-directory=/boot --bootloader-id=GRUB

Again the documentation says: "But all the above examples assume that GRUB should put images under the /boot directory. If you want GRUB to put images under a directory other than /boot, you need to specify the option --boot-directory.". If I'm correct running this example would override /boot/ content recreating the linux images and the grub folder content but dealing automatically with the new EFI partition mounting position.

https://www.gnu.org/software/grub/manua … 02dinstall
https://wiki.archlinux.org/index.php/GR … allation_2
I'm sorry if I keep you replying to something that is trivial maybe but I prefer to be safer than sorry as I'm very busy these days and I don't want to mess up my installations right now.

Offline

Board footer

Powered by FluxBB