先创建挂载点
mkdir /winfiles
挂载共享路径
mount -t cifs -o username=xxxxx,password=xxxxx //192.168.102.100/path /winfiles
开机自动挂载,将下面设置加入/etc/fstab文件最后面。
//192.168.102.100/share /winfiles cifs defaults,username=xxxxx,password=xxxxx 0 2
取消挂载
umount -v 挂载点
mount命令参数解释
[root@localhost abc]# mount --help
用法:
mount [-lhV]
mount -a [选项]
mount [选项] [--source] <源> | [--target] <目录>
mount [选项] <源> <目录>
mount <操作> <挂载点> [<目标>]
挂载文件系统。
选项:
-a, --all 挂载 fstab 中的所有文件系统
-c, --no-canonicalize 不对路径规范化
-f, --fake 空运行;跳过 mount(2) 系统调用
-F, --fork 对每个设备禁用 fork(和 -a 选项一起使用)
-T, --fstab <路径> /etc/fstab 的替代文件
-i, --internal-only 不调用 mount.<type> 辅助程序
-l, --show-labels 也显示文件系统标签
-n, --no-mtab 不写 /etc/mtab
--options-mode <mode>
what to do with options loaded from fstab
--options-source <source>
mount options source
--options-source-force
force use of options from fstab/mtab
-o, --options <列表> 挂载选项列表,以英文逗号分隔
-O, --test-opts <列表> 限制文件系统集合(和 -a 选项一起使用)
-r, --read-only 以只读方式挂载文件系统(同 -o ro)
-t, --types <列表> 限制文件系统类型集合
--source <源> 指明源(路径、标签、uuid)
--target <目标> 指明挂载点
--target-prefix <path>
specifies path use for all mountpoints
-v, --verbose 打印当前进行的操作
-w, --rw, --read-write 以读写方式挂载文件系统(默认)
-N, --namespace <ns> perform mount in another namespace
-h, --help 显示此帮助
-V, --version 显示版本
源:
-L, --label <标签> 同 LABEL=<label>
-U, --uuid <uuid> 同 UUID=<uuid>
LABEL=<标签> 按文件系统标签指定设备
UUID=<uuid> 按文件系统 UUID 指定设备
PARTLABEL=<标签> 按分区标签指定设备
PARTUUID=<uuid> 按分区 UUID 指定设备
<设备> 按路径指定设备
<目录> 绑定式挂载的挂载点(参阅 --bind/rbind)
<文件> 用于设置回环设备的常规文件
操作:
-B, --bind 挂载其他位置的子树(同 -o bind)
-M, --move 将子树移动到其他位置
-R, --rbind 挂载其他位置的子树及其包含的所有子挂载(submount)
--make-shared 将子树标记为 共享
--make-slave 将子树标记为 从属
--make-private 将子树标记为 私有
--make-unbindable 将子树标记为 不可绑定
--make-rshared 递归地将整个子树标记为 共享
--make-rslave 递归地将整个子树标记为 从属
--make-rprivate 递归地将整个子树标记为 私有
--make-runbindable 递归地将整个子树标记为 不可绑定