Announcement

Collapse
No announcement yet.

how to boot from internal HD - OR - USB HD?

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

    how to boot from internal HD - OR - USB HD?

    I'd search the forums for an answer to this question, but frankly have no idea how to formulate the search, so here I am.

    I just loaded KB 13.10 onto a 500GiB USB hard drive. I was (perhaps naively) thinking that I could then take it to any computer and boot into my normal working environment.

    However, I found that grub on the machine I'd used to load KB 13.10 to the USB hard drive then was messedup; the box could not boot. Clearly, the MBR (?) was modified, I thought. So, I booted from an ISO DVD and ran the boot-repair utility and set things right. I'm back to normal now.

    Except that now I am unable to boot from the USB hard drive, when I plug it in. Boot is always from the internal HD. I'm guessing that given a set of hard drives attached to a box, only one can have an MBR? And yes, I'm accessing the device menu (in BIOS) at the beginning of the boot and telling the computer to boot from the USB hard drive. And then it doesn't.

    In any case, is there any way I can keep my box functioning normally (booting without the USB hard drive attached) AND opt to boot from the USB drive when I want to?

    Is my only option to load the ISO image onto the USB hard drive (usable idea, but hardly what I was after).

    I don't have all the technical knowledge need to figure this out, but I know there are lots of folks here who do. I look forward to your advice. Thanks!

    #2
    the problem is that you nead to have grub installed to both the HD and the USB/HD ,,,,,,,,,leave it as it is now on the HD ,,,,,,,and if when you install/reinstall the Kubuntu to the usb/HD you have grub installed to the USB/HD's MBR you will be good.

    VINNY
    i7 4core HT 8MB L3 2.9GHz
    16GB RAM
    Nvidia GTX 860M 4GB RAM 1152 cuda cores

    Comment


      #3
      Vinny is correct. With GRUB on both the USB drive and on the Hard Drive you can boot to both or either. In answer to one of your questions: All hard drives have a MBR, although it is often called other things in error. The traditional "old-school" MBR has the boot record (more correctly: Bootstrap Code) and the partition table in the first 512 bytes. GRUB-PC or GRUB2 that we now use (as opposed to GRUB-LEGACY or GRUB1) uses a bit more of the drive so the first 2048 bytes are reserved these days. GPT formatted drives use a different way to record the partition table so have fewer limitations (larger devices, more total partitions, no extended partitions required, etc.) than the older MBR format.

      You'll have to explain in detail what you mean when you say you can no longer boot to the USB drive. Is the GRUB on it failing or not present or is your main computer not able to boot to USB??

      In my view for your setup it might be advisable to have a custom stanza on your main computer that accesses the USB drive boot menu without actually booting to it. Then instead of the step of actually booting to the USB drive (when you're at your main box), you just select it's GRUB menu and boot option. Then you don't have to select boot to USB unless you're transporting your USB drive to a different computer.

      The custom stanza is called /etc/grub.d/40_custom and would look something like:
      Code:
      #!/bin/sh
      exec tail -n +3 $0
      # This file provides an easy way to add custom menu entries.  Simply type the
      # menu entries you want to add after this comment.  Be careful not to change
      # the 'exec tail' line above.
      
      
      menuentry 'USB drive' {
      insmod gzio
      insmod msdos
      search --no-floppy --fs-uuid --set=root <UUID OF USB PARTITION WITH GRUB ON IT>
      configfile /boot/grub/grub.cfg
      }
      In any case, to fix GRUB in your USB drive. Do a grub-install to it from your main box using the --boot-directory option.

      Steps:
      1. Boot up.
      2. Mount /boot from the USB install somewhere.
      2. Do sudo grub-install --boot-directory=/<MOUNT PLACE OF USB /BOOT> /dev/<USB DRIVE DEVICE NAME>


      I could be more specific with the commands if I knew your device names, etc. If we assume your USB drive is /dev/sdb, you use only one partition on it, and you mount it to /media/USBDRIVE, the above commands would be:

      sudo mount /dev/sdb1 /media/USBDRIVE
      sudo grub-install --boot-directory=/media/USBDRIVE /dev/sdb
      Last edited by oshunluvr; Mar 29, 2014, 11:40 AM.

      Please Read Me

      Comment


        #4
        UPDATE & CLOSING: Sorry to have been away for so long, but I've been ill. Back now. Problem solved. I reinstalled Kubuntu (KB) to my USB hard drive (HD), paying very careful attention to marking the first partition of /dev/sdc/ (the USB drive) as "boot", and telling the KB install routine to put boot info. at the front of THAT partition. Worked great. I now have that USB drive regularly booting without a hitch. Very cool.

        Thanks for all the responses and ideas and discussion. Much appreciated.

        Comment

        Working...
        X