Created
September 23, 2018 23:41
-
-
Save azat/c11c29e2fad343317e90aaa42be6f330 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function grow() | |
| { | |
| local md=$1 | |
| shift | |
| mdadm --grow --bitmap=none $md | |
| mdadm --grow --bitmap=internal $md | |
| } | |
| function recreate() | |
| { | |
| local md=$1 | |
| shift | |
| mkdir -p /md | |
| umount /md | |
| mdadm --stop --scan | |
| mdadm --zero-superblock -f /dev/sdb | |
| mdadm --zero-superblock -f /dev/sdc | |
| mdadm --create $md --metadata 1.2 -f --level=mirror --bitmap=internal --raid-devices=2 /dev/sdb /dev/sdc | |
| mdadm --wait $md | |
| read | |
| mke2fs -t ext4 -FF $md | |
| mount $md /md || return 1 | |
| yes "" | cat -n | head -n100 | xargs -P10 -n1 -i bash -c 'dd if=/dev/zero of=/md/out.{} count=$((1<<10)) bs=512 oflag=direct' & | |
| for i in {1..100}; do | |
| grow $md | |
| done | |
| wait | |
| } | |
| function main() | |
| { | |
| local md=/dev/md1 | |
| dmesg -c > /dev/null | |
| recreate $md | |
| sync | |
| } | |
| main "$@" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of the trace: