成为超级用户或承担等效角色。
如有必要,请为要挂载的文件系统创建挂载点。
# mkdir /mount-point |
编辑 /etc/vfstab 文件并添加项。请确保执行以下操作:
有关 /etc/vfstab 字段各项的详细信息,请参见表 19–3。
由于在引导过程中内核会将根 (/) 文件系统挂载为只读,因此只有 remount 选项(以及可以与 remount 结合使用的选项)会影响 /etc/vfstab 文件中的根 (/) 项。
以下示例说明如何将磁盘片 /dev/dsk/c0t3d0s7 作为 UFS 文件系统挂载到挂载点 /files1。原始字符设备 /dev/rdsk/c0t3d0s7 会指定为 device to fsck。fsck pass 值为 2 意味着将检查文件系统,但不是按顺序检查。
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files1 ufs 2 yes - |
以下示例说明如何将 /export/man 目录作为 NFS 文件系统从系统 pluto 挂载到挂载点 /usr/man 上。由于该目录是 NFS 文件系统,因此既不会指定 device to fsck 也不会指定 fsck pass。在本示例中,mount options 为 ro(只读)和 soft。
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options pluto:/export/man - /usr/man nfs - yes ro,soft |
以下示例说明如何将根 (/) 文件系统挂载到回送挂载点 /tmp/newroot 上。必须始终在 LOFS 文件系统中的文件系统之后挂载 LOFS 文件系统。
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # / - /tmp/newroot lofs - yes - |