FreeBSD上如何mount DOS分区?

/ns/wz/sys/data/20020820033059.htm


在 FreeBSD 新的 slice code 下, 支援 primary/logical 的 DOS 已经比传统的
386BSD,NetBSD 来的轻松多了, 你可以用以下的命令来 mount DOS :
1) primary 1 : mount_msdos /dev/wd0s1 /dos
2) local 1 : mount_msdos /dev/wd0s5 /dos2

wd0s[1-4] 是 primary 1-4, wd0s[5-N] 是 logical.....

若是想在 mount 时有一些特殊权限...可以在 fstab 中加入.....
/dev/wd0s1 /dos msdos ro,-gmsdos,-m750 0 0
其中..... ro : read-only
-gmsdos : 用 msdos group 来 mount
-m750 : mount 成 750 意思是...
drwxr-x--- 1 root msdos 16384 Jan 1 1980 dos

问∶当我在 mount_msdos 的时候遇到 mountmsdosfs(): Warning: root directory
is not a multiple of the clustersize in length

答∶FreeBSD 的 MSDOSFS 有已知的问题,当你 mount > 512MB 的 DOS 分割区的时
候,就有可能出现这个讯息 (当然也有人用的好好的),尤其是那些曾经利用
Partition Magic 等程式 resize 过 DOS partition 的人,更容易出现。 当你看到
这个讯息的时候,请不要再 mount 该 DOS 分割区,并将其从 /etc/fstab 移除,否
则可能会遭到当机或档案系统毁损的可能。未来新出的 VFATFS 会修正这个问题,请
耐心期待。

-----------
问∶开机时出现问题∶
modload:exec(/usr/bin/ld):No such file or directory
msdos:vfsload(msdos):Operation not permitted
Filesystem mount failed,startup aborted
Enter pathname of shell or RETURN for sh:

答∶因为你没有把 MSDOSFS 加在 kernel config 中,所以 MSDOS 支援是利用LKM
载入的,而你的 /etc/fstab 中一定把 /dos 放在 /usr 前面,因此在 mount 到
/dos 时,会去载入 MSDOS LKM,可是 /usr 尚未被 mount,因此找不到
/usr/bin/ld。
Solution: 请进入单使用者模式,把 /etc/fstab 中的 /usr 搬到 /dos 前面。