Hello and welcome to another rambling of mine, today will be more a of a tutorial/guide to an extremely niche issue i have because im a lazy moron who couldn’t be bothered to backup and wipe his drive to fix his partitions properly :)

(jump to here to get to the method without my ramblings)

The issue

My system current has 2 partitions (i suppose 3 if you count the boot one), a useless windows one that i boot when i have no other choice, and the main linux one which i use daily, very normal so far, the issue is how i did it

The way the the arch wiki suggets setting up dual booting is installing windows first, then linux, and setting up the boot partition properly in such a way that it holds both the boot files for windows and linux (for more details PLEASE refer to the wiki, im too dumb to explain it better than them)

WELL, my moron self didn’t read it properly and just set up linux as you would by default, meaning i had the /boot partition in the middle of the windows and linux partition, meaning if i ever wanted to expand/shrink either partition, the /boot one would be in the way, which isn’t very helpful when im starting to use windows less and less and needing more space (for games :3) in my linux partition, so i had to move it. Ideally you’d move it to the start of your disk so you wouldn’t need to worry about it at all when changing the size of other partitions, but im WAAAAAAY too impatient to wait for everything to move an extra 4gb to the right of the disk to free up space for the boot partition, so i moved to the end instead (i do not recommend doing this at all btw, please don’t be lazy like yours truly)

The goods

some prerequisites FOR MY CASE SPECIFICALLY, CHANGE IT TO FIT YOURS IF YOU’RE GONNA EXCUTE THE COMMANDS:

/dev/sda3 is the windows partition /dev/sda8 is the old boot partition, it contains the files needed to boot both windows and linux (do not ask where the numbers inbetween go, please) /dev/sda5 is the new boot partition /dev/sda9 is the linux partition

What i needed to do

simple, i used gparted (from AUR, don’t need to use the live boot version btw) to shrink my linux partition by 2gb at the end, made a new partition in fat32, gave it boot and esp flags, then:

sudo mount /dev/sda5 /mnt

to mount the new boot partition i just made

sudo cp -ax /boot/. /mnt

to copy everything from /dev/sda8 (the old boot) to /dev/sda5 (the new boot)

nano /etc/fstab

to add an entry for the new boot menu, this will be different for different systems and filesystems, so edit it accordingly

and we`re done! if you use grub you might need to run

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

and

sudo grub-mkconfig -o /boot/grub/grub.cfg

but since i use refind (which i later switched to limine), it automatically detects it, how neat!

My stupidity

after doing all of that i realized something, because i have to expand the linux partition to the left and not the right (the order of the partitions matters), gparted still had to move everything around 150gb to the left (by copying and pasting.. it took an hour or something as im using a generic SATA SSD) so i would’ve been better just wiping the drive and pasting everything back again, how fun :D

Conclusion

This is better than having /boot in the middle, but still not great since if i ever do want to expand linux (or god forbid windows, for some reason) it would be really hard to do that, as i’d have to yet again place /boot somewhere else.. that’s a problem for future me though, so i won’t worry about it right now :D