Tuesday, June 23, 2015

NFS and Shared Folder creation between servers


Install NFS on all your servers

yum install nfs-utils -y
service rpcbind start
service nfs start
service autofs restart

NFS server side

Then, in your "NFS server", create the shared folder (aka the folder to be shared)

mkdir /home/mich/SHARED_FOLDER
chmod a+w /home/mich/SHARED_FOLDER



Define the mount folder:

vi /etc/exports /home/mich/SHARED_FOLDER 192.168.1.0/24(rw,sync,no_root_squash,no_all_squash)
where the  192.168.1.0/24 is the IP range of the servers authorized to access this mounted folders

In order to make the export change effective, type:
exportfs -a

then, do not forget to start nfs
/etc/init.d/nfs start

or even to start it automatically in startup:
for ex:

cat /etc/rc.d/rc.local 

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
depmod -a
modprobe acpiphp
if [ -f /etc/rc.firstboot ]
then
        /etc/rc.firstboot | tee /var/log/firstboot.log
        cp /etc/rc.firstboot /usr/local/etc/
        rm /etc/rc.firstboot
        reboot
fi
touch /var/lock/subsys/local
/etc/init.d/nfs start

NFS CLIENT side


Then, on each client side, that want to use this mount :


mkdir /nfs/shared
mount -t nfs 192.168.20.11:/home/mich/SHARED_FOLDER/ /nfs/shared/


where 192.168.20.11 is the IP of the NFS server that you've configured in the previous paragraph

or do it automatically after startup:
vi /etc/fstab

add something like:
192.168.20.11:/home/mich/SHARED_FOLDER/ /nfs/shared/  nfs rsize=8192,wsize=8192,timeo=14,intr

if you want to test it without reboot your machine, do simply
mount -a

All those instructions were freely and quite fully inspired from this link:


Thursday, June 18, 2015

Cannot delete file in Windows - it says Already

Ever tried to delete / move / rename a file , but Windows refuses, saying the file is already used by another program ...


In order to find this f$@@%! other file that prevent you to handle this file, you can use ProcessExplorer




Press on Find / Find Handle or DLL
write the name of your file



Credits goes to
http://superuser.com/questions/399659/how-can-i-identify-what-application-is-using-a-given-file