How to Mount a Windows Shared Folder in Linux CentOS 6.3

Windows and Linux are two popular operating systems that use different file systems. However, it is possible to share files between them. In this guide, we will focus on how to mount a Windows-shared folder in Linux CentOS 6.3.

The problem is that Linux and Windows use different file systems, which can cause compatibility issues when sharing files. Fortunately, we can use the CIFS (Common Internet File System) protocol to mount a Windows-shared folder in Linux.

What we are going to do is to create a mount point in CentOS 6.3, install the necessary packages to support CIFS protocol, and finally, mount the Windows shared folder to the mount point.

The desired outcome is to have access to the shared folder in CentOS 6.3 and be able to read, write and modify files in it.

Step 1: Create a Mount Point

The first step is to create a mount point, which is a directory where the shared folder will be mounted. You can create a mount point anywhere in the filesystem, but for this guide, we will create it under /mnt folder.

sudo mkdir /mnt/windows_share

Step 2: Install CIFS Utilities

To be able to mount the Windows shared folder, we need to install the necessary packages that support CIFS protocol.

sudo yum install cifs-utils

Step 3: Mount the Windows Shared Folder

Now that we have a mount point and the necessary packages, we can proceed to mount the Windows shared folder. To mount the shared folder, we need to use the mount command with the following syntax:

sudo mount -t cifs -o username=USERNAME,password=PASSWORD //WINDOWS_MACHINE_IP/SHARE_NAME /mnt/windows_share

Replace USERNAME, PASSWORD, WINDOWS_MACHINE_IP, and SHARE_NAME with your Windows username, password, IP address of the Windows machine, and name of the shared folder, respectively.

See also  How to Install iptables on Linux RHEL 5/CentOS 5 server

For example, if the Windows username is “john,” the password is “1234,” the IP address of the Windows machine is “192.168.1.100,” and the name of the shared folder is “documents,” the mount command would be:

sudo mount -t cifs -o username=john,password=1234 //192.168.1.100/documents /mnt/windows_share

Step 4: Verify the Mount Point

To verify that the shared folder has been mounted correctly, navigate to the mount point and list the files in the shared folder.

cd /mnt/windows_share
ls

You should see the files and directories in the shared folder.

See also  Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

Commands Mentioned:

  • mkdir – creates a new directory
  • yum – the default package manager for CentOS
  • mount – mount a file system

Conclusion

Now you know how to mount a Windows shared folder in Linux CentOS 6.3. We created a mount point, installed the necessary packages to support CIFS protocol, and mounted the Windows shared folder to the mount point. By following the steps, you should now be able to access the shared folder from CentOS 6.3 and work with its files just as you would with any other files on your system.

See also  How to Enable Changing SVN Log Messages or History

Keep in mind that the mount point will be empty until the shared folder is mounted, so make sure you mount the shared folder each time you need to access it. Also, if the Windows password is changed, you will need to update it in the mount command as well.

If you encounter any issues while following the steps or have suggestions for improvements, please let me know in the comments section below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *