Thread (1 message) 1 message, 1 author, 2005-08-15

Re: RAID readonly before final shutdown

From: Neil Brown <hidden>
Date: 2005-08-15 04:24:35

On Wednesday August 10, gbakos@cfa.harvard.edu wrote:
Hi,

The entire OS I am using is running on software RAID-1. Before killing
the power of the UPS (in case of a power outage), I issue:

/sbin/mdadm --readonly $RAIDDEV
on all the RAID devices I have.

This, however, does not seem to be enough, and when i power the system
back on, the RAID arrays are not clean, and a long syncing starts. A
last step is missing; something like marking the arrays that they are
clean. I see this happening for a flash of a second when i tell the PC
to "/sbin/poweroff", i.e. "halt -p". The very last second, before the
ATX power is turned OFF, the kernel does something to the md arrays.

My questions are:
1. What exactly is this last step?
It is exactly switching the arrays to readonly.

2. Can I achieve it manually by sth like
 echo *** > /proc/***
no (maybe echo ?? > /sys/block/.... one day).
or by using mdadm?
no.  You can only switch an array to read-only when it is not in use.
So you have to unmount it first.  That possibly sounds a bit
pointless, and it probably is.  But it hasn't been a high priority.

If you are using 2.6, then the arrays will be automatically marked
clean after 20ms of inactivity.  If you "kill -9" the "md*_raid1"
processes, then it will start marking the array clean the instant of
inactivity.

NeilBrown
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help