Cloning hd via scripts - Setup

This is a discussion on Cloning hd via scripts - Setup ; Hi there, is it possible to clone a hd using scripts ? I'm trying to write a backup and restore scripts but i have boot problems. The backup script save mbr using dd and both boot and root partitions via ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Cloning hd via scripts

  1. Cloning hd via scripts

    Hi there,
    is it possible to clone a hd using scripts ?

    I'm trying to write a backup and restore scripts but i have boot problems.
    The backup script save mbr using dd and both boot and root partitions via
    tar.
    When i go to restore that files the restored hd doesn't boot, only show
    'GRUB' print.
    The restored hd is larger than the original one.

    I also chroot-ed on the new hd and run grub-install. No errors but when i
    boot, i enter in the grub's shell instead of read the grub.conf file.

    Any idea ??
    Thanks
    --
    SteM



  2. Re: Cloning hd via scripts

    SteM wrote:

    > Hi there,
    > is it possible to clone a hd using scripts ?
    >


    Yes.

    > I'm trying to write a backup and restore scripts but i have boot problems.
    > The backup script save mbr using dd and both boot and root partitions via
    > tar.


    You'll be able to copy the disk using dd, but you'll have to reinstall the
    boot loader using whatever bootloader you use.

    > When i go to restore that files the restored hd doesn't boot, only show
    > 'GRUB' print.


    You have to run grub, to correctly reinstall the loader to the mbr.

    > The restored hd is larger than the original one.
    >


    If you're dd'ing from one drive to the other drive... it's not going to
    work. You're best bet is to boot into single user mode (so it's read only)
    on the source drive then mount the destination drive and cp -av from source
    to destination. Once complete, run grub, but tell grub to write the
    bootloader into the destination mbr. You would now have a mirrored and
    bootable backup.

    > I also chroot-ed on the new hd and run grub-install. No errors but when i
    > boot, i enter in the grub's shell instead of read the grub.conf file.
    >
    > Any idea ??


    Read the grub manual again?

    For information on how to copy a Linux system from one disk to another,
    please see:http://tldp.org/HOWTO/Hard-Disk-Upgrade/index.html

    --

    Jerry McBride (jmcbride@mail-on.us)

  3. Re: Cloning hd via scripts

    Jerry McBride wrote:
    > SteM wrote:
    >
    >> Hi there,
    >> is it possible to clone a hd using scripts ?
    >>

    >
    > Yes.
    >
    >> I'm trying to write a backup and restore scripts but i have boot problems.
    >> The backup script save mbr using dd and both boot and root partitions via
    >> tar.

    >
    > You'll be able to copy the disk using dd, but you'll have to reinstall the
    > boot loader using whatever bootloader you use.


    dd can pull the boat loader, but it's unlikely to properly match your new
    hardware or disk layout.

    >> When i go to restore that files the restored hd doesn't boot, only show
    >> 'GRUB' print.

    >
    > You have to run grub, to correctly reinstall the loader to the mbr.
    >
    >> The restored hd is larger than the original one.
    >>

    >
    > If you're dd'ing from one drive to the other drive... it's not going to
    > work. You're best bet is to boot into single user mode (so it's read only)
    > on the source drive then mount the destination drive and cp -av from source
    > to destination. Once complete, run grub, but tell grub to write the
    > bootloader into the destination mbr. You would now have a mirrored and
    > bootable backup.
    >
    >> I also chroot-ed on the new hd and run grub-install. No errors but when i
    >> boot, i enter in the grub's shell instead of read the grub.conf file.
    >>
    >> Any idea ??

    >
    > Read the grub manual again?
    >
    > For information on how to copy a Linux system from one disk to another,
    > please see:http://tldp.org/HOWTO/Hard-Disk-Upgrade/index.html
    >


  4. Re: Cloning hd via scripts

    Nico Kadel-Garcia wrote:

    > Jerry McBride wrote:
    >> SteM wrote:
    >>
    >>> Hi there,
    >>> is it possible to clone a hd using scripts ?
    >>>

    >>
    >> Yes.
    >>
    >>> I'm trying to write a backup and restore scripts but i have boot
    >>> problems. The backup script save mbr using dd and both boot and root
    >>> partitions via tar.

    >>
    >> You'll be able to copy the disk using dd, but you'll have to reinstall
    >> the boot loader using whatever bootloader you use.

    >
    > dd can pull the boat loader, but it's unlikely to properly match your new
    > hardware or disk layout.
    >


    Geee... so he'll HAVE to reinstall the bootloader!


    --

    Jerry McBride (jmcbride@mail-on.us)

+ Reply to Thread