Bug 1056643
| Summary: | Can mdadm report when a RAID mirror is deliberately broken? | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dave Cantrell <dcantrell> |
| Component: | anaconda | Assignee: | Anaconda Maintenance Team <anaconda-maint-list> |
| Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | agk, anaconda-maint-list, bobgus, bruno, bugzillaredhat-56f0, dledford, gerhart, g.kaviyarasu, greno, hpa, h.peter.anvin, Jes.Sorensen, jonathan, susi.lehtola, vanmeeuwen+fedora |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 188314 | Environment: | |
| Last Closed: | 2014-12-09 14:27:49 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 188314 | ||
| Bug Blocks: | |||
|
Description
Dave Cantrell
2014-01-22 15:46:55 UTC
Lately when I deliberately break mirrors I set the number of devices to 1 (using mdadm Grow) for the one I want to keep running. It is also a good idea to change the uuid of the mirror that you don't want to use. Otherwise which one you get when booting isn't always going to be the same. (Though it is usually stable I have seen things switch.) I'm actually running some raid 1 arrays with one device right now and the degraded file for them contains '0'. I often physically pull the drive I want preserved. That make is a bit hard for mdadm to know what my intent is, although I guess I could go in and set the number of drives to 1; it just means another boot. There is a separate use case for a degenerate RAID-1 (with only one drive): it allows a mirror to be constructed later. I agree supporting install onto half an existing RAID1 array for testing makes a lot of sense. This should be supported better than it currently is. However, mdadm cannot and should not try to determine how a RAID1 was deliberately broken. There is a million ways an array can be broken and for this to go wrong. In addition it leaves open the authority problem later when trying to assemble the drive as to which drive is authoritative and should be resync'ed to the other. In addition, as Brono points out, ending up with two arrays having the same UUID is a bit of an 'issue'. The correct way to do this is (using sd[ab]1 as example drives, and md98 as the old RAID1 array): 1) Fail /dev/sda1 and remove it from the old array: mdadm /dev/md98 --fail /dev/sda1 --remove /dev/sda1 2) zero the superblock on /dev/sda1 mdadm --zero-superblock /dev/sda1 3) Create a new RAID1 array with just one drive: mdadm -C /dev/md99 --raid-devices 1 --force --level=1 /dev/sda1 4) Perform the install onto the new array (/dev/md99) 5) Once determined the new install is good, stop the old array and zero the superblock of the second drive: mdadm -S /dev/md98 mdadm --zero-superblock /dev/sdb1 6) Reshape /dev/md99 into a two drive array, and add /dev/sdb1 to the array: mdadm -G /dev/md99 --raid-devices 2 --add /dev/sdb1 Note that if you create the array as show in 3), /sys/block/md99/md/degraded will return 0, and anaconda should be happy to install onto it. Basically Anaconda needs to allow for creating single-drive RAID1 arrays, and be taught to remove a drive from an existing array (if it doesn't know how to do so already). I don't see the need for making any changes to mdadm or the drivers/md stack over this, everything needed is in place. This needs to be handled in Anaconda - reassigning to anaconda. Long term it might be worth having some graphical sysadmin tool that can manipulate drives and handle 5) + 6) above, but at least we should also document how the admin performs these steps post install. Jes |