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
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-fr...
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?
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
Thank you Shachar and Eli, these suggestions are very helpful.
On Sat, Nov 4, 2023 at 1:24 PM Eli Billauer eli@billauer.co.il 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
On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh michaelshiloh1010@gmail.com 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?
Beyond what has been suggested before me on this thread, you can also rescue-boot both the old and the new system that has a disk same-size-or-larger, and just bit-copy the hard drive as a whole (including partition table) over the network, without passing through an 'image' stage. You can either do so securely (but slower) over SSH, or in plaintext if your network is secure (using netcat). See: https://www.thegeekdiary.com/how-to-clone-linux-disk-partition-over-network-... .
Note: The above tutorial suggests using compression when SSH is not involved (not sure why the difference in approaches), which you may wish to consider removing from the pipeline, especially if cloning over fast LAN - as there's a good chance that the compression, which /may/ not reduce the data volume transferred much (unless you're looking at lots of space that is filled with a static pattern like zeros) and the CPU may become the bottleneck instead of the network, and then, מה הועילו חכמים בתקנתם?
DISCLAIMER: Make sure you understand what you do, so you'll not by mistake write TO the source disk from the target (or from nowhere...), overwriting all your data. :) I would say it wouldn't be a problem if you kept backups, but the original question suggests that one may not be available in this case... so, be careful. As a rule of thumb, the dd _of=_ parameter on the _SOURCE_ should NEVER point to anything local, and quite frankly, should NEVER appear on the source altogether...
HTH,
-- Shimi
Thanks Ori and Shimi; I've forwarded your suggestions to my friend.
Your help is much appreciated.
On Sun, Nov 5, 2023 at 3:16 PM shimi linux-il@shimi.net wrote:
On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh michaelshiloh1010@gmail.com 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?
Beyond what has been suggested before me on this thread, you can also rescue-boot both the old and the new system that has a disk same-size-or-larger, and just bit-copy the hard drive as a whole (including partition table) over the network, without passing through an 'image' stage. You can either do so securely (but slower) over SSH, or in plaintext if your network is secure (using netcat). See: https://www.thegeekdiary.com/how-to-clone-linux-disk-partition-over-network-... .
Note: The above tutorial suggests using compression when SSH is not involved (not sure why the difference in approaches), which you may wish to consider removing from the pipeline, especially if cloning over fast LAN - as there's a good chance that the compression, which /may/ not reduce the data volume transferred much (unless you're looking at lots of space that is filled with a static pattern like zeros) and the CPU may become the bottleneck instead of the network, and then, מה הועילו חכמים בתקנתם?
DISCLAIMER: Make sure you understand what you do, so you'll not by mistake write TO the source disk from the target (or from nowhere...), overwriting all your data. :) I would say it wouldn't be a problem if you kept backups, but the original question suggests that one may not be available in this case... so, be careful. As a rule of thumb, the dd _of=_ parameter on the _SOURCE_ should NEVER point to anything local, and quite frankly, should NEVER appear on the source altogether...
HTH,
-- Shimi
Use clonezilla. Before cloning: 1) Remove gpu drivers 2) Remove microcode package 3) You might need to change partition id or disk id in the bootloader.
On Sun, Nov 5, 2023 at 1:50 PM Michael Shiloh michaelshiloh1010@gmail.com wrote:
Thanks Ori and Shimi; I've forwarded your suggestions to my friend.
Your help is much appreciated.
On Sun, Nov 5, 2023 at 3:16 PM shimi linux-il@shimi.net wrote:
On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh < michaelshiloh1010@gmail.com> 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?
Beyond what has been suggested before me on this thread, you can also rescue-boot both the old and the new system that has a disk same-size-or-larger, and just bit-copy the hard drive as a whole (including partition table) over the network, without passing through an 'image' stage. You can either do so securely (but slower) over SSH, or in plaintext if your network is secure (using netcat). See: https://www.thegeekdiary.com/how-to-clone-linux-disk-partition-over-network-... .
Note: The above tutorial suggests using compression when SSH is not involved (not sure why the difference in approaches), which you may wish to consider removing from the pipeline, especially if cloning over fast LAN - as there's a good chance that the compression, which /may/ not reduce the data volume transferred much (unless you're looking at lots of space that is filled with a static pattern like zeros) and the CPU may become the bottleneck instead of the network, and then, מה הועילו חכמים בתקנתם?
DISCLAIMER: Make sure you understand what you do, so you'll not by mistake write TO the source disk from the target (or from nowhere...), overwriting all your data. :) I would say it wouldn't be a problem if you kept backups, but the original question suggests that one may not be available in this case... so, be careful. As a rule of thumb, the dd _of=_ parameter on the _SOURCE_ should NEVER point to anything local, and quite frankly, should NEVER appear on the source altogether...
HTH,
-- Shimi
Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-leave@cs.huji.ac.il
Thanks Shay
On Sun, Nov 5, 2023 at 3:56 PM Shay Gover govershay@gmail.com wrote:
Use clonezilla. Before cloning:
- Remove gpu drivers
- Remove microcode package
- You might need to change partition id or disk id in the bootloader.
On Sun, Nov 5, 2023 at 1:50 PM Michael Shiloh michaelshiloh1010@gmail.com wrote:
Thanks Ori and Shimi; I've forwarded your suggestions to my friend.
Your help is much appreciated.
On Sun, Nov 5, 2023 at 3:16 PM shimi linux-il@shimi.net wrote:
On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh < michaelshiloh1010@gmail.com> 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?
Beyond what has been suggested before me on this thread, you can also rescue-boot both the old and the new system that has a disk same-size-or-larger, and just bit-copy the hard drive as a whole (including partition table) over the network, without passing through an 'image' stage. You can either do so securely (but slower) over SSH, or in plaintext if your network is secure (using netcat). See: https://www.thegeekdiary.com/how-to-clone-linux-disk-partition-over-network-... .
Note: The above tutorial suggests using compression when SSH is not involved (not sure why the difference in approaches), which you may wish to consider removing from the pipeline, especially if cloning over fast LAN - as there's a good chance that the compression, which /may/ not reduce the data volume transferred much (unless you're looking at lots of space that is filled with a static pattern like zeros) and the CPU may become the bottleneck instead of the network, and then, מה הועילו חכמים בתקנתם?
DISCLAIMER: Make sure you understand what you do, so you'll not by mistake write TO the source disk from the target (or from nowhere...), overwriting all your data. :) I would say it wouldn't be a problem if you kept backups, but the original question suggests that one may not be available in this case... so, be careful. As a rule of thumb, the dd _of=_ parameter on the _SOURCE_ should NEVER point to anything local, and quite frankly, should NEVER appear on the source altogether...
HTH,
-- Shimi
Linux-il mailing list -- linux-il@cs.huji.ac.il To unsubscribe send an email to linux-il-leave@cs.huji.ac.il