ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Borovskoy <alb@altlinux.ru>
To: devel@altlinux.ru
Subject: [devel] Master 2.4 LVM an RAID startup
Date: Sun, 29 May 2005 14:52:50 +1300
Message-ID: <200505291453.00839.alb@altlinux.ru> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]

Добрый день.

Захотелось мне LVM поверх MD

Сначала был модифицирован /etc/rc.d/rc.sysinit следующим 
способом.
1. Сперва активируем MD.
2. Затем активируем LVM.
3. Затем активируем swap.

Потом был модифицирован /etc/init.d/halt следующим образом.
1. Затем отключаем swap.
2. Отключаем LVM.
3. Отключаем MD.

Я понимаю что хак, но может быть это сделать правильно и затем 
выпустить update на startup?

Патч прилагается. Хотел сперва в глюкозавра, да не нашел как в 
нем аттачи прицеплять.

-- 
Алексей.
GPG key fingerprint
DBB3 1832 13C6 5C96 4A58  4AFF 78F7 159F 66AD 8D7E

[-- Attachment #1.2: startup.patch --]
[-- Type: text/x-diff, Size: 4911 bytes --]

diff -uNr rc.d.orig/init.d/halt rc.d/init.d/halt
--- rc.d.orig/init.d/halt	2004-03-05 02:28:34 +1200
+++ rc.d/init.d/halt	2005-05-29 14:33:46 +1300
@@ -102,6 +102,14 @@
 	"Unmounting filesystem" \
 	"Unmounting filesystem (retry)"
 
+# LVM Shutdown
+VGCHANGE=/sbin/vgchange
+if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then
+	if [ -e /proc/lvm ]; then
+		action "Setting up LVM:" "$VGCHANGE" -a n
+	fi
+fi
+	
 # Turn off raid.
 RAIDSTOP=/sbin/raidstop
 if [ -x "$RAIDSTOP" -a -f /etc/raidtab ]; then
diff -uNr rc.d.orig/rc.sysinit rc.d/rc.sysinit
--- rc.d.orig/rc.sysinit	2004-03-06 01:25:28 +1200
+++ rc.d/rc.sysinit	2005-05-29 14:29:13 +1300
@@ -81,6 +81,75 @@
 # Set the system clock (when /etc/adjtime is missing).
 [ -s /etc/adjtime ] || /etc/init.d/clock start
 
+# Activate EVMS
+EVMS_ACTIVE=
+STARTEVMS=/sbin/startevms
+if [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then
+	action "Starting up EVMS:" "$STARTEVMS" init
+	EVMS_ACTIVE=1
+fi
+
+# Add raid devices
+if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! fgrep -iwqs noraidtab /proc/cmdline; then
+	echo -n "Starting up RAID devices: " 
+
+	rc=0
+	
+	for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
+		RAIDDEV="${i##*/}"
+		RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
+		if [ -z "$RAIDSTAT" ]; then
+			# Try raidstart first...if that fails then
+			# fall back to raidadd, raidrun.  If that
+			# also fails, then we drop to a shell
+			RESULT=1
+			ExecIfExecutable /sbin/raidstart "$i"
+			RESULT=$?
+			if [ $RESULT -gt 0 ]; then
+				ExecIfExecutable /sbin/raid0run "$i"
+				RESULT=$?
+			fi
+			if [ $RESULT -gt 0 ]; then
+				ExecIfExecutable /sbin/raidadd "$i"
+				ExecIfExecutable /sbin/raidrun "$i"
+				RESULT=$?
+			fi
+			if [ $RESULT -gt 0 ]; then
+				rc=1
+			fi
+		fi
+		echo -n "$RAIDDEV "
+	done
+	echo
+
+	# A non-zero return means there were problems.
+	if [ $rc -gt 0 ]; then
+		echo
+		echo
+		echo "*** An error occurred during the RAID startup"
+		echo "*** Dropping you to a shell; the system will reboot"
+		echo "*** when you leave the shell."
+
+		PS1="(RAID Repair) \# # "; export PS1
+		sulogin
+
+		echo "Unmounting file systems"
+		umount -arnf
+		mount -n -o remount,ro /
+		echo "Automatic reboot in progress."
+		reboot -f
+	fi
+fi
+
+# LVM Setting
+VGCHANGE=/sbin/vgchange
+if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then
+	modprobe lvm-mod >/dev/null 2>&1
+	if [ -e /proc/lvm ]; then
+		action "Setting up LVM:" "$VGCHANGE" -a y
+	fi
+fi
+
 # Activate swapping.
 action "Activating swap partitions:" swapon -a -e
 
@@ -114,15 +183,6 @@
 	fsckoptions="-V $fsckoptions"
 fi
 
-# LVM Setting
-VGCHANGE=/sbin/vgchange
-if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then
-	modprobe lvm-mod >/dev/null 2>&1
-	if [ -e /proc/lvm ]; then
-		action "Setting up LVM:" "$VGCHANGE" -a y
-	fi
-fi
-
 _RUN_QUOTACHECK=0
 ROOTFSTYPE=`fgrep ' / ' /proc/mounts |tail -1 |cut -d' ' -f3`
 if [ -z "$fastboot" -a "$ROOTFSTYPE" != nfs ]; then 
@@ -263,66 +323,6 @@
 	setsysfont >/dev/null 2>&1 && SETSYSFONT_DONE=1 || SETSYSFONT_DONE=
 fi
 
-# Activate EVMS
-EVMS_ACTIVE=
-STARTEVMS=/sbin/startevms
-if [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then
-	action "Starting up EVMS:" "$STARTEVMS" init
-	EVMS_ACTIVE=1
-fi
-
-# Add raid devices
-if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! fgrep -iwqs noraidtab /proc/cmdline; then
-	echo -n "Starting up RAID devices: " 
-
-	rc=0
-	
-	for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
-		RAIDDEV="${i##*/}"
-		RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
-		if [ -z "$RAIDSTAT" ]; then
-			# Try raidstart first...if that fails then
-			# fall back to raidadd, raidrun.  If that
-			# also fails, then we drop to a shell
-			RESULT=1
-			ExecIfExecutable /sbin/raidstart "$i"
-			RESULT=$?
-			if [ $RESULT -gt 0 ]; then
-				ExecIfExecutable /sbin/raid0run "$i"
-				RESULT=$?
-			fi
-			if [ $RESULT -gt 0 ]; then
-				ExecIfExecutable /sbin/raidadd "$i"
-				ExecIfExecutable /sbin/raidrun "$i"
-				RESULT=$?
-			fi
-			if [ $RESULT -gt 0 ]; then
-				rc=1
-			fi
-		fi
-		echo -n "$RAIDDEV "
-	done
-	echo
-
-	# A non-zero return means there were problems.
-	if [ $rc -gt 0 ]; then
-		echo
-		echo
-		echo "*** An error occurred during the RAID startup"
-		echo "*** Dropping you to a shell; the system will reboot"
-		echo "*** when you leave the shell."
-
-		PS1="(RAID Repair) \# # "; export PS1
-		sulogin
-
-		echo "Unmounting file systems"
-		umount -arnf
-		mount -n -o remount,ro /
-		echo "Automatic reboot in progress."
-		reboot -f
-	fi
-fi
-
 _RUN_QUOTACHECK=0
 # Check filesystems
 # (pixel) do not check loopback files, will be done later (aren't available yet)

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-05-29  1:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-29  1:52 Alexey Borovskoy [this message]
2005-05-29 10:42 ` Dmitry V. Levin
2005-05-29 11:34   ` Alexey Borovskoy
2005-05-29 11:47     ` Dmitry V. Levin
2005-05-29 14:16       ` [devel] " Michael Shigorin
2005-05-29 14:47         ` Dmitry V. Levin
2005-05-29 14:58           ` Michael Shigorin
2005-05-29 15:06             ` Dmitry V. Levin
2005-05-30  4:04               ` Ivan Fedorov
2005-05-30  7:15                 ` Andrei Bulava
2005-05-30 11:48                 ` Alexey Borovskoy
2005-05-30 13:15                   ` Ivan Fedorov
2005-05-30 11:43               ` Alexey Borovskoy
2005-05-30 11:40       ` [devel] " Alexey Borovskoy

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=200505291453.00839.alb@altlinux.ru \
    --to=alb@altlinux.ru \
    --cc=devel@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 Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git