Raid 5 on proxmox 3.2

http://susilon.wordpress.com/2014/06/19/how-to-install-proxmox-ve-3-2-on-software-raid-mdraid/

but is smaller bug in create raid 5 disk array

I’m having trouble configuring RAID 1 on IBM X3250-M4 server, because I’m actually a programmer, not a system admin. So, i went to google, and find out that the RAID controller on board the server is FAKE-RAID, oh my.

Google sent me to this following URL, which helped me to configure my server into RAID1 Proxmox VM Server, using software MDRAID.

http://boffblog.wordpress.com/2013/08/22/how-to-install-proxmox-ve-3-0-on-software-raid/ and
http://blog.bravi.org/?p=1100

The difference is,  my server use disk with GPT, and UEFI. i have 2 disks, which is /dev/sda and /dev/sdb.

So this is the step i made : (before trying out to the real server, you can install proxmox in virtualbox as trial server)

Install proxmox into /dev/sda

i do not have a valid subscription for proxmox, so i edit the source list

vim /etc/apt/sources.list.d/pve-enterprise.list

and comment the following line

#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise

Updating installed promox

apt-get update

apt-get dist-upgrade

Install the softwares

apt-get install vim initramfs-tools mdadm

mdam installer will ask you some question, just click OK with no modification

copy the partition table from /dev/sda to /dev/sdb

sgdisk -R=/dev/sdb /dev/sda

sgdisk -R=/dev/sdc /dev/sda

sgdisk-R=/dev/sdd /dev/sda


change partition /dev/sdb2 (boot) and /dev/sdb3 (lvm) to Software RAID

sgdisk -t 2:fd00 /dev/sdb

sgdisk -t 2:fd00 /dev/sdc

sgdisk -t 2:fd00 /dev/sdd

sgdisk -t 3:fd00 /dev/sdb

sgdisk -t 3:fd00 /dev/sdc

sgdisk -t 3:fd00 /dev/sdd

Initialize the RAID

mdadm –create /dev/md1 –level=5 –raid-disks=4 missing /dev/sdb2 /dev/sdc2 /dev/sdd2

mdadm –create /dev/md2 –level=5 –raid-disks=4 missing /dev/sdb3 /dev/sdc3 /dev/sdd3

Copy the /boot from /dev/sda2 to the newly created /dev/md1

mkfs.ext3 /dev/md1

mkdir /mnt/md1

mount /dev/md1 /mnt/md1

cp -ax /boot/* /mnt/md1

Edit the fstab file

vim /etc/fstab

In the line containing UUID

Example.   UUID=c8ac59b8-ce54-4fca-8107-1b04aaa0194d /boot ext3 defaults 0 1

we replace the UUID part with /dev/md1

/dev/md1 /boot ext3 defaults 0 1

 

echo 'GRUB_DISABLE_LINUX_UUID=true' >> /etc/default/grub
echo 'GRUB_PRELOAD_MODULES="raid mdraid1x"' >> /etc/default/grub
echo raid5 >> /etc/modules
echo raid5 >> /etc/initramfs-tools/modules
grub-install /dev/sd[abde]
mdadm --detail --scan | cut -d " " -f 4 --complement >> /etc/mdadm/mdadm.conf
update-grub
update-initramfs -u

Add the /dev/sda2 to the RAID, first, change the type to software RAID

sgdisk -t 2:fd00 /dev/sda

add to RAID

mdadm –add /dev/md1 /dev/sda2

Move the LVM to /dev/md2

pvcreate /dev/md2

vgextend pve /dev/md2

pvmove /dev/sda3 /dev/md2

Except your disk size less than 100GB, You can now go to sleep, or go to nearby coffeshops, as this steps will take some time depending on the CPU and disk size.

Continue the PVE removal

vgreduce pve /dev/sda3

pvremove /dev/sda3

Change the partition of LVM /dev/sda3 to Software RAID

sgdisk -t 3:fd00 /dev/sda

Add to RAID

mdadm-add /dev/md2 /dev/sda3

and check the process

cat /proc/mdstat

 

The rest of the process is i tried simulating the removal of disk 0, start the server, run with only disk 1, insert the disk 0 again, and yes it works.

if you having problem while attach new disk, to replace the failed disk, you can check this following URL :

http://ubuntuforums.org/showthread.php?t=1764861