From: "Шадринов Д. Д." <shadrinovdd@ystu.ru> To: devel-kernel@altlinux.ru Subject: [d-kernel] Возвращаясь к RAID Date: Fri, 11 Feb 2005 23:56:00 +0300 Message-ID: <200502112356.00206.shadrinovdd@ystu.ru> (raw) Раз уж при выключении размонтировать корень невозможно, а корень расположен на RAID, может быть не стоит выводить сообщение FAILED, а использовать проверку оставшихся подмонтированных файловых систем и отрубать только те RAID'ы которые не используются? Например так: --- /etc/init.d/halt 2004-03-04 17:28:34 +0300 +++ /mnt/root/etc/init.d/halt 2005-02-11 21:07:22 +0300 @@ -102,6 +102,12 @@ "Unmounting filesystem" \ "Unmounting filesystem (retry)" +[ -f /proc/bus/usb/devices ] && umount -n /proc/bus/usb >/dev/null 2>&1 + +# Remount read-only anything that's left mounted. +action "Remounting remaining filesystems (if any) read-only:" umount -anrf +action "Remounting root filesystem read-only:" mount -n -o remount,ro / + # Turn off raid. RAIDSTOP=/sbin/raidstop if [ -x "$RAIDSTOP" -a -f /etc/raidtab ]; then @@ -110,20 +116,22 @@ # the case. So we look only for the active raid devices if [ -f /proc/mdstat ] ; then mddevs=$(grep ^md /proc/mdstat | awk '{ print $1 }') + mntdevs=$(mount | awk '{ print $1 }') for mddev in $mddevs ; do + for mntdev in $mntdevs ; do + if [ "/dev/$mddev" = "$mntdev" ] ; then + action "Skipping mounted RAID $mddev" + continue 2 + fi + done; + action "Turning off RAID for $mddev:" "$RAIDSTOP" "/dev/$mddev" done - unset mddev mddevs + unset mddev mddevs mntdev mntdevs fi #action "Turning off RAID:" /sbin/raidstop -a fi -[ -f /proc/bus/usb/devices ] && umount -n /proc/bus/usb >/dev/null 2>&1 - -# Remount read-only anything that's left mounted. -action "Remounting remaining filesystems (if any) read-only:" umount -anrf -action "Remounting root filesystem read-only:" mount -n -o remount,ro / - action "Unmounting proc filesystem:" umount -n /proc # See if this is a powerfail situation.
next reply other threads:[~2005-02-11 20:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-02-11 20:56 Шадринов Д. Д. [this message] 2005-02-12 10:57 ` Vitaly Lipatov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200502112356.00206.shadrinovdd@ystu.ru \ --to=shadrinovdd@ystu.ru \ --cc=devel-kernel@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux kernel packages development This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \ devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com public-inbox-index devel-kernel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git