Boot partition and files

I have a separate ssd for windows, but for some reason windows boot files were installed on the linux boot partition. Is there any way I can delete these files? I need to reinstall windows and Id prefer it not to mess with the drives that its not supposed to use.

Post sudo parted -l so we can have an idea of your disk setup.

Model: ATA ADATA SU650 (scsi)
Disk /dev/sda: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  17.8MB  16.8MB               Microsoft reserved partition  msftres, no_automount
 2      17.8MB  511GB   511GB   ntfs         Basic data partition          msftdata, no_automount
 3      511GB   512GB   765MB   ntfs                                       hidden, diag, no_automount


Model: ATA WDC WD10EARS-00Y (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1000GB  1000GB  primary  ext4


Model: Samsung SSD 980 250GB (nvme)
Disk /dev/nvme0n1: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name         Flags
 1      2097kB  2150MB  2147MB  fat32           EFI          boot, esp
 2      2150MB  241GB   238GB   ext4            endeavouros
 3      241GB   250GB   9449MB  linux-swap(v1)               swap


Model: HP SSD FX900 Pro 1TB (nvme)
Disk /dev/nvme1n1: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  971GB   971GB   ext4
 2      971GB   1024GB  53.5GB

Normally, the Windows’ installer scans all the disks and it will use the first FAT32 partition with boot,esp flag to install its bootloader files to.

I assume that you installed your Windows after your Linux and even though you chose a separte disk, you are now seeing its boot folders and files on your Linux’ ESP.

Please provide more context:

What bootloader are you using on your Linux?

Are you able to boot your Windows from your Linux boot screen now or plan to do it when you re-install your Windows?

I use grub and I can boot windows from the grub menu

Alright, that’s fine!

So if you are going to reinstall your Windows, you could do either of the following:

Remove the boot,esp flag from your Linux’ ESP and re-install Windows on that other disk.

Or

If you want to be absolutely certain to eliminate any risk whatsoever that Windows would touch your Linux disk, disconnect it temporarily, re-install Windows on that other disk and connect back your Linux disk.

When all is done, update your Grub configuration in Linux. And finally delete all old Microsoft stuff from your Linux’ ESP.

Thanks, how to remove “flags” from disk and what impact will this have?

You can use a GUI partition manager like Gparted or KDE partitionmanager. When you mark the partition, you bring up a menu by right-clicking on it or from the tool bar. There you should see an option to manage flags.

It won’t have any impact on the installed system. It is only needed when installing the system. The path to Grub’s bootloader efi binary is already registered in your BIOS.

@Convert

Contrary to what is the case for boot,esp flags on your Linux’ ESP, Windows seems to be needing them for its updates/upgrades to go through. So keep the flags on the Windows’ ESP.