7

I have suffered from boot configuration a lot. If windows is installed above ubuntu, ubuntu doesn't boot. if ubuntu is installed above windows then windows goes away.

Of course, reinstalling grub fixes these things, but I suppose having a dedicated grub partition is going to help me a lot.

So I have fresh windows installed. I am about to install ubuntu 11.04. But before I install Ubuntu, I want to create a dedicated boot partition first.

I thought creating a separate partition of about 200 mb and mounting it as /boot was called dedicated partition but it seems it is not.

How to create a dedicated boot partition during ubuntu installation?

Starx
  • 5,263

2 Answers2

5

Another option is to make a dedicated Grub2 partition (as opposed to dedicated /boot partition you mount at boot), see herman's tutorial.

Advantage: you can remove/install OSes at will.

Disadvantage: you need to edit the grub.cfg file manually. To avoid having to do that after every kernel update I recommend using the link to kernel images, not the kernel image itself, for example use something like

linux   /vmlinuz root=UUID=3e4xxxxx-027b-407c-ba1a-xxxxxxxx ro   quiet splash

not

linux   /boot/vmlinuz-2.6.35-28-generic root=UUID=3e4xxxxx-027b-407c-ba1a-xxxxxxxx ro   quiet splash 

For more info on using symbolic links instead of full paths for kernel images look here.

Disadvantage2 (thanks psusi): when installing a new OS make sure you do not install its Grub image to MBR. Install it without Grub and then manually edit the grub.cfg file to include the new OS.

arrange
  • 14,959
  • The guide you pointed, says to type sudo grub-install --root-directory=/media/grub2 /dev/sda as a command. But from where to input this command, is it ok if i do from the ubuntu's live cd. – Starx Jul 25 '11 at 08:09
  • It doesn't matter, but you have to make sure /media/grub2 or whatever is your dedicated Grub2 partition (Grub2 will install the config and module files there) and /dev/sda is the disk you want to boot from (Grub2 boot image will be installed into the first sector there). – arrange Jul 25 '11 at 08:21
  • On the mean time, I installed ubuntu, and haven't defined any partition to be mounted as /boot, so the /boot is inside the file system also. Will the above guide still be valid or I have to ask another question. – Starx Jul 25 '11 at 09:16
  • 1
    Yes, the whole point of this is that the Grub doesn't use the files in /boot of your Ubuntu installation, but its own (very small) extra partition (as explained in the link). – arrange Jul 25 '11 at 09:21
  • Ok, I got it working. Thanks. However I dont understand what you said by link to kernel instead of kernal image link. How to find out the links to those kernel images – Starx Jul 25 '11 at 13:13
  • When there is a kernel update, the symbolic links in / are updated automatically. Therefore you don't need to update your Grub config. Also see http://members.iinet.net.au/~herman546/p15.html#3._Symlink – arrange Jul 25 '11 at 13:57
  • This isn't going to help you avoid having to reinstall grub after installing another OS; the other OS is still going to install its own boot loader and take over. – psusi Jul 25 '11 at 14:41
  • @psusi: a decent OS (Ubuntu (until recently AFAIK) included) will give you an option not to install Grub to MBR. If necessary, you can always install the OS's Grub to its first partition sector (/dev/sda1 and such) and forget about it. – arrange Jul 25 '11 at 14:55
  • @arrange Whether grub is on its own partition or not doesn't really matter though; either the new OS takes over the MBR or it doesn't. – psusi Jul 25 '11 at 15:03
  • I have completed my ubuntu installation and neccesary software installation as well. Now I am about to install linux mint, will linux mint take over the dedicated grub partition as @psusi pointed. – Starx Jul 25 '11 at 16:15
  • @psusi, about your last comment. What do you mean exactly? – Starx Jul 25 '11 at 18:25
  • @arrange, please reply. if i install linux mint will it take over the dedicated grub partition – Starx Jul 25 '11 at 18:27
  • Relax, man ;) I don't know. It depends on the installer and you. But if you make a mistake, you can always repair the Grub from a LiveCD using the same steps as before. If you are afraid to experiment, it's probably not a good idea to set up a multiboot system. – arrange Jul 25 '11 at 18:37
  • 1
    @Starx if you don't tell the mint installer to NOT install grub, then yes, it will take over, just as it would without the dedicated grub partition. – psusi Jul 25 '11 at 23:39
  • @psusi, The installer never asked whether and not to install grub. And arrange, Yeah It replaced the grub with linux-mint's one and I have corrected it by following the steps. – Starx Jul 26 '11 at 01:30
  • Are you sure grub.cfg should be edited manually? I though it had to be generated. Isn't it rather 40_custom to edit? – Quidam May 07 '20 at 00:57
4

Only if we need the master boot record of a harddrive for something else we may install Grub to a partition. Otherwise it is not a good idea to do so.

During boot-up a boot manager such as Grub is expected on the boot device. That usually is the MBR of the hard drive (which is different to a partition), e.g. /sda (not /sda1).

During installation Grub2 will recognize other operating systems on all drives attached and adds them to the boot menu choice (this can also later be done with sudo update-grub). The Windows boot manager does not do so - that is why we are unable to boot into Ubuntu when having installed Windows later.

There are several guides on how to partition your drives for dual booting, e.g. linked to in answers to this question (or more).

For recommendations on a separate /boot partition see this question.

Takkat
  • 142,284
  • 1
    I am trying to create multi boot not just dual boot. And the main reason is, still to be able to boot my pc, even after removing certain OSs. – Starx Jul 25 '11 at 07:07
  • 1
    the grub 2 installed with ubuntu will be relative to the ubuntu only. If i format the ubuntu partition, i will no longer be able to boot other Operating system I have. So, I thought having a dedicated boot partition will help – Starx Jul 25 '11 at 07:10
  • Grub will look at it's configuration files during boot up irrespective of if it's installed on a MBR or in a partition. Only if you (manually) took care to not overwrite these files (that you could manually put anywhere) on reinstalling Ubuntu (or when removing partitions) you will be able to continue multi-booting without the need of reinstalling Grub. However consider that Grub2 will enable multi-boot to any OS it detects by it's default installation. A Windows installation still will overwrite Grub on the MBR. – Takkat Jul 25 '11 at 07:23