Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to make a 250G USB hard disk Ubuntu-bootable on a Compaq nc6220 laptop.

I've removed all other disks, so /dev/sda (the USB disk) is the only disk other than CDROM.

I installed Ubuntu 9.10 to this disk from the live CD, putting the bootloader on /dev/sda . The default system couldn't be booted, and nothing I did in the Grub menu/cmdline helped.

So I chrooted onto the disk and did grub-install /dev/sda. That seemed to work fine, but Grub (1.97 beta 4) keeps coming up with

error: out of disk

Even when I drop to the command line to do something simple like ls or help, it's always the same error message.

Any hints for resolving this, please?

share|improve this question
    
Wait a minute, are you trying to make an external USB-Harddisk bootable? –  Bobby Feb 10 '10 at 15:02
    
@Bobby: Yes, I was trying to make an extern USB disk bootable. It's possible to configure it as bootable in the BIOS, and it does kinda boot, though inconsistently. I gave up without figuring out the whole problem, but it seems to have been timing related. It would work sometimes and sometimes not. I'm hoping that by the next time I have similar problems, grub2 will be more standard and have more robust error handling. –  Carl Smotricz Mar 2 '10 at 19:22

1 Answer 1

up vote 3 down vote accepted

Does Grub2 drop you into a grub rescue> prompt after this error? This thread suggests that getting the rescue prompt means Grub2 can't find a usable grub.cfg file. See Grub2 Rescue Mode for a method to locate your system installation and boot it. In short, you need these commands (see the link for details):

  1. ls (displays the partitions and devices Grub can see)
  2. set prefix=(hdX,Y)/boot/grub [*]
  3. set root=(hdX,Y)[*]
  4. set (shows Grub's environment; inspect the prefix= listing; make sure it matches what you set in step 3)
  5. ls /boot/ (should show the contents of your system's /boot -- kernels, initrd images, the grub folder, etc)
  6. insmod (hdX,Y)/boot/grub/linux.mod
  7. linux /vmlinuz root=/dev/sdXY ro [**]
  8. initrd /initrd.img
  9. boot

    • [*] replace (hdX,Y) with a value shown in the output of step 1, such as (hd0,1) or (hd3,9)
    • [**] replace sdXY with the correct designation, such as sda1 or sdc9. Y is the same as in (hdX,Y) but X will be a letter instead of a number.

If you can boot following those directions, you may be able to fix grub just by running:

sudo grub-install
sudo update-grub2

An alternative is suggested in this bug report. According to that, the error is generated by this line in Grub's configuration (grub.cfg):

if [ -n ${have_grubenv} ]; then save_env recordfail; fi

Removing that line seems to have helped fix booting problems, but some report the error still persists. See this post for how to remove that line from the Grub menu during boot, and for how to remove it from the configuration file generation script (/etc/grub.d/10_linux).

Unfortunately neither of these resources indicate what's causing the error.

share|improve this answer
    
Sorry to be so late with my answer: No, Grub didn't drop me into a rescue prompt; it came out with an error message and halted. I've meanwhile given up, partly because the requirement I had went away. Hopefully things will work better next time I try this stunt, whenever that will be. I'm going to accept your answer in appreciation of the work you put in, thank you! –  Carl Smotricz Mar 2 '10 at 19:24
    
When I get to step 5. @ls /boot/@ I get the error "out of disk" again. Any idea what I should do at this point? –  Tom Mar 13 at 20:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.