This instruction below is how to configure software RAID 1 on Untangle 11.

After finished Untangle 11 installation follow the instruction below to complete  software RAID configuration.

Install mdadm

Backup reposiroty configuration

cp /etc/apt/sources.list /etc/apt/sources.list.bk

Edit repository

vi /etc/apt/sources.list

Uncomment lines below

deb http://ftp.debian.org/debian wheezy main contrib non-free
deb http://security.debian.org wheezy/updates main contrib non-free
deb http://backports.debian.org/debian-backports wheezy-backports main contrib non-free

Update software list and install mdadm

apt-get update
apt-get install mdadm

Add following modules to Kernel

modprobe md
modprobe linear
modprobe multipath
modprobe raid0
modprobe raid1
modprobe raid5
modprobe raid6
modprobe raid10

Restore repository configuration.

cp /etc/apt/sources.list.bk /etc/apt/sources.list

Create patition table for /dev/sdb

sfdisk -d /dev/sda | sfdisk /dev/sdb
fdisk /dev/sdb
Command (m for help): t
Partition number (1-5): 1
Hex code (type L to list codes): fd
Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)

Check existing raid confiuguration.

mdadm --zero-superblock /dev/sdb1
mdadm --zero-superblock /dev/sdb5

It should Return following below

mdadm: Unrecognised md component device - /dev/sdb1
mdadm: Unrecognised md component device - /dev/sdb5

Create RAID on /dev/sdb, /dev/md0 is root, /dev/md5 is swap

mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-disks=2 missing /dev/sdb1
mdadm --create /dev/md1 --metadata=0.90 --level=1 --raid-disks=2 missing /dev/sdb5

Create File system for RAID

mkfs.ext3 /dev/md0
mkswap /dev/md1

Generate RAID configuration

cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.bk
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
cat /etc/mdadm/mdadm.conf
ARRAY /dev/md0 UUID=xxx
ARRAY /dev/md1 UUID=xxx

Use blkid command to get UUID information.

blkid
/dev/sda5: UUID="xxx" TYPE="swap"
/dev/sda1: UUID="xxx" TYPE="ext3"

/dev/sdb1: UUID="xxx" TYPE="linux_raid_member"
/dev/sdb5: UUID="xxx" TYPE="linux_raid_member"

/dev/md0: UUID="xxx" SEC_TYPE="ext2" TYPE="ext3"
/dev/md1: UUID="xxx" TYPE="swap"

Mount /dev/md0

mkdir /mnt/md0
mount /dev/md0 /mnt/md0

Edit fstab to mount /dev/md0, /dev/md1

cp /etc/fstab /etc/fstab.bk
vi /etc/fstab

UUID=THISSHOUDBEUUIDof/dev/md0 / ext3 errors=remount-ro 0 1
UUID=THISSHOUDBEUUIDof/dev/md1 none swap sw 0 0

Edit Grub for /dev/sdb

cp /boot/grub/menu.lst /boot/grub/menu.lst.bk
vi /boot/grub/menu.lst

default saved
fallback 1

title Debian GNU/Linux, kernel 3.2.0-4-untangle-amd64(HDD0-sda)
root (hd0,0)
kernel /boot/vmlinuz-3.2.0-4-untangle-amd64 root=UUID=THISSHOUDBEUUIDof/dev/sda1 ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash nomodeset
initrd /boot/initrd.img-3.2.0-4-untangle-amd64
savedefault

title Debian GNU/Linux, kernel 3.2.0-4-untangle-amd64(HDD1-sdb)
root (hd1,0)
kernel /boot/vmlinuz-3.2.0-4-untangle-amd64 root=UUID=THISSHOUDBEUUIDof/dev/md0 ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash nomodeset
initrd /boot/initrd.img-3.2.0-4-untangle-amd64
savedefault

Updates an existing initramfs.

update-initramfs -u

Copy all files from /dev/sda to /dev/md0

cp -dpRx / /mnt/md0
cd /boot
cp -dpRx . /mnt/md0

Install Grub on /dev/sdb

grub
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)
quit
reboot

boot up with /dev/sdb (/dev/md0)

[root @ untangle] ~ # df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 35G 1.9G 32G 6% /
udev 10M 0 10M 0% /dev
tmpfs 397M 304K 396M 1% /run
/dev/disk/by-uuid/THISSHOUDBEUUIDof/dev/md0 35G 1.9G 32G 6% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.7G 0 1.7G 0% /run/shm

Preapare patition for /dev/sda

fdisk /dev/sda
Command (m for help): t
Partition number (1-5): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)

Command (m for help): w
The partition table has been altered!

Add /dev/sda to RAID array

mdadm --add /dev/md0 /dev/sda1
mdadm --add /dev/md1 /dev/sda5

Use command below to monitor RAID recovery status.

watch cat /proc/mdstat

Every 2.0s: cat /proc/mdstat Tue Dec 2 14:30:07 2014

Personalities : [raid1]
md1 : active raid1 sda5[2] sdb5[1]
4656064 blocks [2/1] [_U]
resync=DELAYED

md0 : active raid1 sda1[2] sdb1[1]
37283776 blocks [2/1] [_U]
[===================>.] recovery = 97.6% (36410880/37283776) finish=0.7min speed=18390K/sec

unused devices: <none>

After RAID rebuild completed, Remove old raid configuration.

vi /etc/mdadm/mdadm.conf
Remove follwoing
ARRAY /dev/md0 metadata=0.90 UUID=xxxxx
ARRAY /dev/md1 metadata=0.90 UUID=xxxxx

Now generate new RAID configuration

mdadm --examine --scan >> /etc/mdadm/mdadm.conf
cat /etc/mdadm/mdadm.conf

Edit Grub for sda to boot from RAID (/dev/md0)

vi /boot/grub/menu.lst
title Debian GNU/Linux, kernel 3.2.0-4-untangle-amd64[HDD0-sda]
root (hd0,0)
kernel /boot/vmlinuz-3.2.0-4-untangle-amd64 root=UUID=THISSHOUDBEUUIDof/dev/md0 ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash nomodeset
initrd /boot/initrd.img-3.2.0-4-untangle-amd64
savedefault

title Debian GNU/Linux, kernel 3.2.0-4-untangle-amd64[HDD1-sdb]
root (hd1,0)
kernel /boot/vmlinuz-3.2.0-4-untangle-amd64 root=UUID=THISSHOUDBEUUIDof/dev/md0 ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash nomodeset
initrd /boot/initrd.img-3.2.0-4-untangle-amd64
savedefault

Updates an existing initramfs.

update-initramfs -u

Reboot server, Now you are complete configuration for Untangle software RAID and you should be able to boot from any harddisk(sda, sdb) also system still working if 1 of 2 disk failed.