Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Dec 04 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Dec 04

Grub uses relative device naming, counting devices by ordinals. Grub is
saved just as your system was when you installed. It is therefore a snapshot
in time. If you remove a device it throws grub off. For example if you have
a usb drive and unplug it or plug one in when one wasn't there before,
devices in grub after that would be looking for the kernel on a different
device and then you get an error.

You have two choices. You can attempt to plug in devices just as they were
when you installed Linux or you can edit or re-write grub. You can
temporarily edit grub by pressing e on the boot line of grub that you want
to edit. You can make changes and press Ctrl-X when done.

Grub names devices using ordinals counting from zero. The first drive would
be names hd0 and partitions on that drive would be (hd0,0) and (hd0,1) and
the second would be named hd1 with partitions being (hd1,0) and (hd0,1) etc.
The first number is the drive and the second is the partition ordinal.

Once you sort it out you can make the change permanent by using gedit to
change the grub.cfg file. You need to do this as root (sudo gedit in a
terminal).

You can try to rewrite grub by either editing grub manually to get into
Ubuntu or to do it from the Live CD.

https://wiki.ubuntu.com/Grub2

I install Ubuntu to a SD card on my netbook and I write grub to the SD card
and not the hard drive then I press escape at boot up and use the boot
manager that came with it to switch boot devices. This way it does not
matter if I forget and have a usb key in when I boot up and if I want
Windows I just let it boot to the hard drive. When you install Ubuntu you
can change where grub is written on page 7 by clicking the Advanced button.
I usually write grub to the device on which the distro is installed and not
on the first hard drive. I have 17 partitions and at least six distros
installed at any one time. Editing grub could be a full time job, but doing
it this way minimizes any problems. If one drive does not boot I can usually
resurrect things by booting another drive and editing grub manually.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Grub2 stop ubuntu Or get search suggestion and latest updates.


Tagged: