Help organizing my partitions in a dual boot environment

Hi,

I am transitioning from Windows and currently dual booting Fedora WS 41 and W11 from the same SSD. I want to keep windows around, as some software simply requires Windows (Adobe suite for example). That being said, I am moving most stuff to Linux and would therefore want to be able to reduce the windows partition and extend my linux partiton, a little at a time, so to speak. This is my current partition setup

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1        64     202815    202752    99M EFI System
/dev/nvme0n1p2   1288192    1320959     32768    16M Microsoft reserved
/dev/nvme0n1p3   1320960  630470924 629149965   300G Microsoft basic data
/dev/nvme0n1p4 998754304 1000212479   1458176   712M Windows recovery environmen
/dev/nvme0n1p5 630472704  632569855   2097152     1G Linux extended boot
/dev/nvme0n1p6 632569856  998754303 366184448 174.6G Linux filesystem

Partition table entries are not in disk order.

I know that I probably should not touch the 99M EFI partition at the beginning, that is clear.
I have some unfortunate half GB free space right after it though that I would like to make use of… I then have some Microsoft reserved 16M partition, followed by my Windows NTFS partition. After those are the Linux partitions, "Extended boot "1GB, what is this even? and then the Btrfs filesystem partition. Lastly, is the Windows recovery partition…

The layout is a bit silly because this SSD used to be all Windows until I shrunk it to make room for Linux. Any suggestions on how I could tidy this up and align stuff so that I can gradually “move space” (Excuse the expression lol) from Windows to Linux? Would love to also make use of that half a gig of free space (used to be old W10 recovery)

You should be able to use gparted and expand p1 into that free space immediately following it.

You also could mount the windows partition (p3) onto your fedora system and copy (move) the data you wish to relocate into a fedora location.

Windows disk manager can be used to shrink the file system to the minimum size allowed by the amount of data in that file system. Then gparted could also expand the fedora btrfs file system into that newly freed up space. It would require moving p5 to the beginning of the newly freed space and then expanding p6 to fill the remaining space.

p5 (extended boot) is the linux /boot ext4 file system that is needed for booting.

Hi jeff, thanks for the response.

This is exactly what I have been considering myself actually. I have been a bit concerned with these move operations though, are the safe to perform? I heard that some partitions should not be moved or it could break boot or something…?

Also, yes you are right, I could just expand p1 to eat up the free space, but as p1 is the EFI partition which should bee 99 (100~?)MB I don’t see the point of giving it way more space than it needs. I would rather make use of it somewhere where it could actually be used in practise. That would ofc, require moving a lot of partitions, which again brings me back to my concern, do I dare? Which ones do I dare move using gparted? I am guessing the NTFS one resizing should be done in windows at least, but what about moving these, could it break my boot?

Do you only have one disk? Because, FWIW I prefer to do dual boot using separate drives, one for Windows and one for Linux and don’t let them touch each other’s disks, then I select the OS to boot from using my BIOS boot menu. I never had any problems doing this while having both OSs on the same disk often resulted in some sort of difficulties, either Windows breaks Linux partitions or Linux breaks Windows stuff. But yeah, you need two disks, so if this is a laptop then it won’t work.

You cannot move partitions that are active. You can expand the efi partition while the OS is booted since it can be unmounted, expanded, then remounted.
/boot could also be moved with the OS booted by following the same steps. Dismount /boot/efi and /boot, relocate /boot, then mount both back.

Windows allows resizing of the file system while it is booted.
You would need to boot from live usb media before you could expand & relocate the main btrfs file system

Windows uses a tiny efi partition. Fedora by default creates an ~600MB efi partition during a new clean installation. The df -h command should show how much free space remains in that efi partition and I suspect it is very little.

Though you are correct in that not a lot is needed, the risk of trying to move both p2 and p3 is extreme since they are windows only. The safest choice is simply to use it for efi and not try anything that might break windows. 500MB is not super large for expanding the efi partition since that would make it about the default 600MB total that is default for a fedora installation.

I do see one additional potential concern in the partition table data you shared. Probably not an issue but something to keep in mind.
nvme0n1p1 starts at sector 64.
With all newer gpt partitioning that starts at sector 2048

Disklabel type: gpt
Disk identifier: XXX.....

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048     688127     686080  335M EFI System
/dev/nvme0n1p2  688128    2441215    1753088  856M Linux extended boot
/dev/nvme0n1p3 2441216 3907028991 3904587776  1.8T Linux LVM

