[SOLVED] Ubuntu on external drive boots only on one computer, GRUB gives error on others
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ubuntu on external drive boots only on one computer, GRUB gives error on others
I have a USB hard drive with an Ubuntu 11.10 installation I created using my desktop machine. My reason for doing this was to to have the same Linux environment on other computers as well, as often I have to work away from home.
Well, today I tried to use that drive with my laptop while I was on the road, but I got a GRUB error message: "Out of disk". When I got home, I tried the same USB drive on my wife's laptop, and got a different GRUB error message: "File not found".
I then tried the drive on my usual desktop machine - and it worked. No problem at all. I am in fact typing this in the Linux environment installed on that very hard drive.
Having different error messages originally made me think it could be a problem with the installation, or even the hard drive itself, but that installation works reliably on my desktop machine.
When you installed Ubuntu to the external usb hard drive, did you intall its' Grub2 bootloader to the master boot record of that (the external) drive?
When you connected the external to the laptop, did you go into the BIOS of the laptop and select the external hard drive to boot from?
Without knowing how you boot your Desktop (which bootloader, where it is) and the drive/partition configuration of your laptops, it will just be guessing. You could go to the site below and download and run the bootinfoscript after reading the instructions and post the results.txt file here to get some help. Have your external attached to your Desktop when you do it.
When you installed Ubuntu to the external usb hard drive, did you intall its' Grub2 bootloader to the master boot record of that (the external) drive?
Yes, the external drive has Grub2 installed in its MBR. All the computer involved do not have Grub, being primarily Windows machines.
Quote:
Originally Posted by yancek
When you connected the external to the laptop, did you go into the BIOS of the laptop and select the external hard drive to boot from?
Yes. Also tried going through the boot menu, where you explicitly pick the specific drive you want to boot from, and picking the USB drive - same results.
Quote:
Originally Posted by yancek
Without knowing how you boot your Desktop (which bootloader, where it is) and the drive/partition configuration of your laptops, it will just be guessing. You could go to the site below and download and run the bootinfoscript after reading the instructions and post the results.txt file here to get some help. Have your external attached to your Desktop when you do it.
The output of bootinfoscript, the file RESULTS.txt, is attached. From what I know of the disk sizes, the external drive should be sdd.
The interesting thing about your results.txt output is the fact that your Ubuntu is on sdd1 yet your grub.cfg file shows the following entry:
Quote:
set root='(hd1,msdos1)'
The grub.cfg entry above is pointing to the second hard drive, first partition. Grub2 counts hard drives from zero and partitions from one. If you had all four drives attached when you installed Ubuntu, I would expect the Ubuntu grub.cfg entry to look like:
Quote:
set root='(hd3,msdos1'
Sorry, but I don't have any solution. The only thing I would try is changing the (hd1...) to (hd0...) in the menuentry and test it on the desktop and laptop. Do this by manually editing, do not run update-grub. If it fails, just edit back to the original. Just a guess?
Two different machines.
In future, before you attempt an install on an external drive, ensure the BIOS has been changed to have the DVD/CD first, the external next, then the normal (internal) boot disk. Then just install to the MBR of the first (i.e. external) disk.
Then change the BIOS back if you want.
On other machines you will just need to change the BIOS to boot the external, as you had planned I guess.
If you can just re-install after doing that, good, else it gets a little messier.
Lets us know which way you want to jump.
I am... confused. I really can't understand why this cannot be fixed without reinstalling. Even if I did, there's no guarantee that GRUB would be installed in a way useful to boot elsewhere if the default behaviour is to hard-code, so to speak, the configuration of the local machine in the grub configuration.
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
I think it would help if you were to give a bit of info on your wifes laptop so we could see the difference in set up.
I assume that the results.text is from the box you installed your Ubuntu from.
It does appear that you only had one other drive detected when you installed grub.
This does not mean you have to reinstall Ubuntu.
What would be nice is if you would, with everything running as in the results you sent, go to your terminal and run;
Code:
sudo update-grub
and then rerun the boot info script and post the results. This should tell us if there is a problem with your grub install.
When you plug in your drive to another box and boot it will be numbered in relation to the drives in that box. So, if you plug it to a box with one drive internally and no other drives it should boot fine.
It should not boot fine, with that menuentry, plugged into a box with 3 internal drives.
However you also have that menuentry calling for set root at a particular uuid. This is why it is booting on your computer.
There is no entry for your 3 MS installs under /etc/grub.d/30_os-prober. Why is this? Did you remove those from the results.text? If not there is a problem there. The script 30_os-prober is enabled to run. If it were not it would not be listed in the results.text.
If you installed Ubuntu with all internals shut down in bios that would be fine. All entries would be generated by 10_linux. That should also have given you a menuentry calling for hd0 not hd1.
What I am saying here is that I don't understand either. Your results.text does not match reality in that the grub.cfg file does not at all match the hardware described in the results.text.
This needs checked on.
One thing that would help is the out put of;
Code:
cat /boot/grub/device.map
I have a dual drive external enclosure that I can use by itself or boot from to my internals. I do understand what you want to do. I don't believe this is an OS problem, just a grub problem.
I think it would help if you were to give a bit of info on your wifes laptop so we could see the difference in set up.
My wife's laptop is an Asus X5DIJ with one hard drive and one DVD drive, with Windows 7 installed.
My laptop is an Asus EEE 901 with two hard drives, with a Windows XP installation on the first.
Quote:
Originally Posted by widget
I assume that the results.text is from the box you installed your Ubuntu from.
It does appear that you only had one other drive detected when you installed grub.
This does not mean you have to reinstall Ubuntu.
Ah, this is where it gets complex. I installed Linux on the troublesome hard drive quite some time ago, and it might have been done on the EEE 901 laptop (the one with two drives) - possibly. I do not remember. I used yet another external drive with Live Ubuntu I intended to use to install Linux wherever needed.
Quote:
Originally Posted by widget
What would be nice is if you would, with everything running as in the results you sent, go to your terminal and run;
Code:
sudo update-grub
and then rerun the boot info script and post the results. This should tell us if there is a problem with your grub install.
Done, and I attached the results to this post.
Quote:
Originally Posted by widget
However you also have that menuentry calling for set root at a particular uuid. This is why it is booting on your computer.
If that was the case, and since the UUID of the external drive is correct (I checked), why does it not work elsewhere? So complex.
Quote:
Originally Posted by widget
There is no entry for your 3 MS installs under /etc/grub.d/30_os-prober. Why is this? Did you remove those from the results.text? If not there is a problem there. The script 30_os-prober is enabled to run. If it were not it would not be listed in the results.text.
I did not edit the results file. I guess that was a result of my messing with /etc/default/grub, where I disabled auto probing not long ago, because I noticed Grub was "picking up" OS entries from various computers. So I disabled it, because I wanted this external drive to only boot the Linux installed there and be independent of whatever was installed or plugged in in any other computer. Not sure if I messed things further.
Quote:
Originally Posted by widget
One thing that would help is the out put of;
Code:
cat /boot/grub/device.map
I get an error message: "No such file or directory".
Quote:
Originally Posted by widget
I have a dual drive external enclosure that I can use by itself or boot from to my internals. I do understand what you want to do. I don't believe this is an OS problem, just a grub problem.
Good to hear. If I wanted an OS where the only way to solve relatively minor issues is to reinstall the lot, I would just use Windows!
I then tried the drive on my usual desktop machine - and it worked. No problem at all. I am in fact typing this in the Linux environment installed on that very hard drive.
How old is that "usual desktop" machine - or more pertinent maybe, how old is the BIOS in it ?. Seems to have an interesting implication in the way it (the BIOS) is enumerating the disks.
If I am reading all this correctly you can boot from the external o.k. (on that machine).
How old is that "usual desktop" machine - or more pertinent maybe, how old is the BIOS in it ?. Seems to have an interesting implication in the way it (the BIOS) is enumerating the disks.
If I am reading all this correctly you can boot from the external o.k. (on that machine).
Well, I could always boot that external drive on that machine.
Run the command given to generate the thing. This will be another assurance that grub is working as it should.
That said, the generated file is not really needed and the id and uuid of the drives not completely needed. In your case not even a good idea as they will not match different boxes. What you do need is for grub to know how many drives there are. Just add some more (hd?) to the file. This may help, will not hurt. Leaving all the info in there on the drive(s) in the external is a good idea.
The better way to disable os-prober is to change the permissions on /etc/grub.d/30_os-prober. It is currently enabled as executable. I would change that and then enable it in /etc/default/grub. Probably does not make much difference but that enabled script being over ridden is not going to help your speed anytime update-grub is run. Just an added complexity that is not needed at all.
It would be good to run update-grub with that enabled so that you know it works too. We need to KNOW that grub is all working as it should be.
I followed your suggestions, and ran the suggested commands. The device.map file is attached, as well as the new output of the boot info script. Once again I get the message about Compressed data being corrupt. For the life of me I don't really know what happened here.
I am... confused. I really can't understand why this cannot be fixed without reinstalling. Even if I did, there's no guarantee that GRUB would be installed in a way useful to boot elsewhere if the default behaviour is to hard-code, so to speak, the configuration of the local machine in the grub configuration.
Really, I don't know.
does grub make use of uuid's ?
my limited knowledge of uuid's is that it is a globally unique identifier for devices so you would be telling grub to find the files it needs to boot from a globally unique location rather than from /dev/sda1 or /dev/sda2 ... or /dev/sdz9 which can change based on which usb port it is plugged into on every pc.
fyi:
Code:
[schneidz@hyper ~]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Mar 17 11:37:06 2010
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
UUID=b127e33d-78d8-43d6-bfe7-fe404b6823a5 /boot ext3 defaults 1 2
/dev/mapper/vg_hyper-lv_root / ext4 defaults 1 1
/dev/mapper/vg_hyper-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sda2 /media/win ntfs defaults 0 0
/dev/sdb1 /media/win/stuff/ide-34 ext2 rw,nosuid,nodev,uhelper=udisks 0 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.