Announcement

Collapse
No announcement yet.

Booting from second hard disk

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Booting from second hard disk

    Greetings everyone.

    Right now, i have two hard disks: hda and hdb. The boot sector, windows and also grub (i think, i'm not sure about this one) are on hda. Kubuntu is installed on hdb.

    Soon, i'll need to remove hda from my system. WIll i have any problems in booting Kubuntu from the second hard disk? As in, will i need to reinstall it? And how can i create a boot sector on the second hard drive, after removing the first? Is the supergrub disk of any help?

    Thanks in advance for any replies .

    #2
    Re: Booting from second hard disk

    No problems.

    Before you remove the hda drive, you should do the following:

    Install GRUB to the MBR of hdb.
    Do this as follows:

    Open Kubuntu, then K > System > Konsole
    Type sudo grub to get a GRUB prompt that looks like grub>.
    Then, at the prompt, type each of these, each followed by Enter:

    grub> root (hd1,x)
    grub> setup (hd1)

    where x is the partition Kubuntu is in (and that’s where also your GRUB files probably are); if Kubuntu is on the first partition, then x is zero, so then root (hd1,0); if Kubuntu is on the second partition, then x is 1; etc.
    You can find where GRUB is at the GRUB prompt by typing
    grub> find /boot/grub/stage1
    The answers include some (hd1,x) and that is what you want to put in the root statement above.

    So far, GRUB is set up in the Master Boot Record of the hdb drive,

    Now, before you leave the grub>, you need to reset GRUB in the MBR of the hda drive, since that’s how you want the PC to boot up for now (until you remove the hda drive, that is), so, again:

    grub> root (hd1,x) # the same x you found and used above
    grub> setup (hd0)
    grub> quit
    $ exit

    re-boot to test that your PC still boots up OK from the hda drive.

    Now, you have GRUB installed from the GRUB files in Kubuntu to the MBR of each drive, both hda and hdb.

    When you remove the hda drive, you must enter BIOS and set it to boot from hdb..

    Also, you MAY have to set a boot flag in the hdb partition—
    If so, use GParted to do so.
    You may use GParted Live CD or use the GParted in K > System > Gnome Partition editor.

    Open GParted, over on the right, there’s a list of your drives, select the hdb drive (it may be called something else now that hda was removed).
    Highlight the first partition listed.
    Then select at the top
    Partition > Manage flags > boot
    That sets the boot flag on your remaining drive.
    Exit GParted (remove the CD if you used the Live CD GParted).
    Re-boot to test things.


    And, finally, yes, it's a good idea to have Super Grub Disk on hand when you make changes like this. Always!


    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0

    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: Booting from second hard disk

      One more thing - -

      After you remove hda, and set BIOS to boot from hdb, you may still have to adjust your boot menu located in Kubuntu at /boot/grub/menu.lst.
      See the How-To, the first Reply, on how to edit menu.lst as root, the save your edits, File > Save and File > Quit. If necessary, you can use Super Grub Disk to boot into your Kubuntu (there are many ways to do this, but SGD will get you there without having to think very much!).

      The edit you will probably have to make is the root reference to your Kubuntu.
      In menu.lst, locate the line *** Begin Automagic kernels list.
      The boot entries for Kubuntu (Ubuntu) are contained there, up to the line *** End Automagic kernels list.
      Now notice in each boot entry a line
      root (hd1,x)
      then comes kernel and then initrd, etc.
      You need to edit the root (hd1,x) statement.
      When your PC boots from a drive (from ANY drive--an internal drive, external drive, or flash drive), that booting drive is named by BIOS and GRUB as drive hd0.
      So, from the point of view of your GRUB on your (booting) Kubuntu drive, the "new" single drive is hd0.
      Thus, change each root statement to reflect such:
      root (hd0,x)
      in all the boot entries located between *** begin Automagic list and *** End.

      One more thing.
      In your menu.lst find the line
      #groot=(hd1,b)

      Ditto for it.
      You want it to refer to the "new" drive, so it should read
      #groot=(hd0,b)

      (That way, if you get any kernel updates, things will go smoothly, as the groot statement tells GRUB where your kernel is. That is, groot=(hda,b) specifies the hard drive a and the partition b where your Kubuntu kernel is located, where, again, counting starts from zero (not from one); and that partition, for you, will be where your Kubuntu root files are located.)
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: Booting from second hard disk

        So how would you go about doing this?
        Perhaps several ways, so here's just one way:

        Right now, go ahead and set up GRUB in (hd1) as explained above using root (hd1,y)-setup (hd1).

        Then, when you want to remove the first drive, hda, Don't yet!
        Boot into Kubuntu and do the edits to the boot menu, /boot/grub/menu.lst, changing root (hd1,b) to root (hd0,b).
        Then, in Kubuntu, open GParted and set the boot flag on hdb.
        Then shutdown.
        Remove the hda drive.
        Turn the PC on.
        Enter BIOS setup and make sure BIOS is set to boot from the "new" single drive (the old hdb drive).
        Then boot into Kubuntu.

        Am I overlooking anything? You get the idea, right?
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Thanks

          Yes, yes, i get the idea. Thank you for all the info.

          I'll see how it works and if i have any problems, i'll come back with more questions .

          Comment

          Working...
          X