I see no negative effects at present but who knows what might happen in the future. There is a good reason that standard was changed. (I think it is related to the newer allocation of space for an extended bios boot partition)

I recommend you use the Windows 11 method (Disk Manager?) to shrink the Windows partition as that is tested by Microsoft and known to work well.

Then you can use the Fedora tools to grow its partition.

@anonnetuser
I do have two disks, though only one SSD. The other one is a 2TB HDD. Plenty of room for Linux yes, but I want my OSes on SSDs with HDDs only for storage. This is a desktop PC not a laptop. I could add more SSDs ofc, but I am trying to not buy any new hardware as I think I don’t need any more space actually.

@computersavvy
df -h tells me that the EFI is about 50% used.

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1   95M   51M   45M  53% /boot/efi

Are you suggesting that if I would not have had Windows on this disk already, the Fedora install would have created a 600MB EFI partition but as Windows had already made the 99MB one, it just “hooked into” the existing one?

I will take your advice and not try to save those 500MB for linux storage. May cramp them into the EFI like you say.

I may give it a shot some day soon, shrinking the Windows NTFS partition a little, then moving p5 to the left of the free space, and then extending p6 to fill up the free space. I already have a live USB of Gparted ready made. The move operations could take quite some time though I think… It would be convenient if the NTFS (p3) and Btrfs (p6) would be side by side, this would make repeated shrink/extend operations easier, though I am not sure can I get them side by side, at least anymore…
But moving the partitions don’t brick them? Are the UUIDs used instead of their offsets when they are mounted by Linux?

Regarding the sectors, I have no idea why it starts at 64. That is the way the Windows 10 install back in the day originally partitioned the drive… Not sure if I should be worried about that?

@barryascott
Yes, definitely will use diskmgmt.msc in Windows (Disk Management) to shrink the NTFS Windows partition. Move operations at least then need to happen in gparted (and only if you guys tell me it is definately safe). Then either in gparted or fedora I can then extend to use the new free space I guess.

This is the drive layout using a new f41 install on a VM

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda3        39G  5.7G   32G  16% /
/dev/vda3        39G  5.7G   32G  16% /home
/dev/vda2       974M  330M  578M  37% /boot
/dev/vda1       599M   20M  580M   4% /boot/efi

I trimmed out all the virtual file systems from ram so the details on the drive are shown.
As you see /boot/efi is ~600MB, /boot is ~1GB and the rest is btrfs on vda3
A fully default partitioning scheme.

Yes, by default, if there is already an existing efi partition fedora uses it in conjunction with windows or whatever other OS may be installed.

When using gparted to adjust partitions the UUIDs are preserved (unless you delete the partition) and yes, fedora uses the UUIDs. The command cat /etc/fstab will show that.

My comment on starting at sector 64 was not intended to scare you. It was an observation that things change over time and to note that change in differences between your system and mine. It seems immaterial to this discussion.
The same is seen on my VM of f41

Device       Start      End  Sectors  Size Type
/dev/vda1     2048  1230847  1228800  600M EFI System
/dev/vda2  1230848  3327999  2097152    1G Linux extended boot
/dev/vda3  3328000 83884031 80556032 38.4G Linux filesystem

Once you have shrunk the ntfs partition (p3) moving p5 is simple since it is small. The time consuming part will be expanding p6 to the left since that will probably mean relocating every file in that file system.

Barring unexpected interference (loss of power, interruptions by the user, etc.) moving of partitions with gparted is generally considered reasonably safe, but as with every major file system operation backups are good insurance against failures.

I do recommend that for each partition you change with gparted, that you complete one before starting another and that they be done in order: p3 (windows), then p5, then p6. P1 can wait or be left as is depending upon what you elect to do with it.

Awesome, thanks! That pretty much covers all my questions :slight_smile: Only unfortunate thing is the hazzle tbh. I had been hoping to be able to gradually trim Windows down, while expanding Linux (size wise). Considering the move and resize operations it may well be I would prefer not to do it multiple times :sweat_smile:

It may get tidier in the end, if I later decide to wipe my windows and put in a smaller, (tiny11) debloated version instead. That could allow me to move some stuff around from the start and have all windows stuff in a continuous “line”.