Comment by _carbyau_
I know TheFineArticle is in Linux land but for Windows people with this issue you might look at Sysinternals Disk2vhd.[0]
It can be run from the online OS itself and it can store the resulting vhd on the same disk it is imaging (with space and disk performance constraints).
I find it handy for turning my freshly superceded gaming machine into a VM on my new machine for easy access to files, before doing whatever with my old hardware.
[0] https://learn.microsoft.com/en-us/sysinternals/downloads/dis...
Another marvel is Tom Ehlert's Drive Snapshot[0], which supports "disk image backups of live or offline Windows 2000-2022 systems all in a portable (and bootable!) ~1MB EXE".[1]
[0] http://www.drivesnapshot.de/en/index.htm
[1] https://news.ycombinator.com/item?id=42238451