You are correct that Windows throws its toys out of the pram when your hard drive gets too full because it needs some hard drive space for the page file. I guess if you put your rabbit in a hutch that was the same size as the rabbit, for example, your rabbit would have no room to move either!
I would suggest the following.
- Purchase an M.2 to USB enclosure, something like (but not necessarily specifically)
SSK Aluminum USB 3.1 to M.2 NGFF SSD Enclosure Adapter
- Purchase another hard drive that is bigger than your M.2 drive (double is often a good ball park), something like (but not necessarily specifically)
Samsung SSD 870 EVO 1 TB
- Install the new hard drive in your PC
- Install an OS on the new hard drive. Ensure that you create one partition for the OS and a different partition for your docs. The windows installer lets you do this in the advanced options.
- Use said enclosure to connect your M.2 hard drive to your PC
- back up (copy) your important documents, photos etc from your M.2 into the docs partition (not the OS partition) of your new hard drive
- Wipe the M.2 SSD - format it completely.
- Remove the new hard drive - mitigates any risk of inadvertently overwriting our important docs with an OS
- Install the M.2 drive in the M.2 slot
- Install an OS on the M.2.
- Reinstall the new hard drive
- Delete the OS partition on your new hard drive so that you are not dual booting the same OS. BE CAREFUL not to delete the docs partition.
- Expand your docs partition on your new hard drive to fill the drive.
- Job done!
A bit of shuffling but it is easy enough. Personally, I only use my M.2 drive for operating systems and applications as these need to load faster. I use standard SSDs for files, as they are plenty fast enough for storage. I have Windows & Ubuntu Linux (dual boot is handy) on the M.2 on my personal laptop, with all my files on a Samsung Evo SSD.
While your case is open, you might also like to take the opportunity to upgrade your RAM. It's an easy job and will help you out overall.
Just to be clear, always turn off your PC before adding or removing internal components like hard drives. These are not hot-swappable.
Finally, I think this is another fantastic illustration of the IT guy mantra, "If your data does not exist in five places, it does not exist at all." Backup your data! My data flows into these places,
- Laptop
- Local NAS
- Dropbox
- AWS
- GCP
Source: I have been an IT guy for over a decade.