• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

How to boot on Ubuntu installed on external USB drive?

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
JulienVan
Asked:
JulienVan
  • 9
  • 8
  • 5
  • +3
3 Solutions
 
MavrickkCommented:
jbjkgbgiufufvlfvligikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkh
0
 
rockiroadsCommented:
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
 
rockiroadsCommented:
I haven't got your setup but check out the ubuntu forums https://help.ubuntu.com/community/GrubHowto
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ssapkotaCommented:
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
 
tmaleshafskeCommented:
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
 
JulienVanAuthor Commented:
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
 
ssapkotaCommented:
@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
 
JulienVanAuthor Commented:
@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
 
ssapkotaCommented:
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
 
TobiasHolmCommented:
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
 
JulienVanAuthor Commented:
@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
 
ssapkotaCommented:

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
 
ssapkotaCommented:
Sorry, its sdb in your case:
sudo mount /dev/sdb1 /mnt
sudo mount –bind /dev /mnt/dev
sudo chroot /mnt
sudo update-grub
0
 
TobiasHolmCommented:
Yes, try again with a space!
0
 
rockiroadsCommented:
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
 
JulienVanAuthor Commented:
Sorry you were right, I forgot the space.
The commands cause following errors, would you know why?
Screenshot1.png
Screenshot2.png
0
 
TobiasHolmCommented:
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
 
JulienVanAuthor Commented:
@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
 
JulienVanAuthor Commented:
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
 
TobiasHolmCommented:
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
 
TobiasHolmCommented:
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
 
TobiasHolmCommented:
and it always best to check with

sudo fdisk -l

before you run the 'sudo mount /dev/sdb1 /mnt' command!
0
 
JulienVanAuthor Commented:
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
 
TobiasHolmCommented:
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
 
JulienVanAuthor Commented:
It is version 10.04.
0
 
TobiasHolmCommented:
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
 
JulienVanAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 9
  • 8
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now