Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux mounts the Windows share

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

There is a strange problem with mounting Windows shares under Linux:

Mount-t cifs-o username=bak,password=bak / / 192.168.10.3/f$/backup/ / backup/

Prompt

Mount: / / 192.168.10.3/f$/backup/ is not a valid block device

But

Mount-t cifs-o username=bak,password=bak / / 192.168.10.3Unip f$ / backup/

It's normal.

In fact, this is because Linux does not recognize cifs by default, so you need to install cifs-utils

Yum-y install cifs-utils

Mount-t cifs-o username=bak,password=bak / / 192.168.10.3/f$/backup/ / backup/

At this time, it can be mounted normally.

Modify / etc/fstab at this time and add (read-only mount below)

/ / 192.168.10.3/f$/backup / backup cifs ro,username=bak,password=bak 1 2

Writable mount

/ / 192.168.10.3/f$/backup / backup cifs rw,username=bak,password=bak 1 2

If you need to specify a user right

/ / 192.168.10.3/f$/backup / backup cifs rw,username=bak,password=bak,uid=500,gid=800 1 2

Specify users gid and uid

Error message and handling:

1. Incorrect user / password when mounting

Mount error (13): Permission denied

Refer to the mount.cifs (8) manual page (e.g. Man mount.cifs)

/ var/log/message information

Oct 12 16:20:01 localhost kernel: Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE

Oct 12 16:20:01 localhost kernel: CIFS VFS: Send error in SessSetup =-13

Oct 12 16:20:01 localhost kernel: CIFS VFS: cifs_mount failed w/return code =-13

Second, there is no shared directory

Retrying with upper case share name

Mount error (6): No such device or address

Refer to the mount.cifs (8) manual page (e.g. Man mount.cifs)

View / var/log/message record

Oct 12 16:20:06 localhost kernel: CIFS VFS: cifs_mount failed w/return code =-6

Oct 12 16:20:17 localhost kernel: CIFS VFS: cifs_mount failed w/return code =-6

Oct 12 16:20:17 localhost kernel: CIFS VFS: cifs_mount failed w/return code =-6

Note: if it is the beginning of a number, for example, my shared directory under windows is

\ 192.168.2.10\ 102\ public manual mount mount is possible, but it is not allowed to be placed in / etc/fstab. It will be escaped by default.

So the best way is to use / / 192.168.2.10/102/public to configure

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report