Linux mounts the Windows share
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