Red Hat Bugzilla – Bug 441633
mdadm failed to set --write-mostly when --add a device
Last modified: 2008-04-09 22:20:47 EDT
Description of problem:
I can set --write-mostly when I initially create an md.
If one of the device failed and I wanted to re-add
the device, I could not set --write-mostly with --add option.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create RAID1 device.
One of a device has a "write-mostly" setting.
2. Make "fail" one of the device within RAID1.
This device has a "write-mostly" flag.
/sbin/mdadm --fail /dev/md0 /dev/VolGroup00/realdisk
3. Remove the failed device from md0.
/sbin/mdadm -r /dev/md0 /dev/VolGroup00/realdisk
4. Re-add the device with "--write-mostly" option
/sbin/mdadm /dev/md0 --add /dev/VolGroup00/realdisk --write-mostly
/sbin/mdadm /dev/md0 --add --write-mostly /dev/VolGroup00/realdisk
The "--add" works ok, but "--write-mostly" flag is not in the
"state" part of the mdadm -D output.
The disk should be added into md with write-mostly option enabled.
The man page said "subsequent device lists in --build, --create
or --add command will be flagged as write-mostly."
But as I test the "--add" with write-mostly, it didn't work.
As I see mdadm upstream site, this symptom seemed to be fixed.
> Release 2.6.4 adds a few minor bug fixes to 2.6.3
> Changelog Entries:
> - Make "--create --auto=mdp" work for non-standard device names.
> - Fix restarting of a 'reshape' if it was stopped in the middle.
> - Fix a segfault when using v1 superblock.
> - Make --write-mostly effective when re-adding a device to an array. <==
So I request Red Hat to back port this bug fix.
mdadm-2.6.4-1.el5 is already part of the rhel5.2 beta release.
Download mdadm-2.6.4-1.el5 from RHN beta channel,
and I did the same test.
I have confirmed --add with --write-mostly option works OK now.