You are not logged in.

#1 2011-10-19 20:49:00

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

Grub2 applied in raid0 boot of archlinux(Success)

Reading the grub2 wiki is a chore not easily deciphered nor applied to a given case.

Assembling a raid0 bootable archlinux install to the latest kernel introduces a complex situation with grub2.

The normal install procedure via ARCH201108 bootloader install has only grub available for the normal install procedure.  Grub2 is not optional.

Further, arch devs are opposed to partitioned boot use, but this user suspects that such does not apply to raid0 system boots.

The wiki includes a section(reproduced in part below) which may apply to a raid0 system but it is not specifically stated.  It may well be that the objections to partitioned boots in raid0 do not apply.

Since raid arrays are not addressed the exact application of grub2 to such installs is problematic.

Recent changes to the system in udev/mdadm interface make the grub system throw a fit at boot time.

The application of the following grub2 wiki to an install is very confusing...I need help in applying it to my raid0 install via ARCH201108...

Install to Partition or Partitionless Disk
Note: grub2-bios (any version - including upstream bzr repo) does not encourage installation to a partition boot sector or a partitionless disk like grub-legacy or syslinux does. Neither do the Arch devs.

To setup grub2-bios to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example /dev/sda1 as the /boot partition)

# chattr -i /boot/grub/core.img
# grub_bios-install --boot-directory=/boot --no-floppy --recheck --force /dev/sda1
# chattr +i /boot/grub/core.img

You need to use the --force option to allow usage of blocklists and should not use --grub-setup=/bin/true (which is similar to simply generating core.img).

grub_bios-install will give out warnings like which should give you the idea of what might go wrong with this approach.

/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea.
/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.

Without --force you may get the below error and grub-setup will not setup its boot code in the partition boot sector.

/sbin/grub-setup: error: will not proceed with blocklists

With --force you should get

Installation finished. No error reported.

The reason why grub-setup does not by default allow this is because in case of partition or a partitionless disk is that grub2-bios relies on embedded blocklists in the partition bootsector to locate the /boot/grub/core.img file and the prefix dir /boot/grub . The sector locations of core.img may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915 .

The workaround for this is to set the immutable flag on /boot/grub/core.img (using chattr command as mentioned above) so that the sector locations of the core.img file in the disk is not altered. The immutable flag on /boot/grub/core.img needs to be set only if grub2-bios is installed to a partition boot sector or a partitionless disk, not in case of installtion to MBR or simple generation of core.img without embedding any bootsector (mentioned above).
-------------------------------------------------------------------------------
Grub2 is another application being utilized for bootloading and differs greatly from legacy grub.  It introduces many options but little is provided to apply to raid boots.  Unless one assumes...bad idea.

Last edited by lilsirecho (2011-10-29 04:19:12)


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 2011-10-29 04:17:33

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

Re: Grub2 applied in raid0 boot of archlinux(Success)

As reported on my other posts regarding raid0 I have successfully installed linux3.0.7-1 kernel into a pair of 16GB CF drives bootable.

The boot time is 9 seconds.  Jumanji a terrific browser in xfce4.

Determined a way to GROW a software raid0 bootable array to a larger CF drive and also to GROW to more CF devices.

Expect a long-term use of this arrangement despite all adverse recommendations.

Run the system in root as usual.

Hoping next to make it cp2ram!!!!!     Woot!


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