You are not logged in.

#1 2012-01-15 04:37:02

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Force grub2 install to partition

How to install grub2 to a partition when installing from latest .iso?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#2 2012-01-15 08:04:13

gregor
Member
From: /planet/tmpfs
Registered: 2011-06-20
Posts: 175

Re: Force grub2 install to partition

# Config file for GRUB2 - The GNU GRand Unified Bootloader
# /boot/grub/grub.cfg

# DEVICE NAME CONVERSIONS
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)            <==== this is the 'MBR'
#  /dev/sdb2       (hd1,2)
#  /dev/sda3       (hd0,3)
#

just point out to an other /dev during the grub2 installation......"you do the math"

Offline

#3 2012-01-15 15:27:22

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

Have not been able to utilize grub2 to load into partition with the install .iso.

I am aware of the setup for grub devices but the install does not permit selection of a partition.

When such is optioned it reports illegal root device.

How can I "force" the install to partition for linux x86_64 install .iso.?

According to wiki info, grub install to partition is not recommended. 

Googling reports it isn't recommended because users may mess it up by not knowing the setup params.

I have no users to cause such an event.  I have root only and am the only "user" on my system.

Therefore the question stands.

Googling covers every mbr known to linux but little note of partitions loaded during .iso install procedure since it is not recommended for the reason I noted.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2012-01-15 18:36:01

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Force grub2 install to partition

I would also be very interested how and if this should be done.  Just spent yesterday reinstalling windows after a big mess with trying to install ubuntu grub2 to the root partition and not being able to--very long story.  Did lots of googling and no success.  I was trying to get grub2 installed to root partition because any time I upgrade ubuntu and grub 2 is upgraded, ubuntu insists on installing grub2 to mbr and messes up my nice Arch grub bootloader.  My solution was to install old grub onto the ubuntu root partition and now it leaves my Arch bootloader alone.  I almost uninstalled ubuntu for this reason--just keep it around to play with anyway. smile

Last edited by bgc1954 (2012-01-15 18:38:46)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#5 2012-01-15 18:47:36

gregor
Member
From: /planet/tmpfs
Registered: 2011-06-20
Posts: 175

Re: Force grub2 install to partition

grub-setup --force /dev/sda?

Offline

#6 2012-01-15 18:54:16

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

Related question:
Researching the grub system, I find a statement in the grub system that says:

DO NOT EDIT THIS FILE.....

This refers to grub.cfg file.

It further states that the file is auto generated by grub.mkconfig , grub.d and default.grub.

If user cannot edit grub.cfg, can the grub.mkconfig file be modified by a user to change the grub.cfg file auto generated to enable partitioned grub boot instead of mbr boot?

What change in mkconfig will produce this?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2012-01-15 19:07:16

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Force grub2 install to partition

@ gregor - I already tried that yesterday and on ubuntu,anyway, it doesn't work.  You get a message that it is not recommended to do this and then it looks like it's working but in the end nothing happens.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#8 2012-01-15 19:43:51

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

bgc:

My reference was to the grub.mkconfig file not grub.cfg which gives the message.

Does grub.mkconfig script also make that warning?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#9 2012-01-15 21:38:29

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: Force grub2 install to partition

This should work:

grub-install --force /dev/sdXY

Run it a few more times if it doesn't work first time. For me it worked in Ubuntu.

What I have read, the reason it's not recommended to install Grub2 to a partition, is because if Grub2 get's an update which makes one of the grub file bigger so there's no room for it on it's original place, it has to be moved and then Grub can't find it. I haven't had any problem with this, and I have had chainloading to Grub2 for several distros for more than a year.

Offline

#10 2012-01-15 23:00:23

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

Lennie:

Pleased to have a comment from another user.

I am aware of the grub-install /dev/sdxx but am not certain how to apply that arrangement in the normal install procedure in archlinux .iso install.  It seems so automated that the particular command doesn't seem viable, no command line is made available to insert it therein.

It is interesting to hear of another reason given for no partitions in grub2 altho it isn't certain what area of grub is affected.

I presently have a raid0 booting archlinux and it is linux 3.1.6-1.  Grub in use is version 1.99.

My partition is in the first drive partition#1.  So set root= (hd0,1) is in grub.  I have uuid for the root device which is /dev/md0.

In order to boot, I add root=/dev/md0 to the kernel line and change set root=to (hd1,1) and place a second device in boot position#2 in bios..  Then it uses the grub data in the second device to start the boot which completes via the raid array  build into Desktop.

I haven't found a way to permit the raid to boot by itself...it seems to need a second device grub to initiate the boot-up.

Every time I upgrade my raid system, I have grub loading problems.

The question I have with this post is how to load this raid0 with archlinux .iso which does not allow partitioned grub in the install procedure.  So I need to find a "force" method to permit me to finish the install of linux 3 .iso.

I had no problem in kernel26 but much trouble with linux 3.  It is all grub related and in reading the wiki, it seems the developers are all against partitioned boot..

Grub2 wiki and the grub functional system is horrid compared to original legacy grub.

KISS is no longer applicable to Arch it seems.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#11 2012-01-16 02:34:31

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

Attempted to chroot into /dev/md0 and run ....grub-install --force /dev/sdc1 ,,,

The result is informative and weird:

[root@n6re /]# grub-install --force /dev/sdc1
/usr/sbin/grub-setup: warn: File system 'ext2' doesn't support embeding.
/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: cannot read `/grub/core.img' correctly.
[root@n6re /]# 

Need to try "blocklists" to become unreliable and become discouraged!!!!

EDIT:  Discouraged indeed!  After searching the grub2 wiki, I am further discouraged because it is not at all clear what is needed to complete the blocklists and install grub so that it does permit grub to bootload in a partitioned boot.  Warnings are noted but whether they apply is not clear nor is it clear that grub-mkconfig has to be run.

Strange but I am able to boot into partitioned ext2 grub using an auxiliary drive having grub installed in ext2 partition.

I believe my system responds with grub2 in ext2 therefore....it is not compatible with the grub2 wiki information nor the result given above when attempting grub-install --force /dev/sdc1. 

Something is amiss in the bootloader system called grub2...complex it is!!!

Last edited by lilsirecho (2012-01-16 03:04:19)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#12 2012-01-16 03:10:28

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

The error message reports that ext2 cannot utilize an embedded grub2.

What filesystem can utilize embedded grub2?

EDIT:  Creating a partition requires a filesystem...right?

Last edited by lilsirecho (2012-01-16 03:15:21)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2012-01-16 17:37:15

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: Force grub2 install to partition

I have never used raid so I can't help you with that.
When I installed Arch I couldn't install grub to partition from installation iso, so I did that after completed install.
I have ext4 on all my partitions, and Grub2 is installed to several of them. I have never had any problems with that.

Offline

#14 2012-01-16 18:41:30

pointone
Wiki Admin
From: Waterloo, ON
Registered: 2008-02-21
Posts: 379

Re: Force grub2 install to partition


M*cr*s*ft: Who needs quality when you have marketing?

Offline

#15 2012-01-16 23:15:43

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

pointone:

As I reported, the wiki is confusing in that it doesn't spell out specifically exactly what is required to install grub to partition.  I mentions errors and provides fixes but I don't see it as a procedure worth trying on a sensitive raid0 build because it is such a hack.

A straight forward setup is very desireable.  I have no experience with chattr and doubt if there are many users that have used it.

As I stated, KISS is not in this procedure. 

Previous grub called for a simple command.  Grub2 is horrid!!!!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#16 2012-01-17 00:52:46

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

Here is the result of the first command:

sh-4.2# chattr -i /boot/grub/core.img
chattr: No such file or directory while trying to stat /boot/grub/core.img
sh-4.2# 

Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#17 2012-01-18 03:02:29

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Force grub2 install to partition

As to the posted error statement regarding ext2 fs for grub, the following is from grub wiki:

GRUB boot disk

First, format a floppy disk:

 fdformat /dev/fd0
 mke2fs /dev/fd0

Now mount the disk:

 mount -t ext2 /dev/fd0 /mnt/fl

Install GRUB to the disk:

 grub-install --root-directory=/mnt/fl '(fd0)'

Copy your menu.lst file to the disk:

 cp /boot/grub/menu.lst /mnt/fl/boot/grub/menu.lst

Now unmount your floppy:

 umount /mnt/fl

Completely inconsistent with the error statement shown in previous post.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

Board footer

Powered by FluxBB