Posts tagged DFS

Combining Multiple Shares into One DFS Folder (With PowerShell)

I had the need to combine multiple Windows shares into one DFS Folder / Location. Anyone that uses DFS knows that you can either create links to the top level share or its sub folder and that there is no way to automatically combines all the folders together

Creating links to all the sub folders is fine if you have 10 or 20, but what if you have 350 links to create. Such as in my case, I had the need to create links to all the “Users” folders for every one of my departments.

Doing this would allow me to point all my scripts / group policies to one single location, without putting all the user folders on one server.

Here is the script

That’s it. This script will scan the shares, take every sub folder and add a link to the sub folder under the DFS folder I designated. For my purpose, I used it to combine user folders, and its been working great in production for months now.

You can use this script to combine any folder, except for 1 catch. Last I checked, DFS has a limit of 5000 links per “name space”, so if  you are worried about approaching that limitation, you can always create a separate namespace specifically for the user folders or whatever other folders you are planning to combine.

Facebook Twitter Email Linkedin Digg Delicious

Auto Mounting a DFS shares on your Redhat 5 (CentOS 5) Server

Ok so the other day I wrote an article on how to mount the DFS to your Linux box, If you haven’t already read the other one, I suggest you go check it out now.  Today im going to expand on that article and explain how to Auto Mount the DFS Share.

  1. Edit /etc/fstab and add the following line:

    1. //pinchii.com/share/data  is my DFS Share
    2. /mnt/dfsfolder is my local mount point
    3. cifs is the file system
    4. noauto is telling the OS not to automount this mount (ill explain why later)
    5. uid sets the owner of the files in the file system
    6. credentials is the path to my credentials file
    7. workgroup is my domain name
    8. the last two 0 (zero) are the dump-freq and pass-dump, I wont get into these, google them if you like
  2. Create the above credential file, i created a file in /etc called dfs_creds.conf, the file looks like this:
  3. create an init.d script, the script should look like this:

    The reason for not auto mounting the DFS in the FSTab is because if for some reason the network connection is not ready, your server will hang waiting for the DFS, pausing the script for a few seconds will allow the server to stablish a connection and then mount the DFS share.

    Update: You dont even need the script above anymore, just setup your fstab entry as follows:


    The option _netdev is always recommended for cifs mounts in fstab. Option _netdev delays mounting until the network has been enabled.
  4. Thats all you need, this is what works for me, hope it works for you!!!
Facebook Twitter Email Linkedin Digg Delicious

Mounting DFS to RedHat Linux Enterprise 5 (CentOS 5)

Had to mount my DFS share to my Linux Server and this is how I got it done:

 

  1. Create mount point (in my case I made /mnt/dfsfolder)
  2. Yum Update (doesnt hurt to have the latest and greatest of everything)
  3. Yum Install Samba
  4. Yum Install samba-client-3.0.33-3.7.el5
  5. Yum Install samba-common-3.0.33-3.7.el5
  6. Yum Install Keyutils (you need keyutils, dont skip it)
  7. after all is said and done, the output of uname -a is
  8. edit /etc/samba/smb.conf and change workgorup to PINCHII-DOMAIN (you may not even need this)
  9. edit /etc/request-key.conf and add:
  10. Now try manually mounting the Share:

    (This should prompt for a password )
  11. If all goes well, then you are done
  12. If you are getting errors, I suggest you check out the system log (dmesg | tail)

And now you are done!!

Facebook Twitter Email Linkedin Digg Delicious
Go to Top