On 01/09/2019 05:37 AM, stakanov wrote:
wipefs -af /dev/sdd1
You should not need to wipe the disk. mdadm is smart enough to use Update Time
and Event count to determine that the disk is not the current disk and needs
mdadm --manage /dev/md127 --add /dev/sdd1
Fine, but make sure /dev/sdd1 is marked as failed. It may be worth adding the
following to fail and remove /dev/sdd1 to force a resync when you add, e.g.
# mdadm /dev/md127 --fail /dev/sdd1 --remove /dev/sdd1
mdadm: set device faulty failed for /dev/sdd1: No such device
Then you can add forcing the resync, e.g.
# mdadm /dev/md127 --add /dev/sdd1
mdadm: re-added /dev/sdd1
No need to add --manage (it doesn't hurt, but it is presumed for --add).
You then check the resync status with
# cat /proc/mdstat
It will show you the sync status.
Is this correct?
Do I have to umont sdd1? It is "unused" so
probably not mounted. If so, how to
I have to remount it in order to add it to the RAID? Or would the mdadm
command would just suffice?
mdadm command is sufficient
Do I have to tell the raid to mirror the data or does
resync will be forced automatically
How can I see when it did finish to mirror the data?
# cat /proc/mdstat
(it will show you which array is syncing and when it is done)
I scrub monthly. (I used to scrub weekly, but 3T arrays will take about 5
hours) I just use a script in a crontab and log the results to a log file, e.g.
$ bzcat /home/admin/log/mdadm_sync_valkyrie.bz2 | tail -n 12
Nov 1 03:01:01 '/dev/md0' mismatch_cnt = 0
Nov 1 03:06:01 '/dev/md1' mismatch_cnt = 0
Nov 1 05:01:02 '/dev/md2' mismatch_cnt = 0
Nov 1 10:11:02 '/dev/md4' mismatch_cnt = 0
Dec 1 03:01:02 '/dev/md0' mismatch_cnt = 0
Dec 1 03:07:02 '/dev/md1' mismatch_cnt = 0
Dec 1 05:07:02 '/dev/md2' mismatch_cnt = 0
Dec 1 10:17:03 '/dev/md4' mismatch_cnt = 0
Jan 1 03:01:01 '/dev/md0' mismatch_cnt = 0
Jan 1 03:07:01 '/dev/md1' mismatch_cnt = 0
Jan 1 05:03:02 '/dev/md2' mismatch_cnt = 0
Jan 1 10:13:02 '/dev/md4' mismatch_cnt = 0
Array sizes are:
$ df -h | grep md[0-9][0-9]*
/dev/md1 50G 21G 29G 43% /
/dev/md0 469M 97M 360M 22% /boot
/dev/md2 865G 487G 378G 57% /home
/dev/md4 2.7T 871G 1.9T 32% /home/data
(swap is on /dev/md3)
Array status will be similar to:
$ cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda7 sdb7
921030656 blocks super 1.2 [2/2] [UU]
bitmap: 0/7 pages [0KB], 65536KB chunk
md3 : active raid1 sdb8 sda8
2115584 blocks super 1.2 [2/2] [UU]
md1 : active raid1 sda6 sdb6
52396032 blocks super 1.2 [2/2] [UU]
md0 : active raid1 sdb5 sda5
511680 blocks super 1.2 [2/2] [UU]
md4 : active raid1 sdc sdd
2930135488 blocks super 1.2 [2/2] [UU]
bitmap: 0/22 pages [0KB], 65536KB chunk
unused devices: <none>
David C. Rankin, J.D.,P.E.
To unsubscribe, e-mail: opensuse+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse+owner(a)opensuse.org