Skip to main content

Mount windows shares on linux

Any windows share can be mounted on linux easily. Cifs network protocol is used for mounting windows shares. smbclient package is also required.

first install samba-client package
# yum install samba-client
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba-client.x86_64 0:3.0.33-3.29.el5_5.1 set to be updated
--> Processing Dependency: samba-common = 3.0.33-3.29.el5_5.1 for package: samba-client
--> Running transaction check
---> Package samba-common.x86_64 0:3.0.33-3.29.el5_5.1 set to be updated
--> Processing Dependency: libsmbclient = 3.0.33-3.29.el5_5.1 for package: samba-common
--> Running transaction check
---> Package libsmbclient.x86_64 0:3.0.33-3.29.el5_5.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

 Package                          Arch                       Version                           Repository              Size
 samba-client              x86_64                3.0.33-3.29.el5_5.1                  my                  5.7 M
Installing for dependencies:
 libsmbclient               x86_64                3.0.33-3.29.el5_5.1                  my                  916 k
 samba-common         x86_64                3.0.33-3.29.el5_5.1                  my                  6.8 M

Transaction Summary
Install       3 Package(s)
Upgrade       0 Package(s)

Total download size: 13 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): libsmbclient-3.0.33-3.29.el5_5.1.x86_64.rpm                             | 916 kB     00:00     
(2/3): samba-client-3.0.33-3.29.el5_5.1.x86_64.rpm                            | 5.7 MB     00:00     
(3/3): samba-common-3.0.33-3.29.el5_5.1.x86_64.rpm                       | 6.8 MB     00:00     
Total                                                                            24 MB/s |  13 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libsmbclient                                                                        1/3 
  Installing     : samba-common                                                                  2/3 
  Installing     : samba-client                                                                       3/3 

  samba-client.x86_64 0:3.0.33-3.29.el5_5.1                                                                                         

Dependency Installed:
  libsmbclient.x86_64 0:3.0.33-3.29.el5_5.1              samba-common.x86_64 0:3.0.33-3.29.el5_5.1                       


then mount windows share
# mount -t cifs -o username=testuser //testsever/testshare /testmount

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00              26G  2.7G   22G  11% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm
//testserver/testshare             219G  158G   62G  72% /testmount


Popular posts from this blog

Find and replace with sed command in Linux

Find and replace feature is always handy. It can turn into a torture when it comes to change or delete a simple constant string in a text file. There is a handy tool in linux for doing these kind of tihngs. Actually sed is not a text editor but it is used outside of the text file to make changes.