[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Wait for mdraid arrays to become clean before reboot / halt



Hi,

On 09/30/2009 08:00 PM, David Lehman wrote:
On Wed, 2009-09-30 at 16:52 +0200, Hans de Goede wrote:
With the new external metadata mdraid support we need to wait for raid
sets to become clean (iow for mdmon to have finished updating the metadata)
before rebooting. Otherwise we get a full array sync on the first boot after
installation.
---
  loader/shutdown.c |    5 +++++
  scripts/mk-images |    4 ++++
  2 files changed, 9 insertions(+), 0 deletions(-)

So this moves mdadm into the initrd? This will have repercussions, like
the mdadm udev rules will suddenly be able to find mdadm and do whatever
they're supposed to do. I doubt we we want that.


Good point,

Well:
/lib/udev/rules.d/64-md-raid.rules

Is harmless, it only does an import of information into the udev db, this
has some duplication with what 70-anaconda.rules does, but nothing harmfull

/lib/udev/rules.d/65-md-incremental.rules

OTOH, will cause incremental assembly of mdraid arrays, note though, that
we could stop it from doing that by touching /dev/.in_sysinit, something
which we may want to do anyways, otherwise the first udev trigger we do
will cause the same issue on installs from live-cd's

Note that for non live cd's a better solution might be to simply not
put /lib/udev/rules.d/65-md-incremental.rules in the image at all
(and I don't believe we need /lib/udev/rules.d/64-md-raid.rules either).

Regards,

Hans





Dave

diff --git a/loader/shutdown.c b/loader/shutdown.c
index 6ae4048..6a32e79 100644
--- a/loader/shutdown.c
+++ b/loader/shutdown.c
@@ -58,6 +58,8 @@ static void performTerminations(int doKill) {
  }

  static void performUnmounts(int doKill) {
+	int ignore;
+
  	if (testing || !doKill)
  		return;

@@ -66,6 +68,9 @@ static void performUnmounts(int doKill) {

  	printf("unmounting filesystems...\n");
  	unmountFilesystems();
+
+	printf("waiting for mdraid sets to become clean...\n");
+	ignore = system("/sbin/mdadm --wait-clean --scan");
  }

  static void performReboot(reboot_action rebootAction) {
diff --git a/scripts/mk-images b/scripts/mk-images
index 00854d3..cfe62d3 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -759,6 +759,10 @@ makeinitrd() {
        cp -a org.freedesktop.nm_dispatcher.service $MBD_DIR/usr/share/dbus-1/system-services
      )

+    # mdadm
+    instbin $IMGPATH /usr/sbin/mdadm $MBD_DIR /sbin/mdadm
+    instbin $IMGPATH /usr/sbin/mdmon $MBD_DIR /sbin/mdmon
+
      # Misc
      instbin $IMGPATH /usr/sbin/dmidecode $MBD_DIR /sbin/dmidecode
      instbin $IMGPATH /usr/bin/egrep $MBD_DIR /sbin/egrep

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list redhat com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]