LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 04-26-2007, 09:42 PM   #1
Agent942
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
Unhappy Installing Ubunto 7.04 on External USB drive, to boot from and run from - Error 17?


I like Ubuntu... quite cool. If I had the option to forget Windows XP Pro forever, I would (unfortunately I support Windows XP Pro as a desk-side support tech and can't just blow it away

So - the solution I figure is to install a full version of Ubuntu 7.04 directly to my external 20GB USB Hard Drive and when I want to use it, I just plug it in and boot from the USB drive.

Sounds sooooo simple. I even researched this and found several people who had apparently, successfully done this.

However, the one thing I do not want, if GRUB on my laptop's internal drive - I want it to appear on my USB drive and to pretty much ignore my internal drive (to have file-level access is a nice touch, but if I can't have that then so be it).

I have tried installing Ubuntu 7.04 (using the graphical installer, guided partitioning and all) and the problem appears to be with the little "Advanced" button that tells me where GRUB will go. It defaults to say (hd0) (brackets and all) so asI have read in many places I have tried using the following list of variables (each time I try the install):

/dev/sdb
/dev/sdb1
(sdb)
(sdb1)
./dev/sdb

From what I read in the information for the drives and such from the guided partitioning, my internal hard drive appears as /dev/sda and the USB External appears as /dev/sdb

However, when the install completes "successfully" and I restart my machine (removing the Ubuntu CD) I get a Grub Error 17: Can not mount

I admit - I'm a Windows guy - I fix problems with Windows that would make your hair go white, but this one simple issue (and I do believe it is SIMPLE) boggles my mind.

Your assistance brings you good karma!

Thanks!
 
Old 04-27-2007, 03:12 AM   #2
rocket777
Member
 
Registered: Apr 2007
Posts: 31

Rep: Reputation: 15
I'm no expert for sure, but I've been thinking about how one could have a system on a usb drive and boot it on anyone's computer.

Here's some things to consider:

1. When you run install in ubuntu, you are running in full linux and usb drives should auto mount. At that point, any partitioning software should be able to see anything mountable and so you can install on a usb drive.

2. But I wonder if grub is smart enough to find a usb file system. It's still just a boot image, not full linux yet. Sort of like in windows, the ntldr isn't smart enough (that I know) to boot off a usb drive.

3. Grub was the first linux boot loader that could even find it's configuration script by having enough file system know-how to read directories and files. But finding a usb file system might be a bit too much for a little boot sector program like grub. I would expect this to be addressed, though, at some future time, if it's not there already - but I just haven't heard about it.

On the other hand, I know booting off of thumb drives is a hot topic, so maybe the above complications have already been addressed.

Good luck, great plan!
 
Old 04-27-2007, 04:13 AM   #3
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Desktop- Debian Lenny, Laptops- Ubuntu 8.10, Debian Lenny UMPC- Ubuntu 8.10
Posts: 1,297

Rep: Reputation: 55
Quote:
Originally Posted by rocket777
I'm no expert for sure, but I've been thinking about how one could have a system on a usb drive and boot it on anyone's computer.
The easiest thing of course, would be to use a Live CD..

If you're going to boot 1 pre-configured distro on different PC's, it will probably work, but you'll likely want to stay away from pre-configured, proprietary drivers. If you install Nvidia drivers for your system, and try to boot the install on a PC Intel graphics, it could cause some issues(or it could not). Thats the only prob I'd see with doing it this way.

Install whatever distro you're wanting to the USB drive, then use the "Super Grub Disk". to create a bootable disk(floppy or CD), and point that grub file to the distro on your USB drive. When you want to boot it on another computer, simply insert your USB device, restart with your boot disk in the appropriate drive and make sure the BIOS sees it before the hard drive, Grub loads, boot your distro. You could also keep a copy of Grub on the USB device, and if the PC is capable of booting a USB device, just change the BIOS to boot your USB device.

Super Grub Disk...

http://users.bigpond.net.au/hermanzo...bDiskPage.html
 
Old 04-27-2007, 08:07 AM   #4
Agent942
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by IndyGunFreak
The easiest thing of course, would be to use a Live CD..

If you're going to boot 1 pre-configured distro on different PC's, it will probably work, but you'll likely want to stay away from pre-configured, proprietary drivers.

...

You could also keep a copy of Grub on the USB device, and if the PC is capable of booting a USB device, just change the BIOS to boot your USB device.
Ok, I have no interest in running this USB External hard drive with Ubuntu 7.04 on any other computer but my laptop. The reasons behind running this off of an external (rather than my internal hard drive) are:
1) my internal drive is barely enough for my Windows installation, and
2) I really don't want anything else on my internal drive.

The second part I've quoted is EXACTLY what I want to do - Have the External drive be the bootable item (my bios supports booting from an external USB drive) and this is what I've been trying to do!

However, everytime I go to boot (and I know Grub is loading from the external drive, as I've checked that it didn't install to my internal drive) and it brings up a boot menu, but when I go to choose the first item (to boot Ubuntu) I get the dreaded Error 17: Cannot Mount Selected Partition

Is there perhaps some editing I need to do to Grub to get it to see what it needs to see?

Thanks again for any and all responses!
 
Old 04-27-2007, 04:53 PM   #5
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Desktop- Debian Lenny, Laptops- Ubuntu 8.10, Debian Lenny UMPC- Ubuntu 8.10
Posts: 1,297

Rep: Reputation: 55
Quote:
Originally Posted by Agent942
Ok, I have no interest in running this USB External hard drive with Ubuntu 7.04 on any other computer but my laptop. The reasons behind running this off of an external (rather than my internal hard drive) are:
I was actually referring to the quoted post by rocket.

Regardless..

http://www.uruk.org/orig-grub/errors.html

I'm not really sure what that means, but it will give you something to start with.

IGF
 
Old 04-30-2007, 02:40 PM   #6
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
I got this working recently, exactly what you're trying to accomplish. I missed the part of the installer for selecting where to install GRUB to so I ended up with it on my internal. I had to fix that (easy enough) and then:

1. booted the Ubuntu CD again and enter a Terminal
2. mounted the USB disk
3. cd to where it's mounted (e.g. /media/sda)
4. use the command 'sudo chroot .'
5. edit the file /boot/grub/device.map to look like
(hd0) /dev/sda
(hd1) /dev/hda
6. use the command 'sudo grub-install /dev/sda'
7. use the command 'exit' to return to the normal terminal shell

Your particular error I think is related to #5. They key to #5 is to have hd0 mapped to the USB disk. If you do want to make it more portable:

8. change the xorg.conf to use only a generic vesa driver and remove the PCI device specification
9. Edit fstab and remove or comment the line that mounts /dev/hda (the internal drive)

With these edits I was able to take it to a different machine and boot it successfully. Warning: It seems to be increasingly well-known that Feisty doesn't work on some Dell machines.
 
Old 04-30-2007, 05:30 PM   #7
Agent942
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dracolich
I got this working recently, exactly what you're trying to accomplish. I missed the part of the installer for selecting where to install GRUB to so I ended up with it on my internal. I had to fix that (easy enough) and then:

1. booted the Ubuntu CD again and enter a Terminal
2. mounted the USB disk
Thanks for this - however I'm still a n00b with "mounting" and don't quite know how to "mount" a drive (man, do I feel stupid typing this though)

Quote:
Originally Posted by dracolich
Your particular error I think is related to #5. They key to #5 is to have hd0 mapped to the USB disk.
I think you have this exactly - its funny how I've seen all these postings everywhere on how this could be done so easily, but its also funny how so many people take their knowledge for granted!

I can now use Linux at my leisure without disrupting Windows, until the time that I am ready to plunge head-first into it full-time!

Thanks again!!
 
Old 04-30-2007, 06:03 PM   #8
Agent942
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Question Removing GRUB from my internal drive?

Hey, one last thing - I have GRUB on my internal hard drive due to the same problem that you experienced - is there anyway to remove it from HD0 and have it only on the external USB drive?
 
