How to mount a Windows share from Linux

linux-penguin

To access a Microsoft Windows share from a CentOS Linux server there are a few commands that worked for this configuration: Microsoft Windows Server 2003 and CentOS 5.8. This is a quick and dirty guide assumes that a Windows share already exists and uses root. In a production environment, an alternate user would be more appropriate.

From the Linux server.

Create an empty folder.

mkdir /mnt/share

Mount the Windows share.

mount -t cifs //IP.AD.DR.ESS/share -o username=username,password=password /mnt/share

According to the comment below, UTF8 is needed in cases. I have added it here, however, haven’t personally tested – yet.

mount -t cifs //IP.AD.DR.ESS/share -o username=username,password=password,iocharset=utf8 /mnt/share

To make this a perminent mount, edit the /etc/fstab and append the following line to the end of the file.

//IP.AD.DR.ESS/share /mnt/share cifs root,uid=0,ro,suid,username=username,password=password 0 0

Re-mount the /etc/fstab without restarting the computer.

mount -a

Of course, there are many variables that can be changed. like the filesystem, user, uid, whether or not the mount will be read-only “ro” or read-write “rw”.

Source(s)
http://www.linuxindya.com/blog/re-mount-etcfstab-without-restarting
http://www.cyberciti.biz/tips/how-to-mount-remote-windows-partition-windows-share-under-linux.html
http://opensuse.swerdna.org/susesambacifs.html
http://ubuntuforums.org/showthread.php?t=288534

1 Comment

  • jon March 29, 2012

    Actually, for this to really work , the UTF-8 option needs to be passed to the mount. I know this from my experience with XUbuntu 11 and CentoS6.2 .

Comments are closed.