LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing GRUB2 On Its Own Partition (http://www.linuxquestions.org/questions/linux-newbie-8/installing-grub2-on-its-own-partition-926588/)

golmschenk 01-30-2012 06:14 PM

Installing GRUB2 On Its Own Partition
 
I'm trying to install GRUB2 on it's own partition (as you may have noticed by the name of the thread). I've got the separate partition ready and waiting, I just need to install GRUB to it. I'm still fairly new to the details about how GRUB works so bare with me please.

What I was attempting to do is install GRUB with the command:
Code:

sudo grub-install /dev/sda2
Where sda2 is the small partition I have setup to be the boot partition. But the result I get is:
Code:

/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: will not proceed with blocklists.

What am I doing wrong? Or do I have completely the wrong idea? Any suggestions would be appreciated. Thanks!

pljvaldez 01-30-2012 07:09 PM

The Arch wiki has some good data on this that should be relevant. Try this link. You might have to search the page for your error message.

colorpurple21859 01-30-2012 07:17 PM

What do you mean by "install to it's own partition"? Are you talking about the part of grub that is installed into the beginning of the partition that is first access when booting, or the grub files that goes into /boot/grub. If I'm not mistaken grub-install installs grub to the begining of the partition, but the /boot/grub files will still be on the root partition, unless you make changes to the /etc/default/grub or one of the files in /etc/grub.d, not sure which. Have to use the --force option to get grub-install to install to a partition.

bigrigdriver 01-30-2012 07:27 PM

Quote:

I'm trying to install GRUB2 on it's own partition (as you may have noticed by the name of the thread). I've got the separate partition ready and waiting, I just need to install GRUB to it. I'm still fairly new to the details about how GRUB works so bare with me please.
You don't install grub to it's own partition; you may make a partition for the /boot directory which contains /grub subdirectory and grub config files.

When you install grub (or grub2), the first stage of grub (which is a pointer to the remainder of grub) goes into either the MBR of the hard drive (the first 512 bytes: grub stage 1 and partition table), or grub first stage goes into the boot sector of the root partition of the installation (not the same as /root user's directory).

So, in your case, put /boot into the new partition, and, as root, run "grub-install /dev/sda" to write the first stage of grub to the MBR of the hard drive along with the partition table.

If you choose to install grub to the boot sector of the root partition, you will need some alternative means to boot your GNU/Linux OS, such as configuring another OS to redirect boot to your Linux, or use the installation disk to boot the Linux installation on the hard drive.

golmschenk 01-30-2012 07:43 PM

Ah I see. I was thinking that the GRUB would be on it's own partition. However, I just have the /boot directory of the operating system have it's own partition. I think this makes more sense. I'll give that a try. Thanks for the help!

Larry Webb 01-30-2012 11:20 PM

To install the boot directory to its own partition you will need to mount that partition then use

'grub-install --root-directory=/mnt/boot /dev/sdx'.

/mnt/boot being the mounted partition for your boot directory.

And /dev/sdx which if you only have one h/d will be sda.


All times are GMT -5. The time now is 08:38 PM.