From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: "=?koi8-r?b?+8HE0snOz9cg5C4=?= =?koi8-r?b?IOQu?=" Organization: =?koi8-r?b?8ef09Q==?= To: devel-kernel@altlinux.ru Date: Fri, 11 Feb 2005 23:56:00 +0300 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200502112356.00206.shadrinovdd@ystu.ru> Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit Subject: [d-kernel] =?koi8-r?b?98/a19LB3cHR09ggyw==?= RAID X-BeenThere: devel-kernel@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2005 20:55:42 -0000 Archived-At: List-Archive: List-Post: Раз уж при выключении размонтировать корень невозможно, а корень расположен на 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.