Mounting a CIFS share from Windows to AIX

CIFs mounts need to be hosted by the windows server and shared out to the AIX server, however both servers are able to write to the mounted drive. Please ensure you have all the details including the windows servers fqdn, share name, user id and password before starting to add the cifs share to unix.

Unix details required; account name, uid & gid

Before going any further, CIFS has currently been tested on Aix 5.3 TL12 (and works), but doesn't work on Aix 5.3 TL9

Checking for CIFs shares

To see the current cifs mounts on the unix server you can either do a df -g and look for external mounts or look at the lscifsmnt which will show the details

  
bash-3.00# df -g
/dev/houtestdata1lv    200.00    199.97    1%        4     1% /oracle/houtest/db01
svcedap27.addm.ads.brm.pri:beat     29.99     21.19   30%        0     0% /oracle/beat/db01/ftptest
  

You will notice the remote server name details (svcedap27) as above indicates a cifs share with the cifs share name after the colon.

To list the cifs mounts on the current unix server you can run the below:

  
bash-3.00# lscifsmnt
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
beat            svcedap27.addm.ads.brm.pri/beataccess /oracle/beat/db01/ftptest cifs  --  uid=400,gid=400,wrkgrp=svcedap27 yes  no
  

To further show the credetials being used by the cifs mounts you can run the command below:

  
bash-3.00# lscifscred
server: svcedap27.addm.ads.brm.pri user: beataccess
  

Creating the CIFs Share

In order to create the cifs mount you need the fqdn (fully qualified domain name) of the windows server and should test that the server can be ping'd from the destination unix server as below:

bash-3.00# ping svwvws027.addm.ads.brm.pri
PING svwvws027.addm.ads.brm.pri: (10.84.2.28): 56 data bytes
64 bytes from 10.84.2.28: icmp_seq=0 ttl=127 time=2 ms
64 bytes from 10.84.2.28: icmp_seq=1 ttl=127 time=3 ms
64 bytes from 10.84.2.28: icmp_seq=2 ttl=127 time=2 ms
64 bytes from 10.84.2.28: icmp_seq=3 ttl=127 time=2 ms

Providing you can ping the windows server you can now add the cifs mount by running the mkcfismnt command.

  
bash-3.00# mkcifsmnt -f /oracle/beat/files/mwp -d beatshare -h svwvws027.addm.ads.brm.pri -c aixbeat -u 400 -g 400 -p ?jd1fvenus
  

-f location for the share to be mounted on the unix server (ensure this is created beforehand and you change ownership eg. chown 400:400 /opt/dctm/filestore/pdrive_test). The ownership details should reflect the account (including uid & gid) they will be using.

-d name of the share on windows server

-h dfqn of the windows server

-c username for the share from the windows server

-u uid on the unix server relating to the directory stated in -f command

-g gid (group id) relating to the directory on unix

-p password for the windows user on cifs server

-w domain name eg. addm

You will now be able to see the cifs mount by doing a df -g

  
bash-3.00# df -g
svcedap27.addm.ads.brm.pri:beat     29.99     21.19   30%        0     0% /oracle/beat/db01/ftptest
oemp1.brm.pri:/export/stage/oracle    199.50     40.78   80%   205866     3% /ora_stage
svwvws027.addm.ads.brm.pri:beatshare     29.99      9.99   67%        0     0% /oracle/beat/files/mwp
  

If you get an error related to nsmb0 as show below you need to check the device is active.

There was an error connecting the share or the server.
Make sure the lsdev command shows that device nsmb0 is in
the Available state.  Also make sure that the share name,
user name and password are accurate.

check the device is active by doing the following:

bash-3.00# lsdev -l nsmb0
nsmb0 Available  N/A

You can try to map a network drive from you desktop machine to the cifs share to ensure the credentials are correct.

Windows Explorer > Tools > Map Network Drive (use the credentials for the user by clicking on connect using a different user name on the dialog box

Providing these details are correct and you can connect to the share, you may need to contact a member of the windows team to ensure the cifs share has been setup correct on windows.

Post CIFs creation checks

The mount details will be in the lscifsmnt

  
bash-3.00# lscifsmnt
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
beat            svcedap27.addm.ads.brm.pri/beataccess /oracle/beat/db01/ftptest cifs  -- uid=400,gid=400,wrkgrp=svcedap27 yes  no
beatshare       svwvws027.addm.ads.brm.pri/aixbeat /oracle/beat/files/mwp cifs  -- uid=400,gid=400 no   no
  
  

And finally, you will be able to see the credetials used to mount the cifs share by doing a lscifscred

bash-3.00# lscifscred
server: svcedap27.addm.ads.brm.pri user: beataccess
server: svwvws027.addm.ads.brm.pri user: aixbeat

Removing A CIFs Share

It may be nessacary to remove a CIFs share in order to re-add the share if you are experiencing problems adding the share (device nsmb0 error) for example.

You will need to remove the credentials of the share which will remove them from the /etc/cifs_fs/cifscred file by doing the following command

bash-3.00# rmcifscred -h svwvws027.addm.ads.brm.pri -u beatshare

Then you can remove the mount details by editing the filesystems file, most likely to be right at the bottom of the file.

bash-3.00# vi /etc/filesystems

At this point you can check the lscifsmnt and lscifscred details and notice that the CIFs share has been removed

 
aix/aix_cifscreation.txt · Last modified: 06/04/2022 00:25 by andrew