Page 1 of 6 123 ... LastLast
Results 1 to 10 of 59

Thread: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

  1. #1
    Join Date
    Jan 2005
    Location
    Minneapolis, MN
    Beans
    510
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    Robertar and I have been trying to get Edgy installed on an external USB HD for a few weeks and had no success. Hopefully this will work for some of you, or at least help.

    Normal install methods weren't working (ie. selecting the USB disk as the install target) because grub would get messed up when installed on the USB drive. Even once grub was installed 'correctly', it would only work on the original computer with the original hard disk configuration. These problems would result in grub errors 15 and 21 .

    The following procedure worked for us, and allowed us to boot on a variety of USB bootable machines. I'm not a grub or Linux expert, so some of my details may be slightly wrong. Please forgive me if they are.

    Installing Linux to an external HD
    ----------------------------------------

    Goal:
    To get Linux to install on an external HD and boot from it on any computer which has a 'boot from USB' BIOS option.

    Resources:
    * HP Compaq dc7600 desktop computer
    * Western Digital 80 Gb USB, bus powered, laptop hard drive
    -- Several other models have now been tested, all have worked, although some drives have required the use of the text based installed available on the alternative install CD.
    * Ubuntu Edgy (6.10) Desktop install CD -- this procedure won't work with 6.06!

    Procedure/Explanation:

    1) Remove all internal hard drives from the computer, or disable the internal hard drives in the BIOS.
    * Grub by default installs to the first hard drive detected by the BIOS. The simplest way to ensure that it installs correctly is to make sure that the only hard drive available is the install target drive.

    2) Connect the USB drive and boot from the Ubuntu CD.

    3) Run the Ubuntu installer
    * Just double-click the 'Install' icon on the desktop.

    3.1) When the installer is done, "Continue using the live CD"

    4) Mount the root partition of the newly installed Ubuntu
    * Run the Gnome Partition Editor (System-->Administration-->GNOME Partition Editor)
    * If running the Gnome Partition Editor doesn't mount the partition open a terminal and do the following:
    Code:
    # Create a directory: 
    mkdir newinstall
    # Mount your new root partition
    sudo mount /dev/sda1 newinstall
    5) On the new root partition, modify the GRUB config file to allow computer-independent booting.
    * It is named boot/GRUB/menu.lst
    * To edit it, open a terminal and type "gksudo gedit " then drag the file to the terminal, then hit return. This edits the file as the super user.
    * Find the line that says "kopt=root=UUID=(Long HEX number here) -- copy the portion from 'root' through the end of the HEX number
    * Find all instances of 'root=/dev/sda1' (where sda1 is the partition you installed to) and replace it with the 'root=....' string you just copied
    * Save and close the file

    5) On the new root partition, modify the GDM startup script to re-detect the graphics card at each login.
    * Edit the GDM (Gnome Desktop Manager) script. It is named etc/init.d/gdm
    * To edit it, open a terminal and type "gksudo gedit " then drag the file to the terminal, then hit return. This edits the file as the super user.
    * Add a blank line after the line that says "start)"
    * On this blank line, enter the text "dpkg-reconfigure -fnoninteractive --no-reload -phigh xserver-xorg" (with no quotes).
    * Save and close the file

    6) Shut down, and you should be set!


    Issues:

    All BIOSs aren't created equal. In the current configuration, GRUB needs to be on hd0. On some computers, selection USB from the BIOS boot menu, USB is made hd0, on others it is not.
    Solution: Set the boot order in the BIOS to be CDROM, USB, First HD
    Last edited by stuporglue; January 15th, 2007 at 05:57 PM. Reason: Updated for clarity and to reflect minor changes.
    My projects and ramblings: http://stuporglue.org
    http://www.mormon.org/bookofmormon -- Free Book of Mormon

  2. #2
    Join Date
    Nov 2006
    Beans
    40

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    I do not have the option to use the USB as a boot option, BUT the external drive does show up as a Hard Drive. Should I leave it as hd0?

    Thank you for this guide.

    Michael

  3. #3
    Join Date
    Jan 2005
    Location
    Minneapolis, MN
    Beans
    510
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    I do not have the option to use the USB as a boot option
    If you don't have an option to do a USB boot, I suspect it's not going to work no matter what. No number of changes on your USB disk is going to allow you to boot from it if your BIOS doesn't support it. If your BIOS does support it, there should be a 'boot from USB' option somewhere.

    OTOH, if you're using Smart Boot Manager or some such to start the boot process, I don't know what you'd have to do. I suspect that you'd still want grub on hd0, but I haven't tried it.
    My projects and ramblings: http://stuporglue.org
    http://www.mormon.org/bookofmormon -- Free Book of Mormon

  4. #4
    Join Date
    Nov 2006
    Beans
    40

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    I installed successfully and chose to continue using live desktop. This is being done on an external Seagate 160 gb hard drive. I unplugged the power supply for the main hard drive to ensure it was only being installed to the external.

    I went to gparted as instructed. The ext3 partition (usbdisk) and the fat32 partitions opened up as you said they probably would. The display for the ext3 partition looked like the following:

    /media/usbdisk/ 
    /media/usbdisk/.╬╔
    /media/usbdisk/.C
    /media/usbdisk/.
    /media/usbdisk/any key.to
    /media/usbdisk/⌠)
    /media/usbdisk/RRaA
    /media/usbdisk/"└t v┤╗.
    /media/usbdisk/δX.fs
    /media/usbdisk/δXmkdos.fs

    Any ideas what to do now.

    One thing I did was before the installation I deleted all existing partitions from the USB drive. This was done successfully but I forgot and left the gparted window open during the install. I will try and re-do the install ensuring the gparted window is closed, but would appreciate any further insights you could give.

    Michael

  5. #5
    Join Date
    Nov 2006
    Beans
    40

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    BTW, I did choose English as the language for the install.

  6. #6
    Join Date
    Jan 2005
    Location
    Minneapolis, MN
    Beans
    510
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    The display for the ext3 partition looked like the following:

    /media/usbdisk/ 
    /media/usbdisk/.╬╔
    /media/usbdisk/.C
    /media/usbdisk/.
    /media/usbdisk/any key.to
    /media/usbdisk/⌠)
    /media/usbdisk/RRaA
    /media/usbdisk/"└t v┤╗.
    /media/usbdisk/δX.fs
    /media/usbdisk/δXmkdos.fs

    ...
    but I forgot and left the gparted window open during the install.
    That looks like something didn't work out right. :-/ If you haven't already done a reinstall with gparted closed, you could run "sudo fdisk -l /dev/sda" where sda is your USB disk. This command will tell you what the partition table is saying.

    The installer opens its own gparted instance and closes it when you move on to the next step. If you had a gparted open the whole time, maybe there was some corruption from having two instances operating on the same disk at the same time?
    My projects and ramblings: http://stuporglue.org
    http://www.mormon.org/bookofmormon -- Free Book of Mormon

  7. #7
    Join Date
    Nov 2006
    Beans
    40

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    Thanks for the reply.

    Okay, i have a completed install now. I gave up doing the manual partitioning and accepted the default wipe of the drive, so I now have a huge ext3 partition and the 2 gig swap partition. I disconnected my internal drive and before booting into the live CD and left the grub to the default location.

    If I do sudo fdisk -1, I get the following information:
    Code:
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       19086   153308263+  83  Linux
    /dev/sda2           19087       19457     2980057+   5  Extended
    /dev/sda5           19087       19457     2980026   82  Linux swap / Solaris
    Now the bad news. Even after I make the changes to the menu.lst file I still get Error 18.

    Code:
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.
    
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default		0
    
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		3
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    hiddenmenu
    
    # Pretty colours
    #color cyan/blue white/blue
    
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    
    #
    # examples
    #
    # title		Windows 95/98/NT/2000
    # root		(hd0,0)
    # makeactive
    # chainloader	+1
    #
    # title		Linux
    # root		(hd0,1)
    # kernel	/vmlinuz root=/dev/hda2 ro
    #
    
    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##      kopt_2_6_8=root=/dev/hdc1 ro
    ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=UUID=53b01304-0084-4685-a06d-023732484307 ro
    # kopt_2_6=root=UUID=53b01304-0084-4685-a06d-023732484307 ro
    
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,0)
    
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true
    
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false
    
    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash
    
    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ##      lockold=true
    # lockold=false
    
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery) single
    # altoptions=(recovery mode) single
    
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all
    
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true
    
    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false
    
    ## ## End Default Options ##
    
    title		Ubuntu, kernel 2.6.17-10-generic
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.17-10-generic root UUID=53b01304-0084-4685-a06d-023732484307 ro quiet splash
    initrd		/boot/initrd.img-2.6.17-10-generic
    quiet
    savedefault
    boot
    
    title		Ubuntu, kernel 2.6.17-10-generic (recovery mode)
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.17-10-generic root UUID=53b01304-0084-4685-a06d-023732484307 ro single
    initrd		/boot/initrd.img-2.6.17-10-generic
    boot
    
    title		Ubuntu, memtest86+
    root		(hd0,0)
    kernel		/boot/memtest86+.bin
    quiet
    boot
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    I would appreciate any assistance in discovering what I did incorrectly. I also made a backup copy of the original menu.lst file which follows:

    Code:
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.
    
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default		0
    
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		3
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    hiddenmenu
    
    # Pretty colours
    #color cyan/blue white/blue
    
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    
    #
    # examples
    #
    # title		Windows 95/98/NT/2000
    # root		(hd0,0)
    # makeactive
    # chainloader	+1
    #
    # title		Linux
    # root		(hd0,1)
    # kernel	/vmlinuz root=/dev/hda2 ro
    #
    
    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##      kopt_2_6_8=root=/dev/hdc1 ro
    ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=UUID=53b01304-0084-4685-a06d-023732484307 ro
    # kopt_2_6=root=/dev/sda1 ro
    
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,0)
    
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true
    
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false
    
    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash
    
    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ##      lockold=true
    # lockold=false
    
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery) single
    # altoptions=(recovery mode) single
    
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all
    
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true
    
    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false
    
    ## ## End Default Options ##
    
    title		Ubuntu, kernel 2.6.17-10-generic
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro quiet splash
    initrd		/boot/initrd.img-2.6.17-10-generic
    quiet
    savedefault
    boot
    
    title		Ubuntu, kernel 2.6.17-10-generic (recovery mode)
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro single
    initrd		/boot/initrd.img-2.6.17-10-generic
    boot
    
    title		Ubuntu, memtest86+
    root		(hd0,0)
    kernel		/boot/memtest86+.bin
    quiet
    boot
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    Thanks,

    Michael

  8. #8
    Join Date
    Jan 2005
    Location
    Minneapolis, MN
    Beans
    510
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    Now the bad news. Even after I make the changes to the menu.lst file I still get Error 18.
    Well, I do see an error in your grub.lst, but Error 18 is:

    18 : Selected cylinder exceeds maximum supported by BIOS
    This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general). (From http://www.gnu.org/software/grub/man...Stage2-errors)
    The error I see is in the kernel lines of your two boot menu options. You have:
    Code:
    kernel		/boot/vmlinuz-2.6.17-10-generic root UUID=53b01304-0084-4685-a06d-023732484307 ro single
    You need:
    Code:
    kernel		/boot/vmlinuz-2.6.17-10-generic root=UUID=53b01304-0084-4685-a06d-023732484307 ro single
    The line should be root=UUID=HEXNUMBERHERE
    My projects and ramblings: http://stuporglue.org
    http://www.mormon.org/bookofmormon -- Free Book of Mormon

  9. #9
    Join Date
    Nov 2006
    Beans
    40

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    I made that change to the menu file and rebooted but it didn't make a difference.

    What is weird is that I had Edgy installed on this computer and it worked fine BUT I wanted to reinstall XP AND I wanted the Edgy install not to be dependent on the internal Hard Drive SO I made the fateful decision to try and reinstall Edgy two days ago.

    Does that seem like it may be more of a Grub error?

    Thanks for all the help,

    Michael

  10. #10
    Join Date
    Jan 2005
    Location
    Minneapolis, MN
    Beans
    510
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: How to install Ubuntu Edgy to USB, to boot from any USB bootable machine

    Does that seem like it may be more of a Grub error?
    Yeah, I'd have to guess it's a GRUB/BIOS error. Since GRUB is saying you're asking to boot from beyond what the BIOS can handle, I think you're in for some more work if you want it to all work out properly.

    This may be getting beyond this thread, but I think if you put /boot as a smaller partition at the start of your hard drive, it might work.

    BIOS would only have to work with the smaller /boot partition, and Linux would mount the other partition as root and maybe work fine.

    I've never had to do that, but I think that's how it was always done in the old timey Linux days.
    My projects and ramblings: http://stuporglue.org
    http://www.mormon.org/bookofmormon -- Free Book of Mormon

Page 1 of 6 123 ... LastLast

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
  •