4

I'm trying to use parted to partition my entire drives automatically during the CentOS kickstart install, however, I'm getting two issues with my install. I want to kickstart my installs across multiple devices without any required user input.

Issue 1 UNSOLVED: Came across the Assign Devices screen which required user input. Ex: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/Assign_Storage_Devices-ppc.html. What can I do to avoid this?

Issue 2 RESOLVED: On the second attempt of the install, it is saying the software RAID device is already in use and causes the install to exit. (Maybe from the previous install or the last try) How do I avoid this error?

Resolution of Issue 2: I resolved issue two by writing a script for the %pre section:

%pre
#!/bin/bash
for x in `ls /dev/sd[a-z][1-9]`
do
    mdadm --misc --zero-superblock $x
done

Exact error: The software RAID array name "md1" is already in use.

My top section (part / raid commands):

raid /boot --fstype=ext4 --level=1 --device=md0 /dev/sda1 /dev/sdb1
raid / --fstype=ext4 --level=1 --device=md1 /dev/sda2 /dev/sdb2

Then in my %pre section:

%pre

parted -s /dev/sda mklabel gpt
parted -s /dev/sda mkpart 1 1MB 200MB
parted -s /dev/sda mkpart 2  200MB 16GB
parted -s /dev/sda mkpart 3 16GB -1
parted -s /dev/sda set 1 raid on
parted -s /dev/sda set 2 raid on

parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart 1 1MB 200MB
parted -s /dev/sdb mkpart 2 200MB 16GB
parted -s /dev/sdb mkpart 3 16GB -1
parted -s /dev/sdb set 1 raid on
parted -s /dev/sdb set 2 raid on
Devon
  • 780
  • 1
  • 9
  • 20
  • If you switch to a shell what does `mdadm --examine /dev/sda` and `mdadm --examine /dev/sdb` tell you? – Gene Oct 06 '14 at 21:30
  • @Gene, well I assume they are part of the RAID array because of either a previous install or the current one. But two things, I can't switch to the shell. The install fails near immediately and will only let me reboot, so if you know of a way, feel free to share. Secondly, I just need a way to overwrite or remove all RAID arrays prior as I don't want to have to use any user input in the future. I'm unsure why these RAID devices would even be started during the install. – Devon Oct 06 '14 at 21:48
  • They might be there from a previous failed attempt. You can boot into rescue mode to run mdadm, or you can use CTRL+ALT+F1, F2, F3, or F4 to access a shell during the installer. I don't recall off the top of my head which tty has the shell. – Gene Oct 06 '14 at 21:54
  • @Gene. I resolved issue 2 with a script I wrote in the %pre section to zero all superblocks. Issue 1 still remains though. It takes me to the Assign Storage Devices screen. Not sure why since I have the /boot and / specified in the raid section. Am I missing a part of the storage configuration? – Devon Oct 06 '14 at 22:03
  • I am not certain. If I have some time later I'll give it a try and see if I can duplicate the problem. What version of CentOS are you using? – Gene Oct 06 '14 at 22:17
  • @Gene 6.5, thanks. I was able to bypass that with text mode but now I get a swapon failed message on /dev/sdb1. Well obviously, because /dev/sdb1 belongs to the RAID. Why is it trying to turn on swap when I don't even have any swap partitions listed in my kickstart? – Devon Oct 06 '14 at 22:34
  • It's trying to autoconfigure it. It doesn't appear kickstart supports installation without setting up swap. – Gene Oct 06 '14 at 22:57

0 Answers0