this post was submitted on 16 Sep 2023
36 points (100.0% liked)
Linux
48375 readers
1592 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's not that difficult do virtual > physical migrations in Linux. Linux is inherently portable, thanks to the kernel, you don't need to worry about stuff like drivers, at least for drivers which are part of the kernel (so not counting proprietary nVidia drivers - which you wouldn't be using in a VM anyways.)
Roughly, the process would go like this:
qemu-img convert
to convert your virtual disk to a raw image formatdd
to write the image to your physical diskgparted
to resize/expand partitions on the disk as requiredfdisk
/blkid
to see which device node your disk is using (eg /dev/nvme0n2 etc), then mount the new root volume and edit thefstab
to the correct disk paths if requiredThis is all of course, assuming you're migrating to a dedicated hard drive and you're only going to be using a single OS. On the other hand, if you're migrating on to an existing disk (dual-booting) the process would be a bit different - instead of
dd
ing the entire image, you'd uselosetup
and mount your raw disk image as a loop device, then use something like clonezilla or GParted to copy over only specific partitions excluding the ESP. After that, the rest of the process should be similar to the above, except you won't need to reinstall your bootloader - but you may need to update it's config to detect the new OS.I've not accounted for complex setups btw, such as using LUKS or LVM. But the process still remains roughly the same, you'll just need a few additional commands to decrypt the partition before you copy them over.
In saying that, it may be easier to just reinstall the distro fresh on your real hardware. There are scripts out there to export your dotfiles and package lists, to make the migration easier.
Thanks for the detailed answer.
It sounds way too complicated for me so I’ll probably give it a try in a VM and then install everything from scratch if I want use it as a daily.