OVH Install CentOS7 official kernel on dedicated server with soft raid configured.
I have installed CentOS 7 with soft raid on dedicated servers at OVH. (because it’s really cheap ones)
Because of some prerequisites incompatible with OVH’s ones.
- I must run a CentOS 7 or RHEL 7 official kernel
BUT
- OVH forces his custom kernels
- These kernels does not support SELinux and comes with GRS security
I searched solutions on the (one, two), but since I have configured raid none were working.
Since OVH Servers are unmanaged I have to fix it myself because you can not get support from OVH for kernel change.
So here is the solution if you are using raid on OVH servers with CentOS 7.
- Install CentOS 7 as usual from OVH console with raid configured.
- Login to server when it successfully boots
- Install original kernel “yum install kernel”
- Check grub configuration “vi /boot/grub2/grub.cfg” : new kernel should be appeared there in the list of available kernel , it’s usually will be second entry if it’s your first installation.
- edit default kernel to recently installed official kernel “vi /etc/default/grub” and change “GRUB_DEFAULT=1” in my case 1 is second entry in my grub “menuentry”
- At the time of this article “3.10.0–1062.9.1.el7.x86_64” is the version I have installed.
- Do not restart your server because it will fail to start.
- Now you have to rebuild initramfs with dracut :
# dracut — mdadmconf — fstab — add=”mdraid” — add-drivers=”raid1" -f /boot/initramfs-3.10.0–1062.9.1.el7.x86_64.img 3.10.0–1062.9.1.el7.x86_64
Note : If you have raid0 change raid1 to raid0.
Now you can restart your server and it should pick proper kernel with correct raid configuration.
Now You’re Done.