From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QqsKr-0000xI-Ci for garchives@archives.gentoo.org; Tue, 09 Aug 2011 19:51:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0F92F21C186; Tue, 9 Aug 2011 19:51:23 +0000 (UTC) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by pigeon.gentoo.org (Postfix) with ESMTP id 4281F21C034 for ; Tue, 9 Aug 2011 19:50:30 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.messagingengine.com (Postfix) with ESMTP id 0157D20D50 for ; Tue, 9 Aug 2011 15:50:30 -0400 (EDT) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 09 Aug 2011 15:50:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type; s=smtpout; bh=yOHc r/0Xpa10elxAWLiFJQTH+yM=; b=D5vdq6rYQPtEGWT1MLADe+Fw0h6ieASRlAMJ gx2DSAuI4XVae1l3nRchO83c83yWxzD4yopNDer1oExBU+lI9dXv22OdTEGFcQVC ChSmPBNQynbXNdp+EMeCiZvvqtj5hHCnYQqQ3oLB1pkmlwy52pZuoeUdkws/OjL9 8Ve9SPA= X-Sasl-enc: hACEDWSDAvIIgbDVnBjY8AbqQwZ7jj1c+Dztsmd6ZWg/ 1312919429 Received: from [192.168.5.18] (serv.binarywings.net [83.169.5.6]) by mail.messagingengine.com (Postfix) with ESMTPSA id C088041A905 for ; Tue, 9 Aug 2011 15:50:28 -0400 (EDT) Message-ID: <4E418F7D.1010806@binarywings.net> Date: Tue, 09 Aug 2011 21:50:21 +0200 From: Florian Philipp User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110730 Lightning/1.0b3pre Thunderbird/3.1.10 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Run command after root mounted ro? References: <4E418AD8.7070707@gmail.com> In-Reply-To: <4E418AD8.7070707@gmail.com> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig81FDE8B358CFB46368A96A03" X-Archives-Salt: X-Archives-Hash: c47069a0756894ad72d5c7283fc71e2a This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig81FDE8B358CFB46368A96A03 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 09.08.2011 21:30, schrieb Daniel Frey: > Greetings, >=20 > I discovered a possible reason for mdadm always marking my raid array a= s > bad on reboot. The problem is I don't know how to check for the issue. >=20 > When using root on a native mdadm raid, the kernel handles the array > state transition at shutdown, so it's not a big deal. However, it's > different when using external metadata - mdadm must be called before th= e > reboot. >=20 > Apparently mdadm must be called after the root filesystem is mounted > read-only. Then it can mark the array as clean and not rebuild every > single reboot. >=20 > Where do I check this? The /etc/init.d/mdadm script happens well before= > root is mounted read-only. >=20 > Apparently `mdadm --wait-clean --scan` needs to be called so the > external metadata is updated correctly. If you use this command with a > native mdadm raid it does nothing, but it's critical apparently to the > health of other metadata types. >=20 > I've grepped through /etc/init.d/ and found nothing. >=20 > Dan >=20 Remounting root read-only is done by an init script called mount-ro which is started in runlevel shutdown. Try to add a custom init script to your /etc/init.d directory with the following content: #!/sbin/runscript depend() { after mount-ro } start() { ebegin 'Shutting down mdadm' mdadm --wait-clean --scan eend $? } Add it to the runlevel with `rc-update add shutdown` and don't forget to mark it executable. Disclaimer: I've not tried this (obviously) and if the script eats your dog and wreaks your system, it is entirely your fault ;) Hope this helps, Florian Philipp --------------enig81FDE8B358CFB46368A96A03 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5Bj4EACgkQqs4uOUlOuU/daACdETLpoEcDBpAgS9YV2SY8RBtX tGgAn1j1xZKl0J5WJZGZ5PdEnZglTpXa =c/zt -----END PGP SIGNATURE----- --------------enig81FDE8B358CFB46368A96A03--