Software RAID10 setup scripts

  • Thread starter Thread starter vlad
  • Start date Start date
V

vlad

Guest
I built this for my own use but thought maybe someone else will find a use for it too. Just run two scripts, first script will setup partitions on empty drives, then reboot and run second script which will complete process. It very much solves the problem for me where I have to wait for each task to complete.

Proxmox VE setup requirements:
- initramfs-tools mdadm
(apt-get -y install initramfs-tools mdadm)
- at least 4 hard drives of same size
(sda, sdb.. or hda, hdb.. and etc)

Usage:
Extract archive and switch to proxmox-raid10 directory.
./raid1.sh sda "sdb sdc sdd"
where sda is hard drive block device under /dev where proxmox installed
and "sdb sdc sdd" are blank block devices to be used in raid setup, quotes required

after reboot run ./raid2.sh to complete process.

Even though this will protect root and data volumes, you still need to mirror boot partitions to other hard drives, maybe setup cron script.

The data volume is not extended all the way, about 4gb of free space will be left for snapshots. You can fix this by removing lvreduce line from raid2.sh script.

This script was tested by me only on Proxmox VE 1.4. I can't guarantee that its safe, use it on your own risk. Very little error checking done.

--Vlad
 

Attachments

Hi Vlad,

Thats was exactly what i need, i test it soon as posible on a new test server.

I dont realy know how to do the boot script.

Can you show me an exemple plz.

Regards,

Tes.
 
Very basically need to duplicate boot partition to other drives, assuming sda1 is boot partition then you need to do something like this:
dd if=/dev/sda1 of=/dev/sdb1
dd if=/dev/sda1 of=/dev/sdc1
dd if=/dev/sda1 of=/dev/sdd1

I run above after "apt-get upgrade", also you can include it in /etc/rc.local that way partitions will be duplicated every time you boot.

--Vlad
 
Hi Vlad,

Wile the syncr i have pveperf like :
BUFFERED READS: 260 MB/sec
AVERAGE SEEK TIME: 8.62 ms
FSYNCS/SECOND: 100

After syncr finish :
BUFFERED READS: 79.05 MB/sec
AVERAGE SEEK TIME: 8.62 ms
FSYNCS/SECOND: 176.05

Same hardware with no raid :
BUFFERED READS: 115.22 MB/sec
AVERAGE SEEK TIME: 9.52 ms
FSYNCS/SECOND: 1140.32

Not shure if its normal ?

Regards,
Tes.
 
Hi,

after :
blockdev --setra 4096 /dev/md0
blockdev --setra 4096 /dev/pve/data

pveperf /var/lib/vz
BUFFERED READS: 142.97 MB/sec
AVERAGE SEEK TIME: 13.42 ms
FSYNCS/SECOND: 186.99

pveperf /root
BUFFERED READS: 80.21 MB/sec
AVERAGE SEEK TIME: 8.75 ms
FSYNCS/SECOND: 179.93

pveperf /boot
BUFFERED READS: 121.88 MB/sec
AVERAGE SEEK TIME: 6.78 ms
FSYNCS/SECOND: 1528.51

To be shure i do that :

pveperf /root
BUFFERED READS: 77.62 MB/sec
AVERAGE SEEK TIME: 8.92 ms
FSYNCS/SECOND: 173.94

blockdev --setra 4096 /dev/pve/root

pveperf /root
BUFFERED READS: 142.48 MB/sec
AVERAGE SEEK TIME: 9.00 ms
FSYNCS/SECOND: 169.87

Regards,
Tes
 
Hi Vlad. Thank you for awesome script. But one more question about upgrade on 3.0.
My system upgraded, and booted normaly with script 2.3 to 3.0. But have some errors on start sometyng about LVM.
Did you try update ur systems and need to do something else exept script update? My system now works pretty good on Wheezy.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!