LinuxQuestions.org
Visit Jeremy's Blog.
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-2012, 02:10 PM   #1
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Rep: Reputation: 0
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.

What can I check? Any suggestions?
 
Old 04-26-2012, 05:09 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,431

Rep: Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471
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.

http://sourceforge.net/projects/bootinfoscript/
 
Old 04-26-2012, 05:59 PM   #3
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by yancek View Post
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 View Post
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 View Post
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.
Attached Files
File Type: txt RESULTS.txt (15.0 KB, 18 views)
 
Old 04-26-2012, 08:06 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,431

Rep: Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471
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?

Last edited by yancek; 04-27-2012 at 08:49 PM.
 
Old 04-26-2012, 08:49 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,099

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
Old 04-27-2012, 10:42 AM   #6
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
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.
 
Old 04-27-2012, 03:28 PM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
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.
 
Old 04-27-2012, 05:46 PM   #8
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by widget View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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!
Attached Files
File Type: txt RESULTS.txt (15.0 KB, 14 views)

Last edited by Basilios; 04-27-2012 at 05:48 PM.
 
Old 04-27-2012, 07:10 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,099

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by Basilios View Post
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).

Try now after that latest update-grub.
 
Old 04-27-2012, 07:21 PM   #10
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
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.
 
Old 04-27-2012, 07:29 PM   #11
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
I just had a more careful look at the RESULTS.txt file, and look what I found and the very end:

Code:
=============================== StdErr Messages: ===============================

xz: (stdin): Compressed data is corrupt
What is that? Is it something I should worry about?
 
Old 04-27-2012, 09:20 PM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
The compressed data is a concern. There are only so many things that the boot info script looks at and they all directly concern booting.

You really should have a device.map. Run;
Code:
sudo grub-mkdevicemap
From my file of notes on such things;
Quote:
Writes a new /boot/grub/devicemap. This map
must be correct to boot multiple drives. Always a
good thing to try when having trouble doing so.
My device.map looks like this;
Quote:
root@debian:/home/tom# cat /boot/grub/device.map
(hd0) /dev/disk/by-id/usb-WDC_WD32_00AAJS-00VWA0_DCA270249388-0:0
(hd1) /dev/disk/by-id/usb-WDC_WD32_00AAJS-00VWA0_DCA270249388-0:1
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.
 
Old 04-28-2012, 07:03 AM   #13
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
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.
Attached Files
File Type: txt RESULTS2.txt (14.9 KB, 10 views)
File Type: txt device.map.txt (258 Bytes, 8 views)
 
Old 04-28-2012, 07:11 AM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by Basilios View Post
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

Last edited by schneidz; 04-28-2012 at 07:25 AM.
 
Old 04-28-2012, 07:16 AM   #15
Basilios
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 0
It does, or at least it should make use of UUIDs - the config file for Grub allows their use, and UUIDs do pop up in the RESULTS file, as you can see.
 
  


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
GRUB error 21 when external drive disconnected miguelg Linux - Newbie 5 11-04-2009 08:42 AM
External Drive- Booting ubuntu - more then one computer blackbinary Ubuntu 7 07-23-2008 11:12 AM
External Hard Drive GRUB Error magcius Linux - Hardware 4 05-15-2007 06:37 PM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 09:02 AM
GRUB Error 17 when installing Ubuntu on an External Drive nrbelex Linux - Software 1 11-16-2005 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration