Pages

Sunday 10 March 2013

Make an md array writable

I usually set my arrays to readoly, after assembling them. This way I could avoid unattended rebuilds. But sometimes, you would want to update some data on the disk. For doing this, let's see what we have:
root@plugged:~# mdadm --detail /dev/md1 | grep Update 
    Update Time : Sun Dec  2 12:58:58 2012
And what is the short info?
root@plugged:~# cat /proc/mdstat 
Personalities : [raid1] 
md1 : active (read-only) raid1 sdc2[0] sdd2[1]
      83884984 blocks super 1.2 [2/2] [UU]
Now, let's put it into r/w mode:
mdadm --readwrite /dev/md1
Let's see what happened:
cat /proc/mdstat
md1 : active raid1 sdc2[0] sdd2[1]
      83884984 blocks super 1.2 [2/2] [UU]
Did the superblock date changed?
root@plugged:~# mdadm --detail /dev/md1 | grep Update
    Update Time : Sun Mar 10 18:23:18 2013
So, it changed as soon, as I set it to readwrite mode.

No comments:

Post a Comment