Differences between revisions 15 and 16
Revision 15 as of 2006-02-13 07:40:54
Size: 2608
Editor: JoeyHess
Comment:
Revision 16 as of 2008-11-08 15:09:30
Size: 3406
Editor: FranklinPiat
Comment: Lenny support SoftwareRaidRoot... screenshots
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
The newest installers have a working setup for RAID. Check SataRaid #language en

Lenny supports having the root and {{{/boot}}} partition on RAID volume. Actually, you can have root on RAID1+LVM partition.

This page contains some screenshots to demonstrate it.

== Root on software RAD+LVM ==
In this example, we use virtual machine ([:QEMU:qemu] or [:KVM:kvm])... we can play, and break them ;-)
 {{{
$ sudo apt-get install kvm

$ qemu-img create -f qcow2 hda.qcow2 4G
Formatting 'hda.qcow2', fmt=qcow2, size=4194304 kB

$ qemu-img create -f qcow2 hdb.qcow2 4G
Formatting 'hdb.qcow2', fmt=qcow2, size=4194304 kB

$ kvm -hda hda.qcow2 -hdb hdb.qcow2 -cdrom debian-lenny-i386-netinst.iso -boot d
}}}

Of course, you need to download a cdrom image.

==== Root on RAID+LVM example ====
Those few screenshots show how to install root on lvm on raid :

Once you have reach DebianInstaller partitioning screen...

Choose manual partitioning, then on each disk, manually create a partition (same size on both disks).

===== Create partitions for RAID =====
 * {{{Use as "Physical volume for Raid"}}} : [[BR]] inline:00.gif

===== Configure RAID =====
 * We have a raid partition on each disk: [[BR]] inline:01.gif
 * Choose the type of multidisk device to be created: [[BR]] inline:02.gif
 * We have two partition: [[BR]] inline:03.gif
 * (In this example, we have no spare partition).
 * Let's select the partitions to use: [[BR]] inline:04.gif
 * That's it ! [[BR]] inline:05.gif

