Results 1 to 9 of 9

Thread: How to prevent grub to boot from backup HD

  1. #1
    Join Date
    Oct 2008
    Beans
    8
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    How to prevent grub to boot from backup HD

    Hello,

    I have WinXP (for games only) and Ubuntu 9.04 on the same harddisk. I also have a mirror disk (same size and same brand as the other one) made with clonezilla that i would use as a backup.

    Booting with grub is no problem, but if my external USB HD (seagate agentpro) is on, grub seems to boot from the mirror disk. So i am loosing some of the changes made under linux and i'm back on from the day i made the backup on the mirror disk (or is it an old session saved somewhere ?). If the external USB HD is off when booting i got everything back as normal.

    Thing to know:

    -In the Bios i turned off the boot sequence to USB and also from the secondary HD.
    -There is no operating system on the USB-HD


    The simple solution i'm looking to try is a grub commands that i could add in the menu.lst that could prevent booting from the mirror disk. Anyone knows?

    Thanks

    Mike
    Last edited by Mikkee; May 21st, 2009 at 03:49 AM.

  2. #2
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to prevent grub to boot from backup HD

    When you clone a partition, it is copied EXACTLY--including the UUID. So you have two / partitions with the same #, and grub is booting the first one it finds. Change the UUID for the clone partition on the USB:

    sudo tune2fs -U random /dev/sdb1
    or whatever the usb is

    (if you want to boot the clone don't forget to edit /etc/fstab and /boot/grub/menu.lst so the UUIDs match)

  3. #3
    Join Date
    Oct 2008
    Beans
    8
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to prevent grub to boot from backup HD

    Thank you very much for the quick respond.


    The mirror is effectively on the sdb but just to make sure and to understand, as this disk is partitioned: winXP is on sdb1 and Linux on sbd2 but the boot sector remain for both OS on the sbd1 so the code...

    sudo tune2fs -U random /dev/sdb1
    ...remains good in my situation? And this has to be done after each cloning right?


    Thanks again

    Mike

    The usb Hd is actually the 3rd hd taking place in my system so it may not be a major factor.

  4. #4
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to prevent grub to boot from backup HD

    Quote Originally Posted by Mikkee View Post
    winXP is on sdb1 and Linux on sbd2 but the boot sector remain for both OS on the sbd1 so the code...

    ...

    The usb Hd is actually the 3rd hd taking place in my system so it may not be a major factor.
    in that case, then you want to do

    sudo fdisk -l

    (just to make sure the usb with the clone is /dev/sdb.)
    sudo tune2fs -U random /dev/sdb2

  5. #5
    Join Date
    Apr 2007
    Location
    USA
    Beans
    1,043

    Re: How to prevent grub to boot from backup HD

    If that doesn't work, the other option would be to change /boot/grub/menu.lst not to use the UUID.

  6. #6
    Join Date
    Oct 2008
    Beans
    8
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to prevent grub to boot from backup HD

    Master disk
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    Disk identifier: 0xd6ded6de

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 40544 325669648+ 7 HPFS/NTFS
    /dev/sda2 40545 60801 162714352+ 5 Extended
    /dev/sda5 40545 59974 156071443+ 83 Linux
    /dev/sda6 59975 60801 6642846 82 Linux swap / Solaris

    Clone disk
    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    Disk identifier: 0x7281076d

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 40544 325669648+ 7 HPFS/NTFS
    /dev/sdb2 40545 60801 162714352+ 5 Extended
    /dev/sdb5 40545 59974 156071443+ 83 Linux
    /dev/sdb6 59975 60801 6642846 82 Linux swap / Solaris

    USB disk
    Disk /dev/sdc: 320.0 GB, 320072933376 bytes
    Disk identifier: 0x000decdf

    Device Boot Start End Blocks Id System
    /dev/sdc1 1 22403 179952066 7 HPFS/NTFS
    /dev/sdc2 22404 38912 132608542+ f W95 Ext'd (LBA)
    /dev/sdc5 22404 38912 132608511 7 HPFS/NTFS
    Note that the USB shouldn't have the clone of any of the above disks, it is used only for downloads and documents backup. But used to have a Ubuntu 8.10 installation previously.
    Last edited by Mikkee; May 22nd, 2009 at 10:08 PM. Reason: forgot to tell something that could be important

  7. #7
    Join Date
    Oct 2008
    Beans
    8
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to prevent grub to boot from backup HD

    Quote Originally Posted by maybeway36 View Post
    If that doesn't work, the other option would be to change /boot/grub/menu.lst not to use the UUID.

    This could be interesting too, as long as i still have the choice of the booting device via the bios and i can change the from master to clone. What do i have to do so the UUID will be ignored ? Just delete it in the menu.lst? Is there any risks?
    Last edited by Mikkee; May 22nd, 2009 at 10:11 PM.

  8. #8
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to prevent grub to boot from backup HD

    Quote Originally Posted by Mikkee View Post
    This could be interesting too, as long as i still have the choice of the booting device via the bios and i can change the from master to clone. What do i have to do so the UUID will be ignored ? Just delete it in the menu.lst? Is there any risks?
    With 3 disks (one usb), I wouldn't use '/dev/sdxy' format (-->boot sequence and recognition of devices/assigning of drive letters)...

  9. #9
    Join Date
    Oct 2008
    Beans
    8
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to prevent grub to boot from backup HD

    ok, in my situation, the command work with

    sudo tune2fs -U random /dev/sdb5
    At this time i can't tell if the will resolve my problem. I just found out after I post my 1st message that the problem didn't come if the USB was on or off, but it was simply sporadic


    (if you want to boot the clone don't forget to edit /etc/fstab and /boot/grub/menu.lst so the UUIDs match)

    Now, how can i find the new UUID for the clone disk?
    Last edited by Mikkee; May 23rd, 2009 at 05:21 AM.

Tags for this Thread

Bookmarks

Posting Permissions

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