Installing Ubunto 7.04 on External USB drive, to boot from and run from - Error 17?
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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.
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?
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.
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.
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!
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?
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.
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!
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.