===== Configure LVM =====
 * Let's configure the Logical volume manager: [[BR]] inline:06.gif
 * First create a volume group: [[BR]] inline:07.gif
 * Here, I chose the name ''vg1'' for the group: [[BR]] inline:08.gif
 * We have only one raid device: [[BR]] inline:09.gif
 * Let's create the ''logical volume'' (kind pf partitions): [[BR]] inline:10.gif
 * Our Logical volume (LV) will use some disk space from ''vg1'' (which belongs to ''md0''): [[BR]] inline:11.gif
 * I named my partition ''foobar_root'': [[BR]] inline:12.gif
 * In this example, we wont split the filesystem (we won't even bother to create a swap, which is a bad idea), so I use all the disk space. (which again isn't a good idea, since it's so easy ro resize a partition with LVM) [[BR]] inline:13.gif
 * Finish: [[BR]] inline:14.gif

===== Use the LVM volumes =====
 * Let's assign and format the volumes (''partitions''): [[BR]] inline:15.gif
 * As usually... [[BR]] inline:16.gif
 * Done! [[BR]] inline:17.gif

===== Install the bootloader (lilo) =====
''At the end of the installation...''
 * because we have root on RAID, DebianInstaller automatically switch to [:LILO:lilo]: [[BR]]inline:20.gif

===== Reboot Debian =====
 * Debian is booting: [[BR]] inline:oo.gif
Line 5: Line 66:
## Auto-converted by kwiki2moinmoin v2005-10-07
There needs to be a method to install Debian onto a software RAID
mirror. This has been lacking for years it seems. Others have
figured it out, why hasn't Debian?
==== Using D-I rescue, to reinstall lilo ====
Thanks to DebianInstaller's rescue mode, it's very easy to recover a problem :
Line 10: Line 69:
Tools like mdadm and raidtools2 are out there. However the current
kernel-images don't even support having "/" on a ["RAID1"] mirror.
 * Simply boot on the CD, and choose ''rescue'' mode, then after the usual DI prompt, you get : [[BR]] inline:rescue00.gif
 * Then: [[BR]] inline:rescue01.gif
## * Yeah, ok : inline:rescue02.gif
 * Reinstall/ rescue/restore lilo : [[BR]] inline:rescue03lilo.gif
Line 13: Line 74:
----

Only inclusion of the mdadm package and the corresponding kernel options would be enough for me...

----

The above comments are both correct.

To fix this, the first step would be to include the Software Raid into a bootable kernel. This could even be a seperate kernel on the boot CD, as to not interfere with the existing install kernel. Call it 'kernel-raid' or something simular. Also, the raidtools2 or mdadm utilties would have to be included. Finally, the installer would have to know how to create a raid drive, much like it makes a lvm disk. Finally, the installer would have to install the raid version of the kernel in place of the non-raid kernel.

A series of raid-enabled kernels in the default repositories would be nice as well.

Remember, Debian's competition is already doing this. That might not be enough for some developers to work on this, but then again it might be just the motivation needed for others.

----

I'm not sure about how official this is. But personally I have installed Sarge from scratch on the 12th of October 2004 (testing, installer+Base CD iso) and am pleased to be able to tell you that installing on ["RAID1"] did Just Work(TM). The installation boots a initrd kernel and assembles (using mdadm) the raid devices for my root partition and swap partition in the initrd using modules, thus not needing different kernels. It even works so good that I haven't bothered yet recompiling my own kernel yet. Although I will do that eventually anyway.

----

About the previous comment: This is because the stock kernel-image packages have the necessary modules in initrd. The rootraiddoc debian documentation says that for raid modules to load through initrd with a / raid volume, the initrd kernel should boot from a non-raid volume. This doesn't seem to be the case, however - it looks like grub can pull the initrd.img at boot time from a raid volume anyway...

----

You know you are not close to the leading edge when you try raid on Debian. If it is possible I would appreciate a how-to on raid1 using Debian Installer in testing.

---
== See also ==
 * Recover a !DegradedArray RAID array ~-[[BR]] [http://lists.debian.org/debian-user/2008/10/msg01989.html]-~
 * DebianInstaller
 * http://www.tldp.org/HOWTO/RAID-HOWTO/
 * http://www.tldp.org/HOWTO/LVM-HOWTO/

Lenny supports having the root and /boot partition on RAID volume. Actually, you can have root on RAID1+LVM partition.

This page contains some screenshots to demonstrate it.

Root on software RAD+LVM

In this example, we use virtual machine ([:QEMU:qemu] or [:KVM:kvm])... we can play, and break them ;-)

  • $ sudo apt-get install kvm
    
    $ qemu-img create -f qcow2 hda.qcow2 4G
    Formatting 'hda.qcow2', fmt=qcow2, size=4194304 kB
    
    $ qemu-img create -f qcow2 hdb.qcow2 4G
    Formatting 'hdb.qcow2', fmt=qcow2, size=4194304 kB
    
    $ kvm -hda hda.qcow2  -hdb hdb.qcow2  -cdrom debian-lenny-i386-netinst.iso -boot d

Of course, you need to download a cdrom image.

Root on RAID+LVM example

Those few screenshots show how to install root on lvm on raid :

Once you have reach DebianInstaller partitioning screen...

Choose manual partitioning, then on each disk, manually create a partition (same size on both disks).

Create partitions for RAID
  • Use as "Physical volume for Raid" : ?BR inline:00.gif

Configure RAID
  • We have a raid partition on each disk: ?BR inline:01.gif

  • Choose the type of multidisk device to be created: ?BR inline:02.gif

  • We have two partition: ?BR inline:03.gif

  • (In this example, we have no spare partition).
  • Let's select the partitions to use: ?BR inline:04.gif

  • That's it ! ?BR inline:05.gif

Configure LVM
  • Let's configure the Logical volume manager: ?BR inline:06.gif

  • First create a volume group: ?BR inline:07.gif

  • Here, I chose the name vg1 for the group: ?BR inline:08.gif

  • We have only one raid device: ?BR inline:09.gif

  • Let's create the logical volume (kind pf partitions): ?BR inline:10.gif

  • Our Logical volume (LV) will use some disk space from vg1 (which belongs to md0): ?BR inline:11.gif

  • I named my partition foobar_root: ?BR inline:12.gif

  • In this example, we wont split the filesystem (we won't even bother to create a swap, which is a bad idea), so I use all the disk space. (which again isn't a good idea, since it's so easy ro resize a partition with LVM) ?BR inline:13.gif

  • Finish: ?BR inline:14.gif

Use the LVM volumes
  • Let's assign and format the volumes (partitions): ?BR inline:15.gif

  • As usually... ?BR inline:16.gif

  • Done! ?BR inline:17.gif

Install the bootloader (lilo)

At the end of the installation...

  • because we have root on RAID, DebianInstaller automatically switch to [:LILO:lilo]: ?BRinline:20.gif

Reboot Debian
  • Debian is booting: ?BR inline:oo.gif

Using D-I rescue, to reinstall lilo

Thanks to DebianInstaller's rescue mode, it's very easy to recover a problem :

  • Simply boot on the CD, and choose rescue mode, then after the usual DI prompt, you get : ?BR inline:rescue00.gif

  • Then: ?BR inline:rescue01.gif

  • Reinstall/ rescue/restore lilo : ?BR inline:rescue03lilo.gif

See also