Re: How to image a linux computer
Thank you Shachar and Eli, these suggestions are very helpful. On Sat, Nov 4, 2023 at 1:24 PM Eli Billauer wrote: > Hello, > > A somewhat different approach is to copy the entire filesystem into a > new computer, and run the old operating system in parallel with the new > one. > > I'm doing this myself, and this approach works surprisingly well: > > https://billauer.co.il/blog/2018/11/linux-chroot-system-in-parallel/ > > And when I say that it works, I mean that some of the system's services > still belong to the old OS. For example, the DHCP server on the machine > that I write this mail on belongs to Fedora 12. Why? Because I never had > a good reason to replace it with the current system's. > > The obvious advantage is that the transition to the new computer can be > gradual. At some point, you'll just turn off the old computer because > everything runs fine on the new one. > > So all you need is tar. > > The drawback that I can see with a full image of the old system (except > for the obvious waste of disk space) is that the old kernel may not be > compatible with the virtual machine. Which can be solved by installing a > newer kernel. But then, why bother running a full virtual machine? You > might as well use chroot. Which brings me back to my original suggestion. > > Regards, > Eli > > On 04/11/2023 9:34, Michael Shiloh wrote: > > Hello all, > > > > Situation: We have a linux computer with various software installed on > > old hardware that may malfunction and be unsupported. To mitigate this > > risk, we would like to make an image of this machine so that we can run > > it in a virtual machine. > > > > How do we do this? > > > > Thanks, > > Michael > > > > -- > Web: http://www.billauer.co.il > ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il
Re: How to image a linux computer
Hello, A somewhat different approach is to copy the entire filesystem into a new computer, and run the old operating system in parallel with the new one. I'm doing this myself, and this approach works surprisingly well: https://billauer.co.il/blog/2018/11/linux-chroot-system-in-parallel/ And when I say that it works, I mean that some of the system's services still belong to the old OS. For example, the DHCP server on the machine that I write this mail on belongs to Fedora 12. Why? Because I never had a good reason to replace it with the current system's. The obvious advantage is that the transition to the new computer can be gradual. At some point, you'll just turn off the old computer because everything runs fine on the new one. So all you need is tar. The drawback that I can see with a full image of the old system (except for the obvious waste of disk space) is that the old kernel may not be compatible with the virtual machine. Which can be solved by installing a newer kernel. But then, why bother running a full virtual machine? You might as well use chroot. Which brings me back to my original suggestion. Regards, Eli On 04/11/2023 9:34, Michael Shiloh wrote: Hello all, Situation: We have a linux computer with various software installed on old hardware that may malfunction and be unsupported. To mitigate this risk, we would like to make an image of this machine so that we can run it in a virtual machine. How do we do this? Thanks, Michael -- Web: http://www.billauer.co.il ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il
Re: How to image a linux computer
1. Write down the partitioning info (which directories are mounted under which partition) 2. mount each partition that holds data (i.e. - not sysfs and proc) separately, and tar it. Make sure to grab partitions that have other partitions cover them (/dev) 3. Partition new drive in similar separation (not necessary) 4. Extract your tars there. 5. Adjust /etc/fstab as necessary (it may contain UUIDs, that have now changed) 6. Use bootable media to boot, mount this somewhere, chroot in, make sure you have sys, proc and sufficient of /dev (you can bind mount the host's dev) 7. Reinstall GRUB 8. Regenerate the initramfs (should be a script to do that) That's it. It should boot just fine. Shachar On 04/11/2023 9:34, Michael Shiloh wrote: Hello all, Situation: We have a linux computer with various software installed on old hardware that may malfunction and be unsupported. To mitigate this risk, we would like to make an image of this machine so that we can run it in a virtual machine. How do we do this? Thanks, Michael ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il
Re: How to image a linux computer
Hello Michael, 1. run 'dd' on the old computer's disk and transfer the output to a disk image file in a modern computer. How to do it depends upon ability to connect external hardware (such as a network card, a disk with modern interface, or a DiskOnKey). 2. Write down old computer's BIOS settings having to do with hardware configuration. 3. Write down which peripherals your old computer has and their configuration (such as interrupt number and I/O address). 4. Check your virtual machine hypervisor's configuration options to see how to configure your virtual machine to emulate the exact same hardware. Consult your records of BIOS settings and peripherals. 5. In your new computer, loop-mount the disk image file and configure the virtual machine to access it. See, for example: https://unix.stackexchange.com/questions/316401/how-to-mount-a-disk-image-from-the-command-line Remember that old Linux versions (1.*, 2.*) are not as smart in auto- discovery of hardware configurations as more recent ones. More precise instructions depend upon the exact hardware and Linux version you have. United, we shall win, --- Omer Zak On Sat, 2023-11-04 at 11:34 +0400, Michael Shiloh wrote: > Hello all, > > Situation: We have a linux computer with various software installed > on old hardware that may malfunction and be unsupported. To mitigate > this risk, we would like to make an image of this machine so that we > can run it in a virtual machine. > > How do we do this? -- In civilized societies, captions are as important in movies as soundtracks, professional photography and expert editing. My own blog is at https://tddpirate.zak.co.il/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at https://www.zak.co.il/spamwarning.html ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il
How to image a linux computer
Hello all, Situation: We have a linux computer with various software installed on old hardware that may malfunction and be unsupported. To mitigate this risk, we would like to make an image of this machine so that we can run it in a virtual machine. How do we do this? Thanks, Michael ___ Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-le...@cs.huji.ac.il