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

How to mount a shared directory in Window under Linux

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

Share

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

This article mainly explains "how to mount a shared directory in Window under Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to mount a shared directory in Window under Linux.

First, create a shared directory under Window

1. First, create a directory under Window as a shared directory, and the directory created here is called ShareDir

2. Right-click the directory, select Properties, and in the pop-up dialog box, select share.

3. Select Everyone in the pop-up text box, and then click the add button.

4. After the shared user is successfully added, modify the permission level to read / write

Finally, click the share button to see the path of the share, as shown in the following figure

6. Add several files in the shared directory, and then you can view the corresponding files after mounting them under Linux.

2. Mount under Linux

The file system used by sharing under Linux is nfs, while the file system used by sharing under Windows is supported by the cifs,mount command, but the default is nfs. If you want to mount a directory under Windows, you must specify that the mounted file system is cifs.

[root@seiang11g ~] # systemctl start nfs.service

[root@seiang11g ~] # systemctl status nfs.service

Nfs-server.service-NFS server and services

Loaded: loaded (/ usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)

Active: active (exited) since Tue 2017-08-01 15:52:34 CST; 14s ago

Process: 28151 ExecStopPost=/usr/sbin/exportfs-f (code=exited, status=0/SUCCESS)

Process: 28146 ExecStopPost=/usr/sbin/exportfs-au (code=exited, status=0/SUCCESS)

Process: 28144 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)

Process: 28249 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)

Process: 28248 ExecStartPre=/usr/sbin/exportfs-r (code=exited, status=0/SUCCESS)

Main PID: 28249 (code=exited, status=0/SUCCESS)

CGroup: / system.slice/nfs-server.service

Aug 01 15:52:34 seiang11g.comsys.com systemd [1]: Starting NFS s

[root@seiang11g] # mount-t cifs / / 10.1.1.123/ShareDir / tmp/Window_ShareDir-o username=sell1,password=XXXX

Where:-t cifs specifies the mount file system, / / 10.1.1.123/ShareDir is the shared directory of the remote Windows, username is the user name of the remote Windows, and password is the password of the Window user.

[root@seiang11g] # df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/mapper/cl-root 55G 25G 30G 46% /

Devtmpfs 1.5G 0 1.5G 0% / dev

Tmpfs 1.5G 579m 920m 39% / dev/shm

Tmpfs 1.5G 8.9m 1.5G 1% / run

Tmpfs 1.5G 0 1.5G 0% / sys/fs/cgroup

/ dev/sda1 1014M 155M 860M 16% / boot

/ dev/mapper/cl-home 11G 37M 11G 1% / home

Tmpfs 300m 16K 300m 1% / run/user/42

Tmpfs 300m 0 300m 0% / run/user/0

/ / 10.1.1.123/ShareDir 61G 13G 49G 21% / tmp/Window_ShareDir

[root@seiang11g ~] # cd / tmp/Window_ShareDir/

[root@seiang11g Window_ShareDir] # ll

Total 164

-rwxr-xr-x 1 root root 9797 Jul 18 13:56 KVM of Configuration.odt

-rwxr-xr-x 1 root root 155552 Jul 21 14:41 Oracles block.docx

Create a file 1.txt under Linux

[root@seiang11g Window_ShareDir] # touch 1.txt

[root@seiang11g Window_ShareDir] # ll

Total 164

-rwxr-xr-x 1 root root 0 Aug 1 15:54 1.txt

-rwxr-xr-x 1 root root 9797 Jul 18 13:56 KVM of Configuration.odt

-rwxr-xr-x 1 root root 155552 Jul 21 14:41 Oracles block.docx

As you can see, you can also see it in Window.

At this point, I believe you have a deeper understanding of "how to mount a shared directory in Window under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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