Find the answer to your Linux question:
Results 1 to 9 of 9
Dear board, The last few years I used a hard disk copy as backup to replace the original one if it would fail. Now I updated my debian system (debian ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5

    hard disk copy and grub2 / udev


    Dear board,

    The last few years I used a hard disk copy as backup to replace the original one if it would fail.
    Now I updated my debian system (debian 6.0.3 currently) to
    grub2 / udev and my hard disk copy refuses to boot (stops at "GRUB").
    I somehow expected this from what I read about udev and the use of UUID instead of partition names.
    My question is if I understood this correctly and where I should
    start to get things working again.

    Thanks,
    Matthias Kievernagel

  2. #2
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218
    Welcome!

    Now I updated my debian system (debian 6.0.3 currently) to grub2 / udev and my hard disk copy refuses to boot (stops at "GRUB").
    The transition from grub legacy to grub2 isn't always smooth. The shortest route is booting a Debian 6.0.3 install CD and using Rescue Mode to reinstall grub2 to the MBR. There'll be some questions then it'll ask you to select Debian's root partition. After that, you can select 'Reinstall GRUB bootloader'

  3. #3
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5
    @fanderal:
    I think you missed the word "copy" in my post.
    The original debian 6.0.3 is up and running with
    grub2 / udev. So no transition problem here.

    Thanks,
    Matthias Kievernagel

  4. #4
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218
    Your question was about booting the backup copy, yes? If not, I guess I did misunderstand.

    Is the backup copy on the same HD as the original? On a 2nd HD? Is it a single or multiple partition backup?

  5. #5
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5
    backup is on a second HD (same layout, manufacturer, etc...)

    backup is done from booting a tools CD (knoppix):
    dd if=/dev/hda of=/dev/hdc count=1 bs=512
    dd if=/dev/hda1 of=/dev/hdc1
    ...
    dd if=/dev/hda8 of=/dev/hdc8

    excecpt for hda2 (swap) and hda3 (old stuff, will not be mounted)

    this procedure worked earlier, i.e. I could replace the original HD
    by the copy and boot it.

    Fails to work now after updating debian to use grub2/udev.

    In the meantime I looked a bit around and found out
    that you need not use UUID in fstab. On the first try
    I somehow assumed you have to use UUID now.
    So I replaced all UUID=xxxx by /dev/sdaN in fstab.
    Secondly I set
    GRUB_DISABLE_LINUX_UUID=true
    in /etc/default/grub, rebuilt /boot/grub/grub.cfg
    and re-installed grub in MBR.
    Unluckily that didn't work (quick and dirty try, though)
    Will retry more thoroughly later and report.

    Thanks,
    Matthias Kievernagel

  6. #6
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5
    """"
    Dear Moderator,
    after re-examining the board descriptions
    I think my thread would be better located in "Installation"
    than here. Would it be possible to move it, please ?
    """""


    I think I have a first problem identified.

    From grub doc:
    On PC systems using the traditional MBR partition table format,
    the core image is usually installed in the "MBR gap" between the
    master boot record and the first partition, or sometimes it is
    installed in a file system and read directly from that. The...
    My hard disk copy only copied the MBR. (see earlier post)

    Unluckily:
    # grub-install /dev/sda
    Installation finished. No error reported.
    offers no hint where grub-install copies the image.
    Anyone knows how to get information about that?
    Or how large the "MBR gap" is and where it is located ?

    Thanks,
    Matthias Kievernagel

  7. #7
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by mkiever View Post
    Dear Moderator, after re-examining the board descriptions I think my thread would be better located in "Installation" than here. Would it be possible to move it, please ?
    Thread moved...
    oz

  8. #8
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218
    A few more questions so I understand what's what and where...
    Code:
    dd if=/dev/hda1 of=/dev/hdc1
    dd if=/dev/hda8 of=/dev/hdc8
    
    excecpt for hda2 (swap) and hda3 (old stuff, will not be mounted)
    hda1/hdc1 = root?
    hda8/hdc8 = home?

    Does hdc have other OSs on it that are bootable from grub? Or is it used as a backup-only hard disk?

    When the default OS is booted on hda, as normally used... is the 2nd hard disk (hdc) connected and in the case? In the case and disconnected? Out of the case?

    If a second hard disk is used and normally connected, and an OS and grub are installed to it, grub reassigns the second hard disk as the MBR. In other words, there can be only one hard disk used as the MBR for all the other hard disks which have bootable OSs.

    If a second hard disk is not normally connected, and has backup copies of OS/s from the first hard disk, the backup copy may not boot because grub may not have assigned UUIDs to the partitions. More importantly, grub can't differentiate between the same UUIDs, original and copy, for two different OSs on different partitions and on different hard disks. So grub boots the OS with the correct path: the original.

    Hope I've been clear and this makes sense... in the event your default OS on hda breaks, the backup solution will likely depend on whether or not the 2nd hard disk is normally connected. What's your plan for this kind of event?

  9. #9
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5
    Working now.
    Copying the gap between MBR and first partition did it.
    Apparently grub2 installed something there...

    I don't know if the other thing (moving away from UUID)
    was necessary. Didn't re-check that.

    @fanderal:
    second hd is backup-only and safely stored away.
    at boot time there is always (nearly) only one hd and then it is hda.
    when there are two hds for copying, I'm booting
    from a tools CD (knoppix).
    Thanks for the hints.

    @ozar:
    Thanks for moving this.
    Last edited by mkiever; 12-16-2011 at 09:52 AM. Reason: forgot thanks

Posting Permissions

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