Solved

How to boot on Ubuntu installed on external USB drive?

Posted on 2010-09-06
27
692 Views
Last Modified: 2013-12-15
Hello,

I've installed Ubuntu on a SATA hard disk that I've put in an USB device to transform it in a USB drive.

My internal drive has Windows XP installed on it.

How can I boot in Ubuntu when I connect my USB drive?

Enclosed are screenshots of my attempt to boot on USB drive:
 Boot on USB drive Try to boot from Ubuntu using grub
Thanks
0
Comment
Question by:JulienVan
  • 9
  • 8
  • 5
  • +3
27 Comments
 

Expert Comment

by:Mavrickk
ID: 33613049
jbjkgbgiufufvlfvligikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkh
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33613084
from the second screenshot you seem to have got into the bootloader
looks like you need to do more, have a read of this grub bootloader tutorial http://www.linuxjournal.com/article/4622
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33613088
I haven't got your setup but check out the ubuntu forums https://help.ubuntu.com/community/GrubHowto
0
 
LVL 3

Expert Comment

by:ssapkota
ID: 33613229
Enter the following command, when you get the screen as shown in your second screenshot.
grub> root (hd1,0)
grub> kernel /vmlinuz
grub> initrd /initrd.img
grub> boot
0
 
LVL 2

Expert Comment

by:tmaleshafske
ID: 33614425
Have you installed Ubuntu on your usb drive? or are you working with a bootable usb drive with a live version of ubuntu on it?  Also take a look at Unetbootin
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33615425
Thanks for you comments guys, I'll take a look at your links for understanding how grub is working.

@ssapkota: I tried your commands, but the kernel command seems to not be known, as you can see on enclosed image

@tmaleshafske: I've installed Ubuntu on my USB drive. But it wasn't USB when I installed it, it was my primary and unique HDD. I then connected it as a USB drive on my laptop with Windows XP.

I'd really like to boot on my USB drive where is installed Ubuntu without modifying the boot sector of my primary internal drive where is installed Windows XP.
IMAG0152.jpg
0
 
LVL 3

Assisted Solution

by:ssapkota
ssapkota earned 100 total points
ID: 33615850
@JulienVan
It seems that you need to use linux in place of kernel.
so the steps would be:
grub> root (hd1,0)
grub> linux /vmlinuz
grub> initrd /initrd.img
grub> boot

To know more on grub2:
http://ubuntuforums.org/showthread.php?t=1195275
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33616601
@ssapkota: Thank you for your help, I went further by using the linux command, but I still have some errors, as you can see on enclosed screenshot.
I'll take a look on all the documentation this evening.
IMAG0154.jpg
0
 
LVL 3

Expert Comment

by:ssapkota
ID: 33616970
Have you successfully booted into the USB device earlier?

Can you boot successfully if you follow following steps:
- Plug out the Hard drive (where you have installed windows).
- Now try and boot into the ubuntu from external USB drive.
0
 
LVL 18

Accepted Solution

by:
TobiasHolm earned 300 total points
ID: 33618019
Hi!

With your external USB-drive plugged in, boot an Ubuntu LiveCD and start a terminal window. Check which disk/partition you want to mount:

sudo fdisk -l

you can also use the "DiskUtil" to see the name of your USB drive (see pic).

Mount the partition and set it as root (I use sda1 in the example below, but you have to check carefully to point at your external USB drive!):

sudo mount /dev/sda1 /mntsudo mount –bind /dev /mnt/devsudo chroot /mntsudo update-grub

Regards, Tobias
1DiskUtil.gif
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33619137
@tobias: Thanks for your suggestion, I tried but I obtain following error when trying to mount the drive
Screenshot-250-GB-Hard-Disk--TOS.png
mount-attempt.png
0
 
LVL 3

Expert Comment

by:ssapkota
ID: 33619249

Mind the space. There's no space between /dev/sdb1 and /mnt

sudo mount /dev/sda1 /mnt
sudo mount –bind /dev /mnt/dev
sudo chroot /mnt
sudo update-grub
0
 
LVL 3

Expert Comment

by:ssapkota
ID: 33619264
Sorry, its sdb in your case:
sudo mount /dev/sdb1 /mnt
sudo mount –bind /dev /mnt/dev
sudo chroot /mnt
sudo update-grub
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33619315
Yes, try again with a space!
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 100 total points
ID: 33619441
I was reading up more on grub within the ubuntu forums and found this article which may be helpful for you https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
Look for CLI to boot/Boot a Specific Kernel Manually
But some of the stuff in there has already been posted here so dont want credit for that, its just fyi for troubleshooting.
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33619510
Sorry you were right, I forgot the space.
The commands cause following errors, would you know why?
Screenshot1.png
Screenshot2.png
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33619539
Can you boot into your Ubuntu from the external hard drive? If so:

"If you had alternate OS entries, update-grub might say "Cannot find list of partitions!". Ignore it and continue - once you can boot into your linux installation, do so and then rerun update-grub and grub-install /dev/sdb as root. " - But first check that your external hard drive still is sdb!!!

Regards, Tobias
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33619669
@Tobias: It worked !
I had a message telling that it couldn't mount (hda, 1) twice but it then booted successfully under my Ubuntu.

Enclosed is a screenshot of the terminal after having entered the commands you told me.

I'm going to reboot without my USB HDD to check that Windows still boots correctly.
grub-install.png
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33619854
Good news, when I booted without the USB drive, Windows loaded correctly.

Bad news, when I restarted the computer with the USB drive connected and chose to boot from USB device, the grub terminal opened and I still have the same errors when entering the grub commands, as you can see on these screenshots.
IMAG0160.jpg
IMAG0163.jpg
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33619924
ok.

Can you try do the process again, but don't run the last command (sudo grub-install /dev/sdb)?

boot an Ubuntu LiveCD and start a terminal window. Then run:

sudo mount /dev/sda1 /mnt
sudo mount –bind /dev /mnt/dev
sudo chroot /mnt
sudo update-grub

Boot the machine on the USB-disk, start a terminal window. Then run:

sudo update-grub

Regards, Tobias
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33619929
and in your case, it should be sdb!!

sudo mount /dev/sdb1 /mnt
sudo mount –bind /dev /mnt/dev
sudo chroot /mnt
sudo update-grub
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33619940
and it always best to check with

sudo fdisk -l

before you run the 'sudo mount /dev/sdb1 /mnt' command!
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33620734
Thanks Tobias, it works like a charm. Except that following error message appears twice before executing Ubuntu:
error: hd0, 1 out of disk

Do you think that it can cause some problems? Or maybe affect the boot sector of Windows?
Is it sure that booting on Ubuntu using this method will not damage my Windows system in the future?
Can I mount the windows drive to read and write files on it with no risk?

Thanks again!
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33621263
What Ubuntu version do you have on your external USB drive? This error might be a bug when booting from external drives.

Ref: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/477430

Regards, Tobias
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33621399
It is version 10.04.
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33621480
ok, yes the bug affected 10.04 as well. Maybe you can boot even though you're getting the error? I know it's irritating to have error messages, but I'm afraid I don't know what's causing the error.

You could start Grub in command line mode and then run the boot commands step by step to see which one is causing the error. Then you can edit the /etc/grub.d/10_linux file if you find out which commands should be removed to get rid of the error. And after this run 'sudo update-grub'.

Regards, Tobias
0
 
LVL 2

Author Comment

by:JulienVan
ID: 33624207
OK I'll take a look at this when I'll have some times. I'm closing the question, thanks for your help everyone!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now