| 3. |
/etc/fstab, /etc/init.d/rcS, /etc/init.d/modutilsの変更内容(diffした結果) |
|
(1) /etc/fstab
|
|
--- ./etc/fstab-orig Fri Oct 11 14:33:37 2002
+++ ./etc/fstab Wed Jan 15 13:08:40 2003
@@ -1,6 +1,5 @@
# /etc/fstab: static file system information.
#
|
| -# <file system> | <mount point> | <type> | <options> | <dump> | <pass> |
| -/dev/hda1 | / | ext2 | defaults,errors=remount-ro | 1 | 1 |
| -proc | /proc | proc | defaults | 0 | 0 |
| -/dev/hda2 | swap | swap | defaults | 0 | 0 |
| +# <file system> | <mount point> | <type> | <options> | <dump> | <pass> |
| +/dev/hda1 | / | ext2 | ro | 0 | 0 |
| +proc | /proc | proc | defaults | 0 | 0 |
|
| |
|
(2) /etc/init.d/rcS
|
|
--- ./etc/init.d/rcS-orig Tue Jul 9 09:00:00 2002
+++ ./etc/init.d/rcS Wed Jan 15 15:24:09 2003
@@ -12,6 +12,43 @@
umask 022
export PATH runlevel prevlevel
+# make RAM-Disk for Read-only
+# 15.01.15 : GreenArt & Jeanne
+
+mke2fs -q -i 2048 /dev/ram0
+mount -n -o rw /dev/ram0 /mnt
+for i in `ls -1 /var | grep -v "cache" | grep -v "lib"`
+do
+ cp -a /var/$i /mnt/
+done
+mkdir /mnt/cache
+for i in `ls -1 /var/cache | grep -v "apt"`
+do
+ cp -a /var/cache/$i /mnt/cache/
+done
+mkdir /mnt/lib
+for i in `ls -1 /var/lib | grep -v "apt" | grep -v "dpkg"`
+do
+ cp -a /var/lib/$i /mnt/lib/
+done
+umount -n /mnt
+mount -n -o rw /dev/ram0 /var
+
+mke2fs -q -i 2048 /dev/ram1
+mount -n -o rw /dev/ram1 /mnt
+cp -a /etc/* /mnt/
+umount -n /mnt
+mount -n -o rw /dev/ram1 /etc
+
+mke2fs -q -i 2048 /dev/ram2
+mount -n -o rw /dev/ram2 /mnt
+cp -a /dev/* /mnt/
+umount -n /mnt
+mount -n -o rw /dev/ram2 /dev
+
+mke2fs -q -i 2048 /dev/ram3
+mount -n -o rw /dev/ram3 /tmp
+
#
# See if system needs to be setup. This is ONLY meant to
# be used for the initial setup after a fresh installation!
|
|
| |
|
(3) /etc/init.d/modutils
|
|
--- ./etc/init.d/modutils-orig Fri Jun 21 09:00:00 2002
+++ ./etc/init.d/modutils Wed Jan 15 15:24:05 2003
@@ -7,9 +7,12 @@
[ -f /proc/modules ] || exit 0
[ -e /sbin/depmod ] || exit 0
-echo -n "Calculating module dependencies... "
-depmod -a > /dev/null
-echo "done."
+#########################################################
+##### comment for Read-only, 15.01.15 : GreenArt & Jeanne
+#####echo -n "Calculating module dependencies... "
+#####depmod -a > /dev/null
+#####echo "done."
+#########################################################
# Loop over every line in /etc/modules.
echo -n 'Loading modules: '
|
|
| |
|
以上で完了です。 尚、この変更はとても重要です。間違えるとLinuxが起動しなくなる事もあります。 バックアップを取り、バックアップ側で試してみることを 強くお勧めします。
|
| |
| 〜 |
番外編 /をrw, roモードに変更する方法〜 |
| /をrwモードに変更するには、
#mount -wn -o remount /
/をroモードに戻すには、
#mount -rn -o remount /
とします。
|