How to use exising MD devices with anaconda 19.31.77-1 in RHEL7rc?
Mikolaj Kucharski
mikolaj at kucharski.name
Fri May 16 03:16:04 UTC 2014
Hi,
I'm giving a spin RHEL7rc[1]. I had machine with 4 drives (2x3TB and
2x500GB), with following disk configuration:
part raid.11 --size=512 --ondisk=sda --asprimary # /boot
part raid.12 --size=2048 --ondisk=sda --asprimary # swap
part raid.13 --size=2048 --ondisk=sda --asprimary # /
part raid.15 --size=1 --grow --ondisk=sda # /var
part raid.21 --size=512 --ondisk=sdb --asprimary # /boot
part raid.22 --size=2048 --ondisk=sdb --asprimary # swap
part raid.23 --size=2048 --ondisk=sdb --asprimary # /
part raid.25 --size=1 --grow --ondisk=sdb # /var
part raid.31 --size=512 --ondisk=sdc --asprimary # /boot
part raid.32 --size=2048 --ondisk=sdc --asprimary # swap
part raid.33 --size=2048 --ondisk=sdc --asprimary # /
part raid.35 --size=1 --grow --ondisk=sdc # /var
part raid.41 --size=512 --ondisk=sdd --asprimary # /boot
part raid.42 --size=2048 --ondisk=sdd --asprimary # swap
part raid.43 --size=2048 --ondisk=sdd --asprimary # /
part raid.45 --size=1 --grow --ondisk=sdd # /var
raid /boot --fstype ext4 --level=1 --device=md1 raid.11 raid.21 raid.31 raid.41
raid swap --fstype swap --level=10 --device=md2 raid.12 raid.22 raid.32 raid.42
raid / --fstype ext4 --level=10 --device=md3 raid.13 raid.23 raid.33 raid.43
raid pv.01 --level=1 --device=md8 raid.15 raid.35
raid pv.02 --level=1 --device=md9 raid.25 raid.45
volgroup vg0 pv.01 pv.02
logvol /var --fstype ext4 --vgname=vg0 --size=1 --grow --name=lv0
However one of the 500GB drives died and I'm waiting for replacement.
All data is already wiped on existing drives, so I can do whatever I
want on them.
I would like to install RHEL7 before my replacement drive arrives, but I
don't know how to specify `missing' (like in mdadm(8)) in Kickstart
file, so I decided to create all partitions, MD and LVM volumes by hand:
(drives have beginning and end of the drive wiped)
parted -s /dev/sdX -- mklabel msdos # 500GB
parted -s /dev/sdX -- mklabel gpt # 3TB
Partitions created with parted as:
mkpart primary 2048s 512MB # 512MB
mkpart primary 512MB 2560MB # 2GB
mkpart primary 2560MB 4608MB # 2GB
mkpart primary 4608MB -1 # *
MD devices created with:
mdadm -C /dev/md1 -e default -n 4 -l raid1 /dev/sda1 /dev/sdb1 /dev/sdc1 missing
mdadm -C /dev/md2 -e default -n 4 -l raid10 /dev/sda2 /dev/sdb2 /dev/sdc2 missing
mdadm -C /dev/md3 -e default -n 4 -l raid10 /dev/sda3 /dev/sdb3 /dev/sdc3 missing
mdadm -C /dev/md4 -e default -n 2 -l raid1 /dev/sda4 /dev/sdc4
mdadm -C /dev/md5 -e default -n 2 -l raid1 /dev/sdb4 missing
Assembly devices with:
mdadm -A /dev/md1 /dev/sda1 /dev/sdb1 /dev/sdc1
mdadm -A /dev/md2 /dev/sda2 /dev/sdb2 /dev/sdc2
mdadm -A /dev/md3 /dev/sda3 /dev/sdb3 /dev/sdc3
mdadm -A /dev/md4 /dev/sda4 /dev/sdc4
mdadm -A /dev/md5 /dev/sdb4
Logical volume created as:
pvcreate /dev/md4 /dev/md5
vgcreate vg0 /dev/md4 /dev/md5
vgchange -ay vg0
lvcreate -l 100%VG -n lv0 vg0
At this stage I have all devices needed to install the OS:
/dev/md1 swap
/dev/md2 /
/dev/md3 /boot
/dev/vg0/lv0 /var
However when Anaconda starts, Dracut assebles the devices during %pre
stage, I can start sshd via %pre script, I can login I can see volumes
assembled (even if they wouldn't I can assembly them by hand in %pre),
then Anaconda starts scaning storage devices, storage.log is filled with
disocvered details and MD devices are all stopped (well, md4 and md5
fail to stop as they are busy, while being part of LVM) and installation
fails with nonexsitent device md1.
So, my question is, how to use exising partitions, to make Anaconda
format them and install the OS? Actually, I can format them too, but how
to make Anaconda keep going and insall everything. I've tried --onpart,
--useexisting in so many different ways. I think I've tested all most
obvious possible setups, but eatch time Anaconda stopped MD devices and
Kickstart failed with nonexistent md device.
Here are some examples:
# fail, this doesn't work
clearpart --none
part /boot --fstype ext4 --onpart /dev/md1
part swap --fstype swap --onpart /dev/md2
part / --fstype ext4 --onpart /dev/md3
part /var --fstype ext4 --onpart /dev/vg0/lv0
# fail, this doesn't work
clearpart --none
raid /boot --fstype ext4 --useexisting --device=md1
raid swap --fstype swap --useexisting --device=md2
raid / --fstype ext4 --useexisting --device=md3
raid pv.01 --useexisting --device=md4
raid pv.02 --useexisting --device=md5
volgroup vg0 pv.01 pv.02
logvol /var --fstype ext4 --vgname=vg0 --size=1 --grow --name=lv0
Also, I don't exactly care how I can install RHEL7rc (as long as it's
automatic, and I can repeat the step multiple times), but how to do it
with missing drive, so when it arrices, I can just plug it in, partition
it, re-install bootloader, and sync raid.
[1]: http://ftp.redhat.com/redhat/rhel/rc/7/
--
best regards
q#
More information about the Kickstart-list
mailing list