| ▲ | rwmj 10 hours ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unfortunately it's not safe as the kernel can still write to (what it thinks is) the old filesystem on the device, which will introduce corruption to the new disk image. However a fun fact is that you can (do not actually do this!) boot a qemu VM from /dev/sda. You have to use an overlay (eg. qemu -drive snapshot=on flag) so that qemu won't write through to /dev/sda. I use this trick in supernested, a script I wrote that runs nested within nested within nested VMs ad infinitum until your hypervisor crashes. http://git.annexia.org/?p=supernested.git;a=blob;f=run-super... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | tux3 8 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I used to dual-boot windows, but I was too lazy to actually reboot, so naturally I had Virtualbox just boot the physical Windows partition while Linux was running. Which is totally fine! It's not a real dual boot if you don't boot both partitions at the same time. As long as you don't install guest VBox drivers, those would make it hang when it boots as the host on physical hardware, since there's no longer someone above to answer the hypercalls. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | astralbijection 8 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
That script sounds extremely unhinged, and I mean it as a compliment :) Without spoiling too much, the command at the very end of the series does something adjacent to this. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Joker_vD 9 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What if we remount the filesystem(s) at /dev/sda as read-only first? Then make a small ramfs with statically-linked curl in it and exec it. Hmm. Ideally, you'd also want to call reboot(2) after it's done... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | ciupicri 8 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Could xfs_freeze help with this? [0]: https://www.man7.org/linux/man-pages/man8/xfs_freeze.8.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | kyrjtejkrtys 4 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
depending on the size of your disk image and your uefi+boot partitions it's still possible to safely pull off. unmount the efi and boot partitions, write your image to the head of the disk, power cycle, then grow the last filesystem from the image to cover the rest of the disk. you might get lucky and have all three of uefi/boot/swap to work with. of course with the advent of uefi, you could instead just drop an installer image directly into the efi parition and boot that. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | vidarh 9 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The second part in the series deals with that by mounting it read-only from initrd. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||