Thursday, October 3, 2013

Windows to Linux Storage Sharing: cifs mount params


Ever wonder on how to mount using mount.cifs.  This is dinosaur tech but I am putting it here anyway.

Act I.  Get and create your credentials file

Get the correct credentials from the shared drive and then do the following:


sudo echo -e "username=service" > /somedir/.somecredentials; sudo echo -e "password=p@ssw0rd" >> /somedir/.somecredentials


Act II.  Mount the drive

First create a mount point for this new share under your linux system.

mkdir /mnt/winshare

Then issue this command.

mount.cifs "//some_ip_address/mount_drive" /mnt/winshare -o credentials=/root/.somecredentials


Act III.  Bootstrap it!

The goal is for this service to available every time a reboot occurs, you can do this by creating a simple script to help on this on and put it on /etc/rc.local


Cheers!