Jan 15, 2003
onlsbc1: コンパクトフラッシュ上のLinuxシステムの読み出し専用化
--- RAMディスク(その5) #8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(http://www-online.kek.jp/~inoue/para-CAMAC/
Work/SBC-RAM8.html)
高エネルギー加速器研究機構
素粒子原子核研究所
物理、オンライングループ
井上 栄二
目的
並列CAMACで使用するSBC上のLinuxシステムを、コンパクトフラッシュ上に
構築した。 コンパクトフラッシュ上に、現在構築してあるLinuxシステムは
通常のシステムと同じで、システムはコンパクトフラッシュに対して読み
書きを行っている。 ここで注意すべきことは、コンパクトフラッシュには
構造上書き込み回数に限界があるという点である。 したがって、コンパク
トフラッシュ上のシステムは、読み出し専用として構築するのが望ましい。
読み出し専用化システムの構築作業をするために、512MBのコンパクトフ
ラッシュ上にRed Hat Linux 8.0 のシステムを構築した。 このコンパクト
フラッシュを使って読み出し専用化システムを構築する。(その5)
これまで、システムが稼動中に書き込みを行う可能性のあるファイルシステ
ムをRAMディスク化することを目指して開発を進めてきた。 現在は、/etc
/tmp、/var の下をRAMディスク化するようになっている。 一方、この
システムを利用する側から見ると、この方針では不都合と思われる点が
ある。 例えば、利用者はCAMACコントローラを使用するユーザ毎に固有の
ネットワーク設定やユーザ設定を行うことができ、さらに設定した情報は
コンパクトフラッシュ上に恒常的に残っていないと使いにくい。 これが
できるようにするためには、/etc の下はRAMディスク化すべきではない。
ここでは、先に作成したRAMディスク化Linuxシステムの内の /etc のRAM
ディスク化の操作の部分を削除し、変更したシステムを使って実行確認を
行う。
(1). 方針
(2). ルートファイルシステムの整備
(3). /etc/rc.d/rc.sysinit の修正
(4). ブートテスト
--------------------------------------------------------------------
(1). 方針
テストでは512MBのコンパクトフラッシュ上に構築した Red Hat Linux 8.0 の
システムを使う。 現在、/etc、/tmp、/var をRAMディスク化しているが、この
内 /etc のRAMディスク化の処理を行っている部分を削除する。 必要な作業は、
ルートファイルシステムの作り直し、/etc/rc.d下のスクリプト、rc.sysinit の
修正、および実行確認である。 変更後のルートファイルシステムの構成は以下
のとおりである。
(2). ルートファイルシステムの整備
(2-1). /mnt/etc シンボリックリンクの削除
[root@onlsbc1 mnt]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/hda5 505605 86415 393086 19% /
/dev/hda1 101089 9166 86704 10% /boot
/dev/hda2 10080520 77272 9491180 1% /home
none 152188 0 152188 0% /dev/shm
/dev/hda3 10080520 3968400 5600052 42% /usr
/dev/hda6 1027768 161556 814004 17% /var
/dev/hdc1 483886 432677 26213 95% /mnt
[root@onlsbc1 mnt]# pwd
/mnt
[root@onlsbc1 mnt]# ls -l
合計 144
drwxr-xr-x 2 root root 2048 12月 13 00:20 bin
drwxr-xr-x 3 root root 1024 12月 13 00:20 boot
drwxr-xr-x 20 root root 116736 1月 14 15:54 dev
lrwxrwxrwx 1 root root 9 12月 18 17:37 etc -> ramfs/etc
-rw-r--r-- 1 root root 0 1月 14 15:54 halt
drwxr-xr-x 5 root root 1024 12月 13 00:31 home
drwxr-xr-x 2 root root 1024 6月 22 2001 initrd
drwxr-xr-x 5 root root 3072 12月 13 00:21 lib
drwx------ 2 root root 12288 12月 13 00:06 lost+found
drwxr-xr-x 3 root root 1024 12月 12 15:52 mnt
drwxr-xr-x 2 root root 1024 8月 24 1999 opt
drwxr-xr-x 2 root root 1024 12月 13 00:06 proc
drwxr-xr-x 5 root root 1024 12月 18 17:36 ramfs
drwxr-x--- 3 root root 1024 12月 17 16:08 root
drwxr-xr-x 2 root root 3072 12月 13 00:20 sbin
lrwxrwxrwx 1 root root 9 12月 18 17:37 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 12月 18 08:52 usr
lrwxrwxrwx 1 root root 9 12月 18 17:37 var -> ramfs/var
[root@onlsbc1 mnt]#
[root@onlsbc1 mnt]# rm etc
rm: remove シンボリックリンク `etc'? y
[root@onlsbc1 mnt]# ls -l
合計 144
drwxr-xr-x 2 root root 2048 12月 13 00:20 bin
drwxr-xr-x 3 root root 1024 12月 13 00:20 boot
drwxr-xr-x 20 root root 116736 1月 14 15:54 dev
-rw-r--r-- 1 root root 0 1月 14 15:54 halt
drwxr-xr-x 5 root root 1024 12月 13 00:31 home
drwxr-xr-x 2 root root 1024 6月 22 2001 initrd
drwxr-xr-x 5 root root 3072 12月 13 00:21 lib
drwx------ 2 root root 12288 12月 13 00:06 lost+found
drwxr-xr-x 3 root root 1024 12月 12 15:52 mnt
drwxr-xr-x 2 root root 1024 8月 24 1999 opt
drwxr-xr-x 2 root root 1024 12月 13 00:06 proc
drwxr-xr-x 5 root root 1024 12月 18 17:36 ramfs
drwxr-x--- 3 root root 1024 12月 17 16:08 root
drwxr-xr-x 2 root root 3072 12月 13 00:20 sbin
lrwxrwxrwx 1 root root 9 12月 18 17:37 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 12月 18 08:52 usr
lrwxrwxrwx 1 root root 9 12月 18 17:37 var -> ramfs/var
[root@onlsbc1 mnt]# ls -l ramfs
合計 4
drwxr-xr-x 25 root root 2048 1月 14 15:51 etc
drwxrwxrwt 2 root root 1024 12月 17 17:12 tmp
drwxr-xr-x 17 root root 1024 12月 13 00:29 var
[root@onlsbc1 mnt]#
(2-2). /mnt/ramfs/etc 下のファイルを /etc に移動する
[root@onlsbc1 mnt]# pwd
/mnt
[root@onlsbc1 mnt]# mv ramfs/etc etc
[root@onlsbc1 mnt]# ls -l
合計 146
drwxr-xr-x 2 root root 2048 12月 13 00:20 bin
drwxr-xr-x 3 root root 1024 12月 13 00:20 boot
drwxr-xr-x 20 root root 116736 1月 14 15:54 dev
drwxr-xr-x 25 root root 2048 1月 14 15:51 etc
-rw-r--r-- 1 root root 0 1月 14 15:54 halt
drwxr-xr-x 5 root root 1024 12月 13 00:31 home
drwxr-xr-x 2 root root 1024 6月 22 2001 initrd
drwxr-xr-x 5 root root 3072 12月 13 00:21 lib
drwx------ 2 root root 12288 12月 13 00:06 lost+found
drwxr-xr-x 3 root root 1024 12月 12 15:52 mnt
drwxr-xr-x 2 root root 1024 8月 24 1999 opt
drwxr-xr-x 2 root root 1024 12月 13 00:06 proc
drwxr-xr-x 4 root root 1024 1月 14 17:22 ramfs
drwxr-x--- 3 root root 1024 12月 17 16:08 root
drwxr-xr-x 2 root root 3072 12月 13 00:20 sbin
lrwxrwxrwx 1 root root 9 12月 18 17:37 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 12月 18 08:52 usr
lrwxrwxrwx 1 root root 9 12月 18 17:37 var -> ramfs/var
[root@onlsbc1 mnt]# ls etc
DIR_COLORS info-dir modules.conf rc4.d
DIR_COLORS.xterm init.d modules.conf~ rc5.d
X11 initlog.conf motd rc6.d
adjtime inittab mtab redhat-release
alternatives inputrc nsswitch.conf resolv.conf
bashrc ioctl.save openldap rpc
cron.daily iproute2 opt rpm
csh.cshrc issue pam.d securetty
csh.login issue.net pam_smb.conf security
default krb.conf passwd services
exports krb5.conf passwd- shadow
fdprm ld.so.cache passwd.OLD shadow-
filesystems ld.so.conf ppp shells
fstab ldap.conf printcap skel
fstab.REVOKE libuser.conf profile ssh
group lilo.conf.anaconda profile.d sysconfig
group- locale protocols sysctl.conf
grub.conf localtime pwdb.conf syslog.conf
gshadow login.defs rc termcap
gshadow- logrotate.d rc.d updfstab.conf
host.conf ltrace.conf rc.local updfstab.conf.default
hosts lvmtab rc.sysinit xinetd.d
hosts.allow lvmtab.d rc0.d yp.conf
hosts.deny mailcap rc1.d
hotplug makedev.d rc2.d
httpd mime.types rc3.d
[root@onlsbc1 mnt]#
[root@onlsbc1 mnt]# ls -l ramfs
合計 2
drwxrwxrwt 2 root root 1024 12月 17 17:12 tmp
drwxr-xr-x 17 root root 1024 12月 13 00:29 var
[root@onlsbc1 mnt]#
(2-3). /mnt/etc 下のシンボリックリンクを修正する
先に行った /etc のRAMディスク化の作業の時に修正したシンボリックリンクを
元に戻す。
(2-3-1). /mnt/etc/grub.conf のシンボリックリンクを張り直す
[root@onlsbc1 etc]# pwd
/mnt/etc
[root@onlsbc1 etc]# ls -l grub.conf
lrwxrwxrwx 1 root root 25 12月 19 10:49 grub.conf -> ../../boot
/grub/grub.conf
[root@onlsbc1 etc]# rm grub.conf
rm: remove シンボリックリンク `grub.conf'? y
[root@onlsbc1 etc]# ln -s ../boot/grub/grub.conf grub.conf
[root@onlsbc1 etc]# ls -lL grub.conf
-rw------- 1 root root 650 12月 19 14:14 grub.conf
[root@onlsbc1 etc]#
(2-3-2). /mnt/etc/httpd/modules のシンボリックリンクを張り直す
[root@onlsbc1 httpd]# pwd
/mnt/etc/httpd
[root@onlsbc1 httpd]# ls -l
合計 2
drwxr-xr-x 2 root root 1024 12月 13 00:29 conf
drwxr-xr-x 2 root root 1024 12月 13 00:29 conf.d
lrwxrwxrwx 1 root root 19 12月 13 00:29 logs -> ../../var/log/h
ttpd
lrwxrwxrwx 1 root root 30 12月 19 10:51 modules -> ../../../usr
/lib/httpd/modules
lrwxrwxrwx 1 root root 13 12月 13 00:29 run -> ../../var/run
[root@onlsbc1 httpd]# rm modules
rm: remove シンボリックリンク `modules'? y
[root@onlsbc1 httpd]# ln -s ../../usr/lib/httpd/modules modules
[root@onlsbc1 httpd]# ls -lL modules
合計 1053
-rwxr-xr-x 1 root root 10232 9月 5 06:23 mod_access.so
-rwxr-xr-x 1 root root 8813 9月 5 06:23 mod_actions.so
-rwxr-xr-x 1 root root 12878 9月 5 06:23 mod_alias.so
-rwxr-xr-x 1 root root 8522 9月 5 06:23 mod_asis.so
-rwxr-xr-x 1 root root 11409 9月 5 06:23 mod_auth.so
-rwxr-xr-x 1 root root 8766 9月 5 06:23 mod_auth_anon.so
-rwxr-xr-x 1 root root 10797 9月 5 06:23 mod_auth_dbm.so
-rwxr-xr-x 1 root root 64176 9月 5 06:23 mod_auth_digest.so
-rwxr-xr-x 1 root root 34320 9月 5 06:23 mod_autoindex.so
-rwxr-xr-x 1 root root 10311 9月 5 06:23 mod_cern_meta.so
-rwxr-xr-x 1 root root 24302 9月 5 06:23 mod_cgi.so
-rwxr-xr-x 1 root root 95804 9月 5 06:23 mod_dav.so
-rwxr-xr-x 1 root root 50745 9月 5 06:23 mod_dav_fs.so
-rwxr-xr-x 1 root root 16174 9月 5 06:23 mod_deflate.so
-rwxr-xr-x 1 root root 8725 9月 5 06:23 mod_dir.so
-rwxr-xr-x 1 root root 8780 9月 5 06:23 mod_env.so
-rwxr-xr-x 1 root root 40366 9月 5 06:23 mod_expires.so
-rwxr-xr-x 1 root root 14897 9月 5 06:23 mod_headers.so
-rwxr-xr-x 1 root root 16640 9月 5 06:23 mod_imap.so
-rwxr-xr-x 1 root root 41760 9月 5 06:23 mod_include.so
-rwxr-xr-x 1 root root 45709 9月 5 06:23 mod_info.so
-rwxr-xr-x 1 root root 51267 9月 5 06:23 mod_log_config.so
-rwxr-xr-x 1 root root 18370 9月 5 06:23 mod_mime.so
-rwxr-xr-x 1 root root 26038 9月 5 06:23 mod_mime_magic.so
-rwxr-xr-x 1 root root 32714 9月 5 06:23 mod_negotiation.so
-rwxr-xr-x 1 root root 41704 9月 5 06:23 mod_proxy.so
-rwxr-xr-x 1 root root 11451 9月 5 06:23 mod_proxy_connect.so
-rwxr-xr-x 1 root root 36780 9月 5 06:23 mod_proxy_ftp.so
-rwxr-xr-x 1 root root 23955 9月 5 06:23 mod_proxy_http.so
-rwxr-xr-x 1 root root 60575 9月 5 06:23 mod_rewrite.so
-rwxr-xr-x 1 root root 12479 9月 5 06:23 mod_setenvif.so
-rwxr-xr-x 1 root root 13486 9月 5 06:23 mod_speling.so
-rwxr-xr-x 1 root root 66039 9月 5 06:23 mod_status.so
-rwxr-xr-x 1 root root 8223 9月 5 06:23 mod_suexec.so
-rwxr-xr-x 1 root root 54618 9月 5 06:23 mod_unique_id.so
-rwxr-xr-x 1 root root 9836 9月 5 06:23 mod_userdir.so
-rwxr-xr-x 1 root root 11698 9月 5 06:23 mod_usertrack.so
-rwxr-xr-x 1 root root 10981 9月 5 06:23 mod_vhost_alias.so
[root@onlsbc1 httpd]#
(2-3-3). /mnt/etc/sysconfig/network-scripts/ifdown のシンボリックリンクを張り直す
[root@onlsbc1 network-scripts]# pwd
/mnt/etc/sysconfig/network-scripts
[root@onlsbc1 network-scripts]# ls -l
合計 122
-rw-r--r-- 1 root root 82 12月 13 00:30 ifcfg-eth0
lrwxrwxrwx 1 root root 22 12月 13 00:12 ifcfg-lo -> ../networki
ng/ifcfg-lo
lrwxrwxrwx 1 root root 23 12月 19 10:54 ifdown -> ../../../../s
bin/ifdown
-rwxr-xr-x 1 root root 820 3月 12 2002 ifdown-ippp
-rwxr-xr-x 1 root root 4112 6月 26 2002 ifdown-ipv6
lrwxrwxrwx 1 root root 11 12月 13 00:12 ifdown-isdn -> ifdown-i
ppp
-rwxr-xr-x 1 root root 1132 6月 26 2002 ifdown-post
-rwxr-xr-x 1 root root 1056 6月 26 2002 ifdown-ppp
-rwxr-xr-x 1 root root 1678 3月 12 2002 ifdown-sit
-rwxr-xr-x 1 root root 902 6月 26 2002 ifdown-sl
lrwxrwxrwx 1 root root 21 12月 19 10:54 ifup -> ../../../../sbi
n/ifup
-rwxr-xr-x 1 root root 13321 6月 26 2002 ifup-aliases
-rwxr-xr-x 1 root root 11156 7月 26 06:46 ifup-ippp
-rwxr-xr-x 1 root root 8869 3月 21 2002 ifup-ipv6
-rwxr-xr-x 1 root root 821 6月 26 2002 ifup-ipx
lrwxrwxrwx 1 root root 9 12月 13 00:12 ifup-isdn -> ifup-ippp
-rwxr-xr-x 1 root root 689 6月 26 2002 ifup-plip
-rwxr-xr-x 1 root root 926 6月 26 2002 ifup-plusb
-rwxr-xr-x 1 root root 3117 8月 16 02:58 ifup-post
-rwxr-xr-x 1 root root 3809 6月 26 2002 ifup-ppp
-rwxr-xr-x 1 root root 803 8月 22 06:20 ifup-routes
-rwxr-xr-x 1 root root 2882 6月 26 2002 ifup-sit
-rwxr-xr-x 1 root root 1646 6月 26 2002 ifup-sl
-rwxr-xr-x 1 root root 2821 6月 28 2002 ifup-wireless
-rwxr-xr-x 1 root root 5463 6月 26 2002 init.ipv6-global
-rw-r--r-- 1 root root 4485 8月 21 12:44 network-functions
-rw-r--r-- 1 root root 41724 9月 3 00:11 network-functions-ipv6
[root@onlsbc1 network-scripts]#
[root@onlsbc1 network-scripts]# rm ifdown
rm: remove シンボリックリンク `ifdown'? y
[root@onlsbc1 network-scripts]# ln -s ../../../sbin/ifdown ifdown
[root@onlsbc1 network-scripts]# ls -lL ifdown
-rwxr-xr-x 1 root root 3268 8月 28 07:03 ifdown
[root@onlsbc1 network-scripts]#
(2-3-4). /mnt/etc/sysconfig/network-scripts/ifup のシンボリックリンクを張り直す
[root@onlsbc1 network-scripts]# rm ifup
rm: remove シンボリックリンク `ifup'? y
[root@onlsbc1 network-scripts]# ln -s ../../../sbin/ifup ifup
[root@onlsbc1 network-scripts]# ls -lL ifup
-rwxr-xr-x 1 root root 9223 9月 5 02:03 ifup
[root@onlsbc1 network-scripts]#
以上でルートファイルシステムの整備は完了。
(3). コンパクトフラッシュの /etc/rc.d/rc.sysinit の修正
(3-1). RAMディスク化のための変更
先の作業で rc.sysinitファイルに記述したコマンドの内、/etc のRAMディスク
化に関係のある部分を削除する。
[root@onlsbc1 rc.d]# pwd
/mnt/etc/rc.d
[root@onlsbc1 rc.d]# ls -l
合計 35
drwxr-xr-x 2 root root 1024 12月 20 16:55 init.d
-rwxr-xr-x 1 root root 2330 7月 14 2002 rc
-rwxr-xr-x 1 root root 220 7月 11 2001 rc.local
-rwxr-xr-x 1 root root 22314 12月 19 16:47 rc.sysinit
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc0.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc1.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc2.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc3.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc4.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc5.d
drwxr-xr-x 2 root root 1024 12月 13 00:29 rc6.d
[root@onlsbc1 rc.d]#
[root@onlsbc1 rc.d]# vi rc.sysinit
:
# Mount all other filesystems (except for NFS and /proc, which is already
# mounted). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
action $"Mounting local filesystems: " mount -a -t nonfs,smbfs,ncpfs -O no_netde
v
# <-- by E.Inoue : from here
/sbin/mke2fs -q /dev/ram0 32768
mount -n -o rw /dev/ram0 /mnt
cp -pdr ramfs/tmp /mnt
cp -pdr ramfs/var /mnt
umount /mnt
mount -n -o rw /dev/ram0 /ramfs
# --> to here
:
"rc.sysinit" 775L, 22291C 書込み
[root@onlsbc1 rc.d]#
ls -l rc.sysinit
-rwxr-xr-x 1 root root 22291 1月 15 14:52 rc.sysinit
[root@onlsbc1 rc.d]#
(4). ブートテスト
(4-1). コンパクトフラッシュ上のLinuxシステムを立ち上げる
[root@onlsbc1 /]# reboot
Broadcast message from root (pts/0) (Wed Jan 15 15:00:18 2003):
The system is going down for reboot NOW!
[root@onlsbc1 /]#
MBR部のGRUBが起動し、以下のメニューが表示された。
|
V
Red Hat Linux (2.4.18-14)
Compact Flash: Red Hat Linux (2.4.18-14) <-- この項目を選択
|
V
ブート処理は進んで、INITが実行されRAMディスク作成も正常に実行できた。
システムはシャットダウンした後、正常に立ち上がった。
[inoue@onlpara inoue]$ ssh onlsbc1
The authenticity of host 'onlsbc1 (130.87.153.3)' can't be established.
RSA key fingerprint is 81:28:f3:2a:7f:bf:12:d0:03:72:e7:8b:a6:b1:f6:9c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'onlsbc1,130.87.153.3' (RSA) to the list of known hos
ts.
inoue@onlsbc1's password:
[inoue@onlsbc1 inoue]$ [inoue@onlsbc1 inoue]$ df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/hdc1 483886 432677 26213 95% /
none 152188 0 152188 0% /dev/shm
[inoue@onlsbc1 inoue]$ ls -l /
合計 145
drwxr-xr-x 2 root root 2048 12月 13 00:20 bin
drwxr-xr-x 3 root root 1024 12月 13 00:20 boot
drwxr-xr-x 20 root root 116736 1月 15 15:02 dev
drwxr-xr-x 25 root root 2048 1月 15 15:02 etc
drwxr-xr-x 5 root root 1024 12月 13 00:31 home
drwxr-xr-x 2 root root 1024 6月 22 2001 initrd
drwxr-xr-x 5 root root 3072 12月 13 00:21 lib
drwx------ 2 root root 12288 12月 13 00:06 lost+found
drwxr-xr-x 3 root root 1024 12月 12 15:52 mnt
drwxr-xr-x 2 root root 1024 8月 24 1999 opt
dr-xr-xr-x 38 root root 0 1月 16 2003 proc
drwxr-xr-x 5 root root 1024 1月 15 15:02 ramfs
drwxr-x--- 3 root root 1024 12月 17 16:08 root
drwxr-xr-x 2 root root 3072 12月 13 00:20 sbin
lrwxrwxrwx 1 root root 9 12月 18 17:37 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 12月 18 08:52 usr
lrwxrwxrwx 1 root root 9 12月 18 17:37 var -> ramfs/var
[inoue@onlsbc1 inoue]$ ls -l /ramfs
合計 14
drwx------ 2 root root 12288 1月 15 15:02 lost+found
drwxrwxrwt 2 root root 1024 12月 17 17:12 tmp
drwxr-xr-x 17 root root 1024 12月 13 00:29 var
[inoue@onlsbc1 inoue]$
ok. /tmp、/var のみがRAMディスクにマウントされている。
(4-2). リブートする
/etc の下が書き込み可能になっていることを確認するために、ファイルを
作っておいてからリブートしてみる。
[root@onlsbc1 inoue]# ls /etc
DIR_COLORS info-dir modules.conf rc4.d
DIR_COLORS.xterm init.d modules.conf~ rc5.d
X11 initlog.conf motd rc6.d
adjtime inittab mtab redhat-release
alternatives inputrc nsswitch.conf resolv.conf
bashrc ioctl.save openldap rpc
cron.daily iproute2 opt rpm
csh.cshrc issue pam.d securetty
csh.login issue.net pam_smb.conf security
default krb.conf passwd services
exports krb5.conf passwd- shadow
fdprm ld.so.cache passwd.OLD shadow-
filesystems ld.so.conf ppp shells
fstab ldap.conf printcap skel
fstab.REVOKE libuser.conf profile ssh
group lilo.conf.anaconda profile.d sysconfig
group- locale protocols sysctl.conf
grub.conf localtime pwdb.conf syslog.conf
gshadow login.defs rc termcap
gshadow- logrotate.d rc.d updfstab.conf
host.conf ltrace.conf rc.local updfstab.conf.default
hosts lvmtab rc.sysinit xinetd.d
hosts.allow lvmtab.d rc0.d yp.conf
hosts.deny mailcap rc1.d
hotplug makedev.d rc2.d
httpd mime.types rc3.d
[root@onlsbc1 inoue]# touch /etc/inoue-test
[root@onlsbc1 inoue]# ls -l /etc/inoue-test
-rw-r--r-- 1 root root 0 1月 15 15:12 /etc/inoue-test
[root@onlsbc1 inoue]#
[root@onlsbc1 inoue]# reboot
:
コンパクトフラッシュ上のシステムが立ち上がった。
[inoue@onlpara inoue]$ !!
ssh onlsbc1
inoue@onlsbc1's password:
[inoue@onlsbc1 inoue]$
[inoue@onlsbc1 inoue]$ df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/hdc1 483886 432677 26213 95% /
none 152188 0 152188 0% /dev/shm
[inoue@onlsbc1 inoue]$ ls -l /etc/inoue*
-rw-r--r-- 1 root root 0 1月 15 15:12 /etc/inoue-test
[inoue@onlsbc1 inoue]$
リブート前に /etc の下に作成したファイルは残っている。 ok.
[root@onlsbc1 inoue]# rm /etc/inoue-test
rm: remove regular empty file `/etc/inoue-test'? y
[root@onlsbc1 inoue]# ls -l /etc/inoue*
ls: /etc/inoue*: そのようなファイルやディレクトリはありません
[root@onlsbc1 inoue]#
シャットダウンした場合について確認する。
[root@onlsbc1 /]# /sbin/shutdown -h now
:
Syncing hardware clock to system time [ OK ]
/etc/rc.d/S01halt: line 156: [/ramfs: No such file or dirctory
Halting system...
md: stopping all md devices.
flushing ide devices: hda hdc
Power down.
ok. 正常にシャットダウンできた。 これで、Red Hat Linux 8.0システムの
一部をRAMディスク化する作業は完了。 /tmp、/var の下のみがRAMディスク化
してある。
---xxxx