Install CentOS7 with Software RAID 1

From Alteeve Wiki
Revision as of 19:48, 5 October 2014 by Digimer (talk | contribs) (Created page with "{{howto header}} = The Goal = A problem I had been struggling with since the release of RHEL/CentOS 7 is how to install on a software RAID 1 array such that either disk coul...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 AN!Wiki :: How To :: Install CentOS7 with Software RAID 1

The Goal

A problem I had been struggling with since the release of RHEL/CentOS 7 is how to install on a software RAID 1 array such that either disk could be used to boot.

The Problem

There are two problems;

  1. The default behaviour of anaconda prevents the creation of the biosboot partition on both disks. When I tried to to manually create the partitions by dropping to shell, anaconda would later fault out and the install would not complete. To get around this, a kickstart script is needed, which was booted off of a PXE server.
  2. After the kickstart install, only one disk was bootable. Trying to install grup on the second disk caused a crash.

The Fixes

Install

I have a PXE Server already, so I decided to create a kickstart script and added an entry for it.

The kickstart script used to perform the CentOS 7 install was:

Note: Update this to match the IP of your PXE server and update the partition sizes, host name and desired VG name to what you want.
Note: The root password is 'initial'.
#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512

# Use network installation
url --url="http://10.255.255.254/c7/x86_64/img/"

# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=sda,sdb

# Keyboard layouts
keyboard us

# System language
lang en_CA.UTF-8

# Network information
network  --bootproto=dhcp --ipv6=auto --activate
network  --hostname=an-nas02.kw01.alteeve.ca

# Root password
rootpw --iscrypted $6$0riSEDMyCvHPdhCv$lvuhEOqU2yo9szCJHtAsVUK3maHyWlpZmVi6PCRkrOfifL/38J7SaGUopehv/rzwQvhqxNla/jPvD10uwuPY4/

# System timezone
timezone Europe/London --isUtc

# System bootloader configuration
bootloader --location=mbr --boot-drive=sda

# Partition clearing information
clearpart --drives=sda,sdb --all --initlabel 

# Disk partitioning information
part biosboot --fstype=biosboot --size=2 --ondisk=sda
part biosboot --fstype=biosboot --size=2 --ondisk=sdb

part raid.11 --size=500 --grow --ondisk=sda
part raid.12 --size=500 --grow --ondisk=sdb

raid pv.11 --fstype="lvmpv" --level=1 --device=md0 raid.11 raid.12

volgroup an-nas02_vg0 --pesize=4096 pv.11

logvol swap  --fstype="swap" --size=32768  --name=lv_swap --vgname=an-nas02_vg0
logvol /boot --fstype="xfs"  --size=512    --name=lv_boot --vgname=an-nas02_vg0
logvol /     --fstype="xfs"  --size=256000 --name=lv_root --vgname=an-nas02_vg0

eula --agreed

%packages
@core
vim
perl

%end

To boot off of this kickstart file, I used the following PXE boot entry:

LABEL c7_x86_64
        MENU LABEL ^2) CentOS 7 x86_64 - an-nas02
        KERNEL boot/c7/x86_64/vmlinuz
        APPEND initrd=boot/c7/x86_64/initrd.img inst.repo=http://10.255.255.254/c7/x86_64/img/ ks=http://10.255.255.254/c7/x86_64/ks/an-nas02.ks

With this in place, boot off of the PXE server, select the entry and go grab a coffee. When you get back, the install should be finished.

Booting Off Both Disks

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.