John Robinson <john.robinson@xxxxxxxxxxxxxxxx> writes: > On 22/04/2009 15:21, Andre Noll wrote: >> On 13:41, John Robinson wrote: >>>> Normal shutdown should put the raid in read-only mode as last step. At >>>> least Debian does that. That way even a mounted raid will be clean >>>> after reboot. >>> Yes, I would have thought it should as well. But I've just looked >>> at CentOS 5's /etc/rc.d/halt and as far as I can see it doesn't try >>> to switch md devices to read-only. >> >> There's no need to do that in the shutdown script as the kernel will >> switch all arrays to read-only mode on halt/reboot. >> >> Moreover, as raid arrays are automatically marked clean if no writes >> are pending for some small time period, a simple "sync; sleep 1" >> at the end of the shutdown script is usually enough to have a clean >> array during the next boot. > > But that's still only "usually". Considering the enormous efforts > taken to unmount filesystems (or remount them read-only) so they're > certain to be clean at the next startup, it seems odd to settle for > "usually"... and CentOS 5 doesn't even appear to do that. > > Goswin, please can you tell me what command Debian uses? I think I > want to combine both of these into my systems' halt scripts. > > Cheers, > > John. On halt I do see a message about the raid being switched to read-only but I don't see any command that would do that. So I do believe this is, as Andre says, the kernel switching the raid read-only before halting. Maybe your kernel is too old to have this feature? MfG Goswin -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html