Javascript required
Skip to content Skip to sidebar Skip to footer

How to Access Windows Shared Folder From Centos 7

1. Window shared folder

https://jingyan.baidu.com/article/358570f6633ba4ce4624fc48.html

2. Before accessing Windows shared data, please make sure that Windows sharing is available. I won't go into details about how to set up Windows sharing. That's another topic.

When Linux accesses Windows shares or Linux shares data to Windows, they are actually using a software called Samba. This software has been used for many years, and its stability and reliability have been well verified. It is also a commonly used software for many network NAS.

The tool we need to use for Linux here is one of the Samba software, samba-client.

Before attempting to access the Windows share, you need to confirm that samba-client has been installed. The easiest way is to query on the command line "rpm -qa | grep samba-client", of course you can also use "yum"Tool query, such as "yum info samba-client"or"yum list samba-client"And the like.

If samba-client is not installed, you need to use the command "yum install samba-client"Install it, yum will automatically install the relevant dependent libraries required by samba-client, just select Y during installation.

For common Debian Linux distributions, such as Ubuntu or CentOS, you can also use "sudo apt-get install smbclient"with"sudo apt-get install smbfs"Install the corresponding shared access tool.

Encounter problems:

Error when mount host is down

Demand: WillWindowsMount the file to the virtual machine

Prerequisite: The virtual machine and Windows are pingable to each other

The device IP is: 192.168.12.209

The virtual machine IP is: 192.168.253.140

1. Ping

2. Mount

Use mount -t cifs //192.168.12.209/code /home/lxd -o username=administrator,password=123456

mount -t cifs ip/shared directory of your computer to be mounted to a directory of the server -o other items

The command has no error, but host is down appears
Finally, it was found that it was a version problem. The solution is as follows:

Add the latest version version after the command

3. Uninstall

umount /home/lxd (the directory path just mounted to the server)

If it prompts target is busy, it means that you are unloading the current directory in the current directory. It certainly won't work. You have to exit the current directory and go to unmout.

If prompted dervice is busy, you can choose to force uninstall umount -f /home/lxd

CentOS7 prompts write protection when mounting windows share

When centos7 mounts a windows share, it prompts that the shared location is write-protected and can only be mounted in read-only mode, and then the mount fails in read-only mode.

At first I thought that another centos6.4 had mounted this share, so mounting at the same time would cause read-write protection. This is still the case after canceling the mount of 6.4.

After various searches, it was found that the components may be less installed, so

After installation, mount and use normally.

 ok

ok

ok

Finally, successfully mount the command

mount -t cifs            //            192.168.135.131/code /mnt/MYSHARE/ -o username=Administrator,password=15095866715,vers=2.0          

The role of each folder under the CentOS system

The file structure under Linux is to see if each folder is used: Typically, the space occupied by the root file system should generally be relatively small, because most of which do not require freque...

virtualbox shared folder

This machine is a win7 system, and the virtual machine is an ubtuntu system. 1. Create a folder under win7 F disk: gongxiang 2. Click Device> Shared Folder for Virtual Machine   3. In the ubtu...

How to Access Windows Shared Folder From Centos 7

Source: https://www.programmerall.com/article/2272106932/