Operating System - Linux
1822080 Members
3441 Online
109640 Solutions
New Discussion юеВ

raid configuration during installation

 
SOLVED
Go to solution
Maaz
Valued Contributor

raid configuration during installation

I planned to install Linux "/"(root FS) onto software raided (RAID1) disks.
I have heard that the /boot must be on a separate traditional primary partition ? true ? if true then why ?

e.g
/boot : /dev/sda1
swap (raid 1): /dev/sda5 and /dev/sdb5
/ (raid 1): /dev/sda6 and /dev/sdb6

if /boot cant be created on raid1 then this is problematic because in case of a disk(/dev/sda) failure the system may not boot even though our data and root system is safe.

what you Gurus suggest/recommend ?

Maaz
5 REPLIES 5
Stuart Browne
Honored Contributor
Solution

Re: raid configuration during installation

This is where things get a bit tricky.

If you are using Software RAID1, you can put the '/boot' ON the RAID volume.

Once the machine is built, you need to do some grub trickery (grub-install) onto the 2nd hard-drive so in the event of a failure, you'll still be able to boot the system.

Using any higher (5+) type of Software RAID will not work for this. Just 0 & 1.

One long-haired git at your service...
Ivan Ferreira
Honored Contributor

Re: raid configuration during installation

You can use software RAID for /boot.

The /boot/efi file system must be vfat for Itanium based servers.

The /boot cannot be under the control of LVM.

In your case, you can mirror all file systems.

What you should do manually after the installation is install the grub boot loader into the MBR/active partition of the second disk.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Matti_Kurkela
Honored Contributor

Re: raid configuration during installation

RAID1 is OK, but you'll need to be careful with installing the bootloader (find the Software-RAID-HOWTO documents on the internet for more information). This is because a RAID1 partition more or less "looks like" a standard partition: the bootloader does not need to be specifically aware of RAID1 to be able to _read_ it.

Writing would be more difficult, but fortunately a bootloader usually won't need to write anything to the disk while starting the system.

RAID5 cannot be used as a boot partition, because a bootloader would then have to have a real RAID5 implementation to be able to understand the disk/partition contents. Even a simple implementation of RAID5 generally won't fit into a boot sector.

As the disk's Master Boot Record is outside any partition, a partition-level Software RAID will not copy it automatically. Fortunately there is generally no need to change the Master Boot Record after setting it up once.

I'd prefer using the "ms-sys" tool to install an "industry standard" (i.e. Microsoft-style) MBR code to both disks of the RAID1 set. Then each disk must have the /boot partition marked active using the fdisk tool. The boot loader will then be installed to the Partition Boot Record of the /boot partition(s).

Some older documents prefer the LILO bootloader for RAID1 installations, but a modern GRUB works too, provided the installation is done carefully.

Here are some instructions I found with a quick Googling of "GRUB RAID1":
http://www.texsoft.it/index.php?c=hardware&m=hw.storage.grubraid1&l=it

MK
MK
Maaz
Valued Contributor

Re: raid configuration during installation

Stuart Browne
>If you are using Software RAID1, you can put the '/boot' ON
>the RAID volume.

If I can put the /boot on the RAID1 Volume, then I think only two RAID 1 volumes should be enough, as:
/ (raid 1): /dev/sda1, /dev/sdb1
swap (raid 1): /dev/sda2, /dev/sdb2
i.e no need to create /boot on a separate/different RAID Volume. Right or wrong please suggest?

>Once the machine is built, you need to do some grub trickery
>(grub-install) onto the 2nd hard-drive

which one is correct 1{a,b} or 2{a,b} ?
1a) grub-install /dev/sda
1b) grub-install /dev/sdb
OR
2a) grub-install /dev/sda1
2b) grub-install /dev/sdb1

Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: raid configuration during installation

>> If I can put the /boot on the RAID1 Volume, then I think only two RAID 1 volumes should be enough, as:
/ (raid 1): /dev/sda1, /dev/sdb1
swap (raid 1): /dev/sda2, /dev/sdb2
i.e no need to create /boot on a separate/different RAID Volume. Right or wrong please suggest?

Yes, there is no need, but remember to keep file systems separated according to their usage, this provides flexibility and isolation. For example, data and logs system should not be on / because can fill the file system and create a lot of problems.

I'm used to create a /boot separated of about 150 MB.

>Once the machine is built, you need to do some grub trickery
>(grub-install) onto the 2nd hard-drive

At grub prompt (press c), type:

grub> root (hd1,0)
grub> setup (hd1)
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?