Old 04-30-2007, 06:59 PM   #9
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
If you have an XP or Win2K CD you can boot from it, choose to repair an installation using the Recovery Console. It'll ask you for the Administrator password, then once your in just do FIXMBR, then EXIT. It should reboot Windows normally.

Alternatively, if you have a Win9x boot floppy you can use it, then from the A:\ prompt do FDISK /MBR

Also alternatively, if you have the Super GRUB Disc, it has an option to repair a Windows MBR. I haven't tried this method.

EDIT:
Quote:
Originally posted by Agent942
Thanks for this - however I'm still a n00b with "mounting" and don't quite know how to "mount" a drive (man, do I feel stupid typing this though)
No need to feel stupid. One of the nice things about Ubuntu, and other "user-friendly" distros is the automatic mounting when a device is connected. In Slackware I've always had to do it manually so it's one of the first things I learned.

'mount -t <filesystem> /dev/sda1 /mnt/sda1'

or in Ubuntu 'sudo mount /dev/sda1 /media/sda1'

Last edited by dracolich; 04-30-2007 at 07:06 PM.
 
Old 05-01-2007, 01:45 AM   #10
Agent942
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Still hitting walls - terminal output included

Quote:
Originally Posted by dracolich
One of the nice things about Ubuntu, and other "user-friendly" distros is the automatic mounting when a device is connected. In Slackware I've always had to do it manually so it's one of the first things I learned.

'mount -t <filesystem> /dev/sda1 /mnt/sda1'

or in Ubuntu 'sudo mount /dev/sda1 /media/sda1'
Okay, I must be missing something... as I am going to post my entire terminal session including what I typed:

ubuntu@ubuntu:~$ fdisk -l ##NOTE I did this to find out what the disk is being called ##

Disk /dev/sdb: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2325 18675531 83 Linux
/dev/sdb2 2326 2432 859477+ 5 Extended
/dev/sdb5 2326 2432 859446 82 Linux swap / Solaris

ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /media/sdb1
mount: mount point /media/sdb1 does not exist

##OK, so that isn't working and I don't know why... so, I figure I'll turn the disk off, re-enable the Ubuntu's "Mount removable drives when hot-plugged" option, then turn the external drive back on and try again##

##Ok, so Ubuntu has AUTO-mounted it as /media/disk (why as /media/disk?!), wierd but I guess there is no problem#

ubuntu@ubuntu:~$ cd /media/disk
ubuntu@ubuntu:/media/disk$ sudo chroot .
chroot: cannot run command `/bin/bash': Permission denied

##OK, now I'm not allowed to do this...

and with that, I give up for now...

It appears to me that there is some type of mount issue at the root of this problem, but in using the Ubuntu CD (7.04, boots as a Live/Install CD) I am quite confused in all this.

I am not going to give up entirely, as I CAN make this boot up by using the Super-Grub disk, and manually going through the steps to booting the partition, but I can't figure out why I need to do this to get it to boot up; if the Super-Grub disk can point me there and mount the partition, then what the hell is it doing that I can't get the GRUB on the USB drive to do? I mean, when I boot from the USB drive, it loads the GRUB menu, but it won't take me any further without the Error 17.

Frustrated, but there HAS to be a way to make this work.

Again, dracolich, you're help has moved me in the right direction and I thank you - any more insight into this is greatly appreciated!
 
Old 05-01-2007, 04:23 AM   #11
stealth_banana
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Debian Sid / Kubuntu
Posts: 170

Rep: Reputation: 30
I had ubuntu running off and external HD on my laptop.

The way I did it was to set the BIOS to boot from the external drive.

That said, I got sick of it and just removed winblows from the laptop instead.

The error 17 seems to me that he USB HD was not mounted at power up and grub could not see the data it needed to start loading.
 
Old 05-01-2007, 07:01 AM   #12
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
You've gotten really far. I'd hate to see you quit now. /media/disk is just a generic name that it uses for hard drives. I think, if it were a flash drive, it would be sda or sdb. And what you said about the GRUB disc makes me more curious about it. I'll have to play with it some more.

When you cd'd into /media/disk did you look to see if it listed the files? I found early on that even though it automatically creates an icon on the desktop it hadn't actually mounted the device yet. The way it works is, when you click the icon it mounts and then displays the contents in the resulting window.

Quote:
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /media/sdb1
mount: mount point /media/sdb1 does not exist
When a mount point doesn't exist you can always create it and try again, or set the mount point to something that does exist.

sudo mkdir /media/sdb1

With the automount feature turned on try
1. Click the icon to automount the device

2. While that window's open use the terminal to cd into /media/disk and view the contents with ls.

3. If you can see the files edit the /boot/grub/device.map file as previously suggested. You have to open it with root permission to save changes, so:

sudo gedit /media/disk/boot/grub/device.map

Inside should be two lines, three if you have a floppy. Probably

(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb

If you're USB disk is sdb then sda would be your internal. Simply switch the hd0 and hd1 labels

Code:
(fd0) /dev/fd0          (fd0) /dev/fd0
(hd1) /dev/sda     or   (hd0) /dev/sdb
(hd0) /dev/sdb          (hd1) /dev/sda
4. run the command 'sudo grub-install --root-directory=/media/disk /dev/sdb'

the root-directory option is an alternative to chroot'ing first


Quote:
Originally posted by stealth_banana
The error 17 seems to me that he USB HD was not mounted at power up and grub could not see the data it needed to start loading.
Close. What it means is that the USB disk was not mounted because a different disk is mapped as hd0, aka the boot disk, in the device.map file.

Good move completely replacing Winblows with Ubuntu. Your laptop will be much happier now.

Last edited by dracolich; 05-01-2007 at 07:03 AM.
 
Old 05-15-2007, 06:53 PM   #13
blyons
LQ Newbie
 
Registered: Nov 2003
Location: Penfield, New York
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
Hi,
I am too trying to boot from my usb hard drive but to no avail. The disk is known as sdf. I edited the grub device map so my hdo is linked to sdf. My bios is set to boot from the usb-hd but when my system boots I get to the verbiage from my bios "Verifying DMI Pool" and then just hangs. If I power off the USB hd drive the pc immediately boots to Windows which is according to plan. Still looking on how to do this.

Not ready to give up yet.



Bob Lyons
Penfield, NY
 
Old 05-16-2007, 06:28 AM   #14
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
After editing the file did you run the grub-install command as mentioned earlier? For example

sudo grub-install --root-device=/media/disk /dev/sdf

If that doesn't work you can try specifying /dev/sdf1 to install GRUB to the partition's MBR instead of the disk's.
 
Old 05-30-2007, 06:11 PM   #15
ermeaney
LQ Newbie
 
Registered: May 2007
Posts: 2

Rep: Reputation: 0
I fixed this with editing /boot/grub/menu.lst

Sorry for replying to a pretty old post.

I have had a similar problem on several installs because of this, twice installing /boot to usb and once when selecting a different drive in the advanced screen while installing.

To boot up, when the grub screen where you select your kernel comes up, hit e to edit. Then use the arrow keys to select the line that specifies the root:
Code:
root            (hd1,0)
hit d to delete that line
hit b to boot

Then you have to edit grubs menu
/boot/grub/menu.lst
remove
Code:
root            (hd1,0)
from all the boot entries.

Currently every time the kernel (or probably Grub for that matter) updates, you are have to edit /boot/grub/menu.lst again to remove those lines. I was actually Googling to see if a bug report had been entered yet and found this post, so I signed up to answer. Maybe someone else will find this post the same way.

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing RH9 on an external USB drive mveerdon Linux - Newbie 1 05-05-2007 04:19 AM
Boot from USB external drive, from laptop without USB boot support. darirod Linux - Newbie 2 12-19-2006 10:00 AM
Installing on external USB drive infornography Linux - Hardware 2 11-22-2006 03:56 PM
howto boot Suse 9.1 from external usb drive through bios-accessable boot partition McHenner Linux - Hardware 2 09-30-2004 07:27 AM
How to boot from an external USB drive? Dywas Linux - General 1 04-03-2004 02:31 PM


All times are GMT -5. The time now is 12:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration