[clug] Help with cloning an old Debian system please

Alex Osborne ato at meshy.org
Tue Aug 19 00:45:11 GMT 2008


On 19/08/2008, at 7:14 AM, Stephen Hodgman wrote:

> Well I cannot see it for recent kernels beyond 2.4.21.

Looks like there's a patch for 2.6.11 here:

http://linux-abi.sourceforge.net/patches/

2.6.11 might have issues with udev with newer distros though, but  
it's closer at least.

> If anyone can
> help with getting this to work on say a recent CentOS 5 I would be
> interested.

What I'd probably do if the 2.6.11 patch doesn't work is just dd the  
entire disk into a file and try running it inside qemu on the newer  
machine:

dd if=/dev/hda of=disk.img
qemu -m 256m -hda disk.img

> I was planning to install a separate disk and create equivalent
> partitions on it.  Then dd the contents of the running system to this
> disk.  I am not sure what else would be required but memory says I  
> need
> to do something to get the disk to boot.

You'll also need to install a bootloader (unless you dd the boot  
sector as well and the disks happen to have close enough  geometry).   
Since the machine is so old, I guess it uses lilo.  This is just off  
the top of my head, so it may or may not work, if not boot from a  
live cd in the machine you're going to use the cloned disk and try  
it, or install grub instead.  Mount the partitions in the cloned disk  
somewhere, eg /mnt/cloned.  Then edit /mnt/cloned/etc/lilo.conf to  
point at your new disk.  Then install lilo into the boot sector:

mount -t proc none /mnt/cloned/proc
mount -o bind /dev /mnt/cloned/dev
chroot /mnt/cloned
lilo -v
exit

Cheers,

Alex


More information about the linux mailing list