QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5313|回复: 22

关于/目录的几个问题。

[复制链接]
发表于 2003-7-28 14:31:55 | 显示全部楼层 |阅读模式
/目录必须是rw的吗?如果我把他要w的地方都mount到一个可以w到地方,可以mount成ro的吗?

/目录所在的文件系统必须包含什么?root等目录能不能放在别的文件系统上然后mount上来?
发表于 2003-7-30 21:27:42 | 显示全部楼层
/ can be ro.
u can mount /etc /usr /root /home /boot from other fs.
回复

使用道具 举报

 楼主| 发表于 2003-7-30 21:31:29 | 显示全部楼层
哦,谢谢Dragonfly。那/下有什么目录是一定会被写的呢?
回复

使用道具 举报

发表于 2003-7-30 22:56:10 | 显示全部楼层
bin, sbin, lib, opt, usr, boot, etc  can be ro if u need not install sth or change system configuration. especially for a embedded device

root, home, have to be w if u have user to login into u system.

mnt , is for mount purpose, can be omitted;

proc, and dev are virtual dir, u can mount as ro and try, i am not quite sure,
  
tmp, for tmp files, u can put into /var/tmp

var, for some locks, logs, should be w.


i maybe wrong. so double check pls.  u can read FHS about linux to know more.
a good link is http://www.pathname.com/fhs/
回复

使用道具 举报

 楼主| 发表于 2003-7-30 23:02:00 | 显示全部楼层
从你说的看来,只有root和home有点麻烦,其他的就算是要rw也不是很大。

proc可以是ro的,这一点我确定,因为Magic就是这么做的。
回复

使用道具 举报

发表于 2003-7-30 23:23:18 | 显示全部楼层
sometime u can write to sysctl interface to /proc...
回复

使用道具 举报

 楼主| 发表于 2003-7-31 09:37:30 | 显示全部楼层
那Linux对于充当/目录的FS类型有什么要求吗?还是说只要该类FS的支持有直接加进内核就可以?
回复

使用道具 举报

发表于 2003-7-31 09:55:07 | 显示全部楼层
i think bootloader have to understand the fs format where u put kernel. so i always put ext3 for that. for /, i think no restriction. but i never try other fs other than ext2, ext3 and reiserfs. and i know fat is possible.
回复

使用道具 举报

 楼主| 发表于 2003-7-31 10:03:43 | 显示全部楼层
情况是这样的,整个系统是要做到一张CD上去的。kernel并不会放到/下面,而是独立的。我是想用cramfs当做/,通过initrd.img的形式加载。
回复

使用道具 举报

发表于 2003-7-31 10:38:30 | 显示全部楼层
i think u can check some live cd distributions to see how are they built.
回复

使用道具 举报

 楼主| 发表于 2003-7-31 11:39:29 | 显示全部楼层
刚才看了一下Knoppix里的文档,他是通过一个“mkisofs -R -l -V "KNOPPIX_CN" -hide-rr-moved -v /mnt/sda1/knx/sys/ | create_compressed_fs - 65536 > /mnt/sda1/knx/boot/KNOPPIX”命令生成的。不知道该怎么解压缩。
回复

使用道具 举报

 楼主| 发表于 2003-7-31 11:45:00 | 显示全部楼层
这个文件的前三行是这样的:
#!/bin/sh
insmod cloop.o file=$0 && mount -r -t iso9660 /dev/cloop $1
exit $?

然后接下来的就都是乱码了。
回复

使用道具 举报

发表于 2003-7-31 21:28:26 | 显示全部楼层
no, that only build a knoppix cd. u can download one, boot it up, and check each dir rw or ro.
回复

使用道具 举报

 楼主| 发表于 2003-7-31 22:41:36 | 显示全部楼层
这一点倒没有注意。不过他的KNOPPIX是以只读方式挂到“/KNOPPIX”,而“/”只有1.9M,“/bin”、“/sbin”、“/usr”等目录里的文件都是用连接连到“/KNOPPIX”下对应的文件。
回复

使用道具 举报

发表于 2003-7-31 22:46:56 | 显示全部楼层
/ can be very small. can u post u df display and its /etc/fstab here? i do not have knoppix at hand. thx
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-22 01:03 , Processed in 0.152504 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表