Professional Web Applications Themes

Install GRUB on 2nd hard drive. - Linux Setup, Configuration & Administration

Hello, I have two hard drives inside a machine that I'm working on that are identical drives. I've created a script that can be run on as a cron job that dumps and restores the contents of each partition to the secondary (lifeboat) disk into the same partitions. Ex: hda1 -> hdb1, etc. The problem that I'm running into now, however, is how to install the grub bootloader onto the SECOND internal hard drive so that if I selected I wanted to boot up from it, it would load as normal. I've verified all of the DATA has been copied, ...

  1. #1

    Default Install GRUB on 2nd hard drive.

    Hello,

    I have two hard drives inside a machine that I'm working on that are
    identical drives. I've created a script that can be run on as a cron
    job that dumps and restores the contents of each partition to the
    secondary (lifeboat) disk into the same partitions. Ex: hda1 -> hdb1,
    etc.

    The problem that I'm running into now, however, is how to install the
    grub bootloader onto the SECOND internal hard drive so that if I
    selected I wanted to boot up from it, it would load as normal. I've
    verified all of the DATA has been copied, so I'm guessing it's just
    the boot sector that needs to be installed.

    I've looked around for instructions on doing this, however most of the
    threads I found dealt with W2K/XP installations that are dual-boot
    configurations which this, of course, is not.

    On Solaris, for example, I would just run:

    installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
    /dev/rdsk/c0t2d0s0

    Any suggestions on how to get this to work?

    Stuart
    Stuart Guest

  2. #2

    Default Re: Install GRUB on 2nd hard drive.

    com (Stuart) writes:
     
     

    Why not " dd if=/dev/hda of=/dev/hdb (with perhaps bs=1M for speed)

    That would solve your Problem too:
     

    Or simply " dd if=/dev/hda of=/dev/hdb bs=512 count=1 " to just copy
    the MBR.

    Good luck, Holger
    Holger Guest

  3. #3

    Default Re: Install GRUB on 2nd hard drive.

    On Fri, 05 Dec 2003 at 18:07 GMT, Stuart eloquently wrote: 
    grub-install /dev/hdb
    see grub-install manpage for the gory details.

    --
    N.Emile...
    --
    Registered Linux User # 125653 (http://counter.li.org) | Please remove
    Certified: 75% , 42% of which is tard. | '.invalid'
    http://www.thespark.com/test | to reply.
    Switch to: http://www.speakeasy.net/refer/190653
    ne... Guest

  4. #4

    Default Re: Install GRUB on 2nd hard drive.

    On 5 Dec 2003 10:07:28 -0800, com (Stuart) wrote:
     

    .... really?!?!?! you've checked the grub manual?
    http://www.linuxselfhelp.com/gnu/grub/html_chapter/grub_3.html#SEC7
    --
    /// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
    \\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
    Intolerance is the last defense of the insecure.
    mjt Guest

  5. #5

    Default Re: Install GRUB on 2nd hard drive.


    "Stuart" <com> wrote in message
    news:google.com... 

    Do *NOT* use dump/restore. Newer OS's have files open in cache that are not
    yet written to disk, and dump will miss these because it reads the disk
    directly.

    Mount your second drive and use "rsync" or maybe "tar" instead, then unmount
    it.
     

    Life gets interesting here. You'll need to modify some things between the
    disk images, such as /etc/fstab, in order to mount things correctly unless
    you actually physically swap the drives. This also includes your grub.conf
    or lilo.conf and your boot loader.
     

    OK. Edit your "grub.conf" to include a second set of boot options using the
    exact same kernel but using "hd1" instead of "hd0". Then make sure that you
    install the boot loader to both /dev/hda and /dev/hdb (assuming your second
    drive is at /dev/hdb).

    Actually, to improve file transfer speeds, make sure your second drive is
    not on the same IDE controller: put it on /dev/hdc (assuming you're using an
    IDE machine...).


    Nico Guest

  6. #6

    Default Re: Install GRUB on 2nd hard drive.


    "Holger Petersen" <org> wrote in message
    news:bqqm2e$vdp$org... 

    >
    > Why not " dd if=/dev/hda of=/dev/hdb (with perhaps bs=1M for speed)
    >
    > That would solve your Problem too:[/ref]

    Why don't you print out your email and sky write it to me, then fax me the
    picture? That's about as efficient.

    This messes up files that are in cache and not written to disk, it doesn't
    deal with disks of different size, it wastes huge amounts of time
    duplicating unused space on disk and all your swap, etc., etc.
     
    >
    > Or simply " dd if=/dev/hda of=/dev/hdb bs=512 count=1 " to just copy
    > the MBR.[/ref]

    Which won't work, primarily because without additionalal attention the
    master boot record will not know to boot off the second disk. This only
    works if you physically swap the disks, or if you add a secondary boot
    option to the lilo.conf or grub.conf file and set your MBR with that.


    Nico Guest

Similar Threads

  1. GRUB can't see the hard drive, booting windows fail in dual bootenviroment
    By Kamal in forum Linux Setup, Configuration & Administration
    Replies: 2
    Last Post: November 19th, 04:53 PM
  2. need help with hard drive install
    By carolynn in forum Mac Applications & Software
    Replies: 2
    Last Post: July 30th, 03:13 PM
  3. grub-install can't find BIOS drive
    By Amy Tanner in forum Debian
    Replies: 0
    Last Post: July 24th, 12:20 PM
  4. Replies: 7
    Last Post: July 13th, 03:05 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139