Re: How to image a linux computer

2023-11-05 Thread Michael Shiloh
Thanks Shay

On Sun, Nov 5, 2023 at 3:56 PM Shay Gover  wrote:

> 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 
> 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  wrote:
>>
>>> On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh <
>>> michaelshiloh1...@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-using-dd/
>>> .
>>>
>>> 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-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

2023-11-05 Thread Shay Gover
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 
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  wrote:
>
>> On Sat, Nov 4, 2023 at 9:35 AM Michael Shiloh <
>> michaelshiloh1...@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-using-dd/
>> .
>>
>> 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-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

2023-11-05 Thread Michael Shiloh
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  wrote:

> On Sat, Nov 4, 2023 at 9:35 AM 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?
>>
>>
> 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-using-dd/
> .
>
> 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-le...@cs.huji.ac.il


Re: How to image a linux computer

2023-11-05 Thread shimi
On Sat, Nov 4, 2023 at 9:35 AM 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?
>
>
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-using-dd/
.

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-le...@cs.huji.ac.il


Re: How to image a linux computer

2023-11-04 Thread Michael Shiloh
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

2023-11-04 Thread Eli Billauer

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

2023-11-04 Thread Shachar Shemesh


  
  
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

2023-11-04 Thread Omer Zak
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

2023-11-04 Thread Michael Shiloh
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