0
Follow
0
View

How do I mount a Windows directory on a Linux server, device, or IPC?

cuiling2010 注册会员
2023-02-27 14:29

On Linux, Windows directories can be mounted using the Samba protocol. Samba is a protocol that allows files and printers to be shared between Linux and Windows, allowing Linux systems to access Windows shared directories as if they were local file systems.

Here are the basic steps for mounting a Windows directory on a Linux system:

Installing the Samba client
Install the Samba client on a Linux system so that you can mount Windows directories using the Samba protocol. On most Linux distributions, you can install the Samba client with the following command:

sudo apt-get install smbclient

Create a local mount point
Create a local mount point on the Linux system so that the Windows directory can be mounted. You can create a local mount point with the following command:

sudo mkdir /mnt/windows


Mount the Windows directory
Use the following command to mount the Windows directory to the local mount point in Linux:

sudo mount -t cifs //windows-computer/share-name /mnt/windows -o username=windows-username,password=windows-password

On Linux, Windows directories can be mounted using the Samba protocol. Samba is a protocol that allows files and printers to be shared between Linux and Windows, allowing Linux systems to access Windows shared directories as if they were local file systems.

Here are the basic steps for mounting a Windows directory on a Linux system:

Installing the Samba client
Install the Samba client on a Linux system so that you can mount Windows directories using the Samba protocol. On most Linux distributions, you can install the Samba client with the following command:

csharp
Copy code
sudo apt-get install smbclient
Create a local mount point
Create a local mount point on the Linux system so that the Windows directory can be mounted. You can create a local mount point with the following command:

bash
Copy code
sudo mkdir /mnt/windows
Mount a Windows directory
Run the following command to mount a Windows directory to the local mount point in Linux:

bash
Copy code
sudo mount -t cifs //windows-computer/share-name /mnt/windows -o username=windows-username,password=windows-password
where //windows-computer/share-name indicates the name and share name of the Windows computer, /mnt/windows is the path to the local mount point, username=windows-username,password=windows-password is the username and password of the windows computer.

Uninstall the Windows directory
If you want to uninstall the Windows directory, you can use the following command:

sudo umount /mnt/windows

Note: When mounting Windows directories, you need to use the correct Windows computer name, share name, username, and password. If you need to access multiple shared directories on a Windows computer, you can create multiple local mount points on a Linux system and use different mount commands to mount different shared directories.

mxliuyc 注册会员
2023-02-27 14:29

Two methods are available:
For embedded development, the source code is usually developed on Windows and compiled on Linux. In this case, if the Windows directory is mounted on Linux, the development efficiency will be greatly improved.
For IPC, log in to IPC over a serial port and go to the IPC root directory /. The mount point can be /mnt or /tmp or another directory.
mount -t cifs //Windows IP address/name of the folder to be shared on Windows /mnt/ name of the mount point -o username=XXX, password=XXX
For example, create folder win-mnt on drive D of windows, and configure the shared folder. Suppose that the IP address of Windows is 10.182.13.58, and the mount mode is as follows:
mount -t cifs //10.182.13.58/win-mnt./mnt -o username=garylau, password=mypasswd
The same is true for other Linux devices. Create a directory to be mounted(mount point) in Linux and mount the Windows directory to the Linux mount point.
Delete mount: umount./mnt
Sometimes the mount point in Linux is required to have both read and write permissions. In this case, the command needs to add dir_mode=07 77,file_mode=0777, that is:
mount -t IP address of cifs //Windows/name of the folder to be shared on Windows /mnt/ name of the mount point -o username=XXX,password=XXX,dir_mode=0777,file_mode=0777
If the following error times are displayed, the NFS(Network File System server) has multiple versions. V2, V3, and V4 are running at the same time. Therefore, you need to specify the version number when mounting the VM. mount -t cifs //Windows IP address/name of the folder to be shared on Windows /mnt/ name of the mount point -o username=XXX, password=XXX, vers=2.1.

  • mount error(121): Remote I/O error
  • Refer to the mount.cifs(8) manual page(e.g. man mount.cifs)

First download nfs1219.exe and use the software to set the nfs format of the directory to be shared with linux in windows. Then mount the command mount -t nfs -o nolock windowsIP:/windows drive letter/drive letter path mnt/. For example, a folder win-mnt is created on disk D of windows, and the shared path d:\win-mnt is added using NFS Server. Assume that the IP address of Windows is 10.182.13.58, and the mounting mode is as follows: mount -t nfs -o nolock 10.182.13.58:/d/win-mnt mnt/.
bjynfww 注册会员
2023-02-27 14:29
< div class = "md_content_show e397 data - v - 3967" = "" >

OK

About the Author

Question Info

Publish Time
2023-02-27 14:29
Update Time
2023-02-27 14:29