xcat2 / xcat-extensions

Repos to store scripts for special user cases
4 stars 8 forks source link

raid1_rh.sh may fail if a previous md raid exists #40

Closed Obihoernchen closed 6 years ago

Obihoernchen commented 6 years ago

Hi,

this is just for reference and you may want to add a few changes I did to radi1_rh.sh.

For me raid1_rh.sh failed if a previous md raid with a different layout existed.

I got the following error:

[2018-09-20T02:40:11+02:00] An unknown error has occured, look at the /tmp/anaconda-tb* file(s) for more details
[2018-09-20T02:40:11+02:00] ESC[1;24rESC[HESC[23;1HESC[1;23rESC[HESC[23;1H
[2018-09-20T02:40:14+02:00] ===============================================================================
[2018-09-20T02:40:14+02:00] An unknown error has occurred
[2018-09-20T02:40:14+02:00] ===============================================================================
[2018-09-20T02:40:14+02:00] anaconda 21.48.22.134-1 exception report
[2018-09-20T02:40:14+02:00] Traceback (most recent call first):
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/devicelibs/mdraid.py", line 253, in mddeactivate
[2018-09-20T02:40:14+02:00]     raise MDRaidError("mddeactivate failed for %s: %s" % (device, msg))
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/devices/md.py", line 548, in teardown
[2018-09-20T02:40:14+02:00]     mdraid.mddeactivate(self.path)
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/devices/storage.py", line 515, in _preDestroy
[2018-09-20T02:40:14+02:00]     self.teardown()
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/devices/storage.py", line 524, in destroy
[2018-09-20T02:40:14+02:00]     self._preDestroy()
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/deviceaction.py", line 344, in execute
[2018-09-20T02:40:14+02:00]     self.device.destroy()
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 373, in processActions
[2018-09-20T02:40:14+02:00]     action.execute(callbacks)
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 380, in doIt
[2018-09-20T02:40:14+02:00]     self.devicetree.processActions(callbacks)
[2018-09-20T02:40:14+02:00]   File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 230, in turnOnFilesystems
[2018-09-20T02:40:14+02:00]     storage.doIt(callbacks)
[2018-09-20T02:40:14+02:00]   File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 206, in doInstall
[2018-09-20T02:40:14+02:00]     turnOnFilesystems(storage, mountOnly=flags.flags.dirInstall, callbacks=callbacks_reg)
[2018-09-20T02:40:14+02:00]   File "/usr/lib64/python2.7/threading.py", line 765, in run
[2018-09-20T02:40:14+02:00]     self.__target(*self.__args, **self.__kwargs)
[2018-09-20T02:40:14+02:00]   File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 227, in run
[2018-09-20T02:40:14+02:00]     threading.Thread.run(self, *args, **kwargs)
[2018-09-20T02:40:14+02:00] MDRaidError: mddeactivate failed for /dev/md/taurusml2:2: 1
[2018-09-20T02:40:14+02:00] 
[2018-09-20T02:40:14+02:00] What do you want to do now?
[2018-09-20T02:40:14+02:00] 1) Report Bug
[2018-09-20T02:40:14+02:00] 2) Debug
[2018-09-20T02:40:14+02:00] 3) Quit

I was able to fix this reliable by adding the following commands before part 2 in https://github.com/xcat2/xcat-extensions/blob/master/partition/raid1_rh.sh

# erase all existing md RAIDs
mdadm --stop /dev/md/*
mdadm --zero-superblock ${disk1}*
mdadm --zero-superblock ${disk2}*

Furthermore, I added the following as well:

# disable md RAID resync during installation
# this speeds up the installation process significantly
echo 0 > /proc/sys/dev/raid/speed_limit_max
echo 0 > /proc/sys/dev/raid/speed_limit_min

With these lines the installation process is way faster. Especially useful if you don't have SSDs.

whowutwut commented 6 years ago

@immarvin can you look at this?

immarvin commented 6 years ago

hi @Obihoernchen , will you create a PR on this?

Obihoernchen commented 6 years ago

@immarvin sure

Obihoernchen commented 6 years ago

@immarvin see #41 I also opened #42. Feel free to merge this one as well if you like it.

immarvin commented 6 years ago

hi @Obihoernchen , thanks for the PRs.

We are ok with https://github.com/xcat2/xcat-extensions/pull/42, while having several comments with PR https://github.com/xcat2/xcat-extensions/pull/41, see @neo954 's comments there