# [solved] GRUB on software RAID6

## h0mer`-

grub won't install on my software raid6 disks.

```
grub> find /boot/grub/stage1

Error 15: File not found
```

```
cat /proc/mdstat

Personalities : [raid1] [raid6] [raid5] [raid4]

md2 : active raid6 sdd3[3] sdc3[2] sdb3[1] sda3[0]

      39085952 blocks level 6, 64k chunk, algorithm 2 [4/4] [UUUU]

md1 : active raid6 sdd2[3] sdc2[2] sdb2[1] sda2[0]

      2007936 blocks level 6, 64k chunk, algorithm 2 [4/4] [UUUU]

md0 : active raid6 sdd1[3] sdc1[2] sdb1[1] sda1[0]

      64000 blocks level 6, 64k chunk, algorithm 2 [4/4] [UUUU]

unused devices: <none>

```

```
fdisk -l /dev/sda

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *          63       64259       32098+  fd  Linux raid autodetect

/dev/sda2           64260     2072384     1004062+  fd  Linux raid autodetect

/dev/sda3         2072385    41158529    19543072+  fd  Linux raid autodetect
```

```
ls -al /boot/grub/

total 340

drwxr-xr-x 2 root root   1024 May 12 09:38 .

drwxr-xr-x 4 root root   1024 May 12 09:38 ..

-rw-r--r-- 1 root root    197 May 12 09:38 default

-rw-r--r-- 1 root root     75 May 12 09:38 device.map

-rw-r--r-- 1 root root   8772 May 12 09:38 e2fs_stage1_5

-rw-r--r-- 1 root root   7932 May 12 09:38 fat_stage1_5

-rw-r--r-- 1 root root   7184 May 12 09:38 ffs_stage1_5

-rw-r--r-- 1 root root    557 May 12 09:39 grub.conf

-rw-r--r-- 1 root root   7192 May 12 09:38 iso9660_stage1_5

-rw-r--r-- 1 root root   8644 May 12 09:38 jfs_stage1_5

lrwxrwxrwx 1 root root      9 May 12 09:38 menu.lst -> grub.conf

-rw-r--r-- 1 root root   7380 May 12 09:38 minix_stage1_5

-rw-r--r-- 1 root root   9760 May 12 09:38 reiserfs_stage1_5

-rw-r--r-- 1 root root  33856 May 12 09:38 splash.xpm.gz

-rw-r--r-- 1 root root    512 May 12 09:38 stage1

-rw-r--r-- 1 root root 107736 May 12 09:38 stage2

-rw-r--r-- 1 root root 107736 May 12 09:38 stage2_eltorito

-rw-r--r-- 1 root root   7452 May 12 09:38 ufs2_stage1_5

-rw-r--r-- 1 root root   6804 May 12 09:38 vstafs_stage1_5

-rw-r--r-- 1 root root   9576 May 12 09:38 xfs_stage1_5
```

any ideas?Last edited by h0mer`- on Thu May 12, 2011 9:09 am; edited 1 time in total

----------

## frostschutz

use RAID 1 for the boot partition, with the metadata being at the end of the device (0.9 or 1.0).

then you can install grub on each disk, and have grub use the boot partition like a single disk, ignoring the raid

so if any disks fail, it will still boot from one of the other disks

----------

## h0mer`-

thanks m8, that did the trick.

----------

## solamour

I followed GRUB2 installation guide (http://en.gentoo-wiki.com/wiki/Grub2) and was able to boot from RAID-5. I believe it should work for RAID-6 as well.

I tend to agree that the boot partition needs to be as simple as possible, but I like to keep things simple (and I'm lazy), so I just used 1 partition for the whole thing without a separate boot partition.

__

sol

----------

## dmitryilyin

It is very-very-very bad idea to use raid5/6 for boot partition. Make separate 1Gb raid1 with all disks for boot.

----------

## solamour

Even though it's almost always a good idea to create a separate boot partition (preferably RAID-1 mirroring that spans all disks) when dealing with RAID-5/6, if you want to keep everything in a single partition, here are a few things to keep in mind. It's based on my experience, so your mileage certainly will vary.

* Legacy GRUB doesn't play well with RAID-5/6. GRUB2 works.

* When using GRUB2 with RAID-5/6, the partition in each disk needs to have some free space (about 1MB or so) in front. When I partitioned the disks with no free space, GRUB2 complained that it couldn't find enough space to embed itself when I did "grub-install /dev/sda". I wasn't able to boot the system.

* When you boot from LiveCD, your "/dev/md0" might show up as "/dev/md127" (or some other numbers). If that happens, just assemble it again with the right number.

```
mdadm --stop /dev/md127

mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 ...
```

* When the metadata is 1.x, (I think) you need initramfs. If you don't want genkernel, 0.90 is a safe choice.

__

sol

----------

