Create a silence FreeBSD
by thinker
關鍵字:
最後更新時間:
2005-04-04 11:20:19 CST |
引用
查詢:
COMMENTS:
on 2010-10-22 21:41:17 CST
fullxml said ..
#系统以只读方式启动
echo "root_rw_mount=NO" >> etc/rc.conf
#建立联合目录
mkdir union
#添加需要读写的目录
echo "var" > etc/union_dirs
echo "etc" >> etc/union_dirs
echo "root" >> etc/union_dirs
#启动脚本,添加到最前面
vi /etc/rc
union_size = "$(($(sysctl -n hw.usermem)/4))b"
union_device = $(mdconfig -a -t malloc -s ${union_size})
newfs /dev/${union_device} > /dev/null 2>&1
mount /dev/${union_device} /union
while read union_dir ; do
mkdir /union/${union_dir}
mount_unionfs -o copymode=transparent /union/${union_dir} /${union_dir}
done < /etc/union_dirs