Find the answer to your Linux question:
Results 1 to 8 of 8
hi howto migrate debian into other hardware ? my problem is, I don't want to install a fresh system und I'm looking for other solution. I've tried to create an ...
  1. #1
    cc
    cc is offline
    Linux Newbie
    Join Date
    Jun 2004
    Posts
    120

    migrate debian into other hardware ?

    hi

    howto migrate debian into other hardware ?

    my problem is, I don't want to install a fresh system und I'm looking for other solution.

    I've tried to create an image using symantec ghost and setup on the other hardware,
    but I'm getting a lot of hardware problems:
    Code:
    Begin: Mounting root file system ... ...
    Begin: Running /scripts/local-top ...
    Done.
    Begin: Waiting for root file system ... ....
    Done.
              Check root= bootcarg cat /proc/cmdline
              or missing modules, devices: cat /proc/modules ls /dev
    ALERT! /dev/hda6 does not exist. Dropping to a shell!
    
    BusyBox v1.1.3 (Debian 1:1.1.3-4) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    /bin/sh: can't access tty; job cintrol turned off
    (initramfs)
    other solution shoud be using debian Live-CD:

    http://live.debian.net/cdimage/etch-...t/i386/iso-cd/

    but don't know howto chroot an existing installation into the new system.

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Quote Originally Posted by cc
    I've tried to create an image using symantec ghost and setup on the other hardware,
    but I'm getting a lot of hardware problems:
    Code:
    Begin: Mounting root file system ... ...
    Begin: Running /scripts/local-top ...
    Done.
    Begin: Waiting for root file system ... ....
    Done.
              Check root= bootcarg cat /proc/cmdline
              or missing modules, devices: cat /proc/modules ls /dev
    ALERT! /dev/hda6 does not exist. Dropping to a shell!
    
    BusyBox v1.1.3 (Debian 1:1.1.3-4) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    /bin/sh: can't access tty; job cintrol turned off
    (initramfs)
    How did you do that? I mean, reaching busybox is a first step. When pushing an image to a machine a busybox limited environment and the right initrd is all you need. That, and netcat, dd, an image and a proper DHCP & TFTP server. I bet Debian has everything on board that you need.

    You might think I'm strange, but I'm doing the same thing on Slackware at the moment and I've got it pretty much figured out. All I need is a way to push the image to several machines at once, cuz there's *cough* a whole pile of machines that need to be installed *cough*


    Does the target have netboot? (that would help )
    If it's just /one/ machine, then a fresh install is the fastest way though. Also more boring, I grand you that
    Can't tell an OS by it's GUI

  3. #3
    cc
    cc is offline
    Linux Newbie
    Join Date
    Jun 2004
    Posts
    120
    and howto update initrd after migration to different hardware ?

  4. #4
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    Do you want copy your system to comletly new machine or you replace your current PC?

  5. #5
    cc
    cc is offline
    Linux Newbie
    Join Date
    Jun 2004
    Posts
    120
    Quote Originally Posted by iwanabeguru View Post
    Do you want copy your system to comletly new machine or you replace your current PC?
    I will copy my system to the completely new machine with a different hardware.

  6. #6
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Quote Originally Posted by cc
    and howto update initrd after migration to different hardware ?
    That shouldn't be necessary, unless the target system is so different that it needs different kernel modules loaded at boot time. IMHO you'd be better off compiling a new kernel if that is the case. But as I said, it shouldn't be necessary.

    Quote Originally Posted by cc
    I will copy my system to the completely new machine with a different hardware.
    How??

    You can use dd to write an image to the target machine's disk, and you will want to take some care not to write over the partition table of the target machine. Basic structure (don't copy&paste!)
    Code:
    dd if=/path/to/mbr.bin of=/dev/hda bs=446 count=1
    dd if=/path/to/image of=/dev/hda1
    This will write the master boot record but preserve the partitioning table (hence 446, rather than 512). And it will write the image to the first partition of the target system.
    This is assuming you already have a partition table on the target machine, otherwise use your favorite *fdisk to create one.


    One thing that could cause trouble is when you use a too narrowly build (custom) kernel, is that it might not recognize all the hardware. There are more elegant ways to cope with this, but a fine mix of trial and error can answer this question just as well.
    Can't tell an OS by it's GUI

  7. #7
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    Hi

    As Freston mentioned you can use dd ,but only that case if the two partititon has same size. Other else case use tar, cp or rsync.

    So place your hard disk into the new computer.
    Boot up with a live cd (Knoppix is a very good stuff)

    Use cfdisk to create the partitons on the new machine's hdd.

    figure out the names of the root partitions
    Code:
    fdisk -l
    will help you.

    Make two mount points on for the new root partition and for the old

    Code:
    mkdir /mnt/newroot
    /mkdir /mnt/oldroot
    mount the partitions may you need to do this manually

    and now simply copy the whole content of oldroot to newroot
    Code:
    cp -a /mnt/oldroot/* /mnt/newroot/
    note: -a is very important.

    one part is done.

    chroot to your new root and install the proper kernel.

    first mount the proc filesystem and bind /dev

    Code:
    mount -t proc none /mnt/newroot/proc
    mount --bind /dev /mnt/newroot/dev
    
    and chroot
    
    chroot /mnt/newroot
    edit your bootloader configuration and install the boot loader

    note:
    If you are using custom kernel it probably won't boot so you must install a generic x86 kernel or the kernel which is the best for your system. You can do it in chroot.

    Good luck

  8. #8
    cc
    cc is offline
    Linux Newbie
    Join Date
    Jun 2004
    Posts
    120
    thx a lot for all answers, I'll try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •