LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2012, 05:14 PM   #1
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Rep: Reputation: 15
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!
 
Old 01-30-2012, 06:09 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
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.
 
1 members found this post helpful.
Old 01-30-2012, 06:17 PM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
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.

Last edited by colorpurple21859; 01-30-2012 at 06:24 PM.
 
1 members found this post helpful.
Old 01-30-2012, 06:27 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
1 members found this post helpful.
Old 01-30-2012, 06:43 PM   #5
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
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!
 
Old 01-30-2012, 10:20 PM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
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.

Last edited by Larry Webb; 01-30-2012 at 10:22 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub2: Skipping one partition from OS detection eantoranz Linux - Software 11 09-04-2012 03:16 AM
[SOLVED] Grub2, moving /boot to separate partition qrange Linux - Software 8 10-25-2011 11:33 AM
How to move Grub2 from mbr to root partition BillD Linux - Software 3 03-17-2011 06:07 AM
[SOLVED] grub2 indirect booting from separate partition Larry Webb Linux - General 9 12-19-2010 12:35 PM
Install grub2 in partition is possible? miros84 Linux - Software 1 11-14-2010 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration