4

I have 2 hard disks new and old. I have installed Windows and Ubuntu on the new one, and have Windows and Ubuntu on the old one.

I`m booting from the new drive, but GRUB on the new disk has detected the Operating Systems from both disks. How can I modify it to only show entries for the new disk?

Mitch
  • 107,631
Yusuf
  • 245
  • Possible Duplicate http://askubuntu.com/questions/100232/how-do-i-change-the-grub-boot-order – Mitch May 26 '12 at 17:39
  • Might be worth having a look at the information in the similar related question that @Mitch linked, and possibly have a look here too: http://www.dedoimedo.com/computers/grub-2.html. All depends on what you feel comfortable with. – hazrpg May 26 '12 at 17:44
  • Thanks for your responses; I had seen the link pointed by Mitch, but it involves manually changing already existing entries, which I'm supposing means that I'll have to do it again after an upgrade of the kernel. What I wanted was some configuration or something like that which would make it permanent. I'm still going through the links given by @hazrpg though; maybe I'll find something. – Yusuf May 26 '12 at 17:54
  • The part of interest you might need to look through is the sections: How grub2 works (don't worry not complicated info, just where it gets its results from): http://www.dedoimedo.com/computers/grub-2.html#mozTocId514088 and Sample /etc/grub.d/ directory (folder that contains the scripts to make a grub2 menu): http://www.dedoimedo.com/computers/grub-2.html#mozTocId226706 – hazrpg May 26 '12 at 18:12
  • I was going through the GRUB 30_os-prober file, and it uses the Linux os-prober program to get the list of devices. Any way to control that? – Yusuf May 26 '12 at 18:17
  • Ah, I think I understand; I just have to disable the default 30_os-prober and write my own; I think I'll do that later. Thanks for the help guys! – Yusuf May 26 '12 at 18:29
  • You don't have to delete it, you can simply just change the permissions to not allow execution. Another thing you can look at is this: http://ubuntuforums.org/showthread.php?p=10340183. Part 4 of that guide talks about stopping Grub2 adding new entries from os-prober. – hazrpg May 26 '12 at 18:51

1 Answers1

1

Thought I'd bring the information I found to an answer. Let me know if this helps. Original version of this can be found here: HOWTO: Grub Customizer - Ubuntu Forums

First you'll need grub-customizer application. To install do the following in a terminal:

  1. sudo add-apt-repository ppa:danielrichter2007/grub-customizer
  2. sudo apt-get update
  3. sudo apt-get install grub-customizer

To start, type this into a terminal: gksu grub-customizer

Making Changes (from Main Page)

  1. Removing / Hiding Entries
    1. Hide An Entire Section: Untick the main header (linux, os-prober, etc)
      • Example: Unticking os-prober will disable the script and remove all entries normally found by it - Windows, other Ubuntu installations, etc. Even if the entries within the subsection are enabled, they will not be displayed.
      • Hide Specific Entries: Untick the entry. Example: Unticking Ubuntu, with 2.6.35-24-generic will remove that specific entry in the Grub 2 menu.
  2. Freezing Entries (new Entries)
    1. Unticking "new Entries" prevents the addition of any new Grub 2 menu entries for that section. New options found during updates may be included in the tree view but will not be selected by default.
      • If a new item is found by an enabled script, it will not be added to the Grub 2 menu.
    2. Example: If 'new Entries' in 'linux' is deselected, when a new kernel is installed on the main system it will not appear in the menu.
  3. Adding Entries
    1. Tick the applicable entry.
    2. Selecting a main category will enable the script.
    3. Selecting an item within a main category will add it to the Grub 2 menu if it's parent is enabled.
  4. Renaming Entries
    1. Double-click a menu title to enable the editing mode. Type the new title and click elsewhere on the page to complete the edit.
  5. Moving Entries
    1. To move a main section, highlight the entry and use the Up/Dn arrows on the main menu to change the menu order. Moving a main category will move all its submenus.
      • Example: If you want Windows to appear before the main Ubuntu entries, move os-prober to the top of the list.
    2. To move a title up or down within a subsection, highlight the entry and use the Up/Dn arrows on the main menu to change the menu order.
      • A titles can only be moved within its own subsection.
hazrpg
  • 956
  • Yeah, I already saw this one; I could have unticked os-prober like in the example above, but that would also remove the Windows from the disc I want. So what I need to do in fact is disallow execution of the os-prober script and modify it a bit to do what I want (telling it to stop after the first disk it finds, for example, if that can be done). – Yusuf May 26 '12 at 19:42
  • From my understanding, you should be able to deselect the O/S's themselves from os-prober (on that tool) and do it that way. But I' not sure, because I currently have a problem installing Ubuntu on my new laptop (sad face) to test this. – hazrpg May 27 '12 at 02:03
  • 1
    You're right, I was able to deselect the specific lines in GRUB; I'm pretty sure though that when I install a new kernel on the other disk, there will be a new entry in GRUB for that next time an update-grub is issued. I guess I'll just have to manually exclude it each time. Anyway thanks, I think I'll accept this as an answer. – Yusuf May 27 '12 at 11:00