06 July, 2013

NFS Hard and Soft Mount

NFS Hard and Soft Mount


You're assuming that a NFS filesystem will be unmounted if the NFS server is not reachable. This is not true.
 
What actually happens is a bit more complicated.
 
To avoid wasting network bandwidth, the NFS client will not continuously poll the NFS server to make sure it is still reachable. So the NFS client won't always know that the server has become unreachable until it tries to access a file on the NFS server.
 
Most of the filesystem I/O goes through the buffer cache (memory-mapped files are always cached, other methods may have an option to avoid caching). Normally, when a program writes something to a file, the OS will make some checks, and if there is nothing to stop the operation from succeeding, the data to be written is accepted into the cache and the program is told that the write is successful. The OS will do the actual write a bit later, in the hope that it can gather multiple small write operations and write them all in one big operation, because it will be more efficient. Normally this works well.
 
But if the NFS server becomes inaccessible between the data hitting the cache and the actual write operation, the OS has a big problem. As far as the program is concerned, the write operation was successfully done and firmly in the past; the OS already told it so. There is no way for the OS to go back on its word and tell the program that the write operation failed after all.
 
At this point, the OS has two choices:
•It can hold the program in a frozen state while it tries again and again to reach the NFS server and complete the write operation. This is exactly what the hard mount does. At this point, the kernel usually outputs a message for all logged-in users: "NFS server not responding, still trying" in order to alert the users that there is a problem,
•Or the OS can keep trying for a while, then give up and throw away the data, and tell the program that accessing the NFS filesystem is no longer possible when it makes the next NFS write operation. This is what the soft mount does. (The program will know that operation #2 failed, but it will have no clue that operation #1 failed too.)

Whether the mount was soft or hard, it should automatically recover as soon as the NFS server is reachable again. (However, if the NFS server has rebooted while it was unreachable, any file locks that may have been established on the NFS filesystem before must be recovered with a special procedure or they will be lost, and that can be yet another can of worms...)
 
After this bit of background, the answers to your actual questions:
 
1.) No, you don't need to re-mount soft NFS mounts after a NFS server becomes unreachable and then returns.
 
2.) As far as I've undrstood, you can use soft mounts safely only if:
•you don't care that you might lose some data if the NFS server becomes unreachable, or
•your programs "know" that they are working with a soft-mounted NFS filesystem and are designed to take special steps to guard against data loss.

So, in some very limited circumstances, a soft NFS mount might be useful, but in general, soft NFS mounts are a bad idea. Don't use them unless you really know what you're doing.

16 August, 2010

क्या भारत युवाओं का देश है ?

क्या भारत युवाओं का देश है मै नहीं मानता |
कहते है की किसी भी देश का विकास नयी पीढ़ी के हाथो मे होता है | नयी पीढ़ी परिवार या देश का भविष्य होती है |
मगर हमारी ये सोच शायद भरम है | जब भी देश को नेत्रित्व , प्लानिंग , सञ्चालन , भविष्य निर्धारण की बात होती है तो युवा कहीं नहीं होता , उस देश मे जहाँ की 70 % जनसंक्या युवा है |
अगर हम और देशों ( विकसित / विकासशील ) की बात करें :

ENGLAND - David Camerron (9 October 1966) - 44 yrs Prime minister
FRANCE - Nicolas Sarkosy (28 jan 1955) - 55 yrs President
USA - Barak Obama ( 4 Aug 1961)- 49 yrs
RUSSIA - Dimitry Medvedev (14 Sep 1965) - 45 yrs President
GERMANY - Christian Wilhem Wulff (14 sep 1965) - 51 Prime minister

JAPAN-Naoto Kan (10 October 1946) 64

CHINA - Hu Jintao 12 Dec 1942 68
इन सब देशों मे बुज़ुर्ग नहीं है क्या ?
अब अपने देश की खासियत की बात करें:

1 Manmohan singh Prime Minister of India 77 Yrs

2 Pranab Mukharji Minister of Finance 74 Yrs

3 P. Chidambaram Minister of Home Affairs 64 Yrs

4 A K Antony Minister of Defense 68 yrs

5 Sharad Pawar Minister of Agriculture and Minister of Consumer Affairs, Food and Public Distribution

6 Veerappa Moily Minister of Law and Justice 69

7 S.M. Krishna Minister of External Affairs ७७

8 Virbhadra Singh Minister of Steel 75

9 Vilasrao Deshmukh Minister of Heavy Industries and Public Enterprises 64

11 Sushilkumar Shinde Minister of Power 69

http://en.wikipedia.org/wiki/Union_Council_of_Ministers_of_India बाकी की लिस्ट इस लिंक मे मिल जाएगी |

हमारे देश मे साठ साल की उम्र से ज़यादा के लोगो को सेनिओर सिटिज़न कहा जाता है |सरकार उन्हें पेंशन दे के आराम करने की सलाह देती है | पर इन्हें कोंन से सरकार retire करेगी | क्यूँ की ये खुद तो कुर्सी छोडेंगे नहीं |

देश का भविष्य , देश का भूत ही निर्धारित करता रहेगा क्या ?

क्या हमारे देश मे युवा नहीं या युवाओं की ज़रूरत नहीं ? क्या हमारे देश के युवा जागरूक नहीं या राजनीती मे रूचि नहीं रखते ? क्या युवा अभी जगा नहीं है ? ये कब तक चलता रहेगा ?


साठ के दशक मे एक गाना आया था " इन्साफ की डगर पे बच्चों दिखाओ चल के ये देश है तुम्हारा नेता तुम्ही हो कल के " उस समय जो बच्चे थे वोह आज नेता है | तो आने वाले नेता भविष्य मे का गुल खिलाएंगे|


निष्कर्ष तो मै नहीं निकाल सकता , और न ही उस से कुछ बदलने वाला है | हाँ जो मैंने सोचा वोह आपको बताने की कोशिश की थी बस |


24 July, 2010

How to create Multiple usres in linux

To create multiple users
Add a new group according to your Requirement.
#groupadd tacusers
now , open editor for script
#vim username.sh
srno=1
echo "Sno. ......................... Name............................. " cat >users
echo "#########################################" cat >>users
for mxx in `cat userdetail`
do
mx3=`echo $mxx cut -d "" -s -f1`
mx1=`echo $mxx cut -d "" -s -f1`
mx2=`echo $mx3 sed "s/-/ /g"`
echo "$srno $mx2 $mx1"
echo "$srno $mx3 $mx1 " awk `{printf "%-3d %-35s \n" , $1, $2, $3 }` cat >>users
/usr/sbin/useradd -m -g 506 -c "$mx2" -d /home/tac_users/$mx1 -s /bin/bash "$mx1"
echo " passwd $mx1"
echo $mx1 passwd --stdin $mx1
srno=`expr $srno + 1`
done
echo "###################################" cat >>users
echo "###################################" cat>> users

:wq!

****Now create file to add users**************
cat userdetail
DHQ,Dehradunukdehadmin
THQ,Rishikeshukrisadmin
BHQ,Raipurukraiadmin
THQ,Vikasnagarukvikadmin
BHQ,Doiwalaukdoiadmin


add many user detail line as you want and by running script username and passwd will be created on your machine , whose username are given in file userdetail and password will be username.
eg for ukdehadmin username : passwd will be ukdehadmin ....
enjoy.......

13 March, 2010

"Blowin' In The Wind"

How many roads most a man walk down
Before you call him a man ?
How many seas must a white dove sail
Before she sleeps in the sand ?
Yes, how many times must the cannon balls fly
Before they're forever banned ?
The answer my friend is blowin' in the wind
The answer is blowin' in the wind.

Yes, how many years can a mountain exist
Before it's washed to the sea ?
Yes, how many years can some people exist
Before they're allowed to be free ?
Yes, how many times can a man turn his head
Pretending he just doesn't see ?
The answer my friend is blowin' in the wind
The answer is blowin' in the wind.

Yes, how many times must a man look up
Before he can see the sky ?
Yes, how many ears must one man have
Before he can hear people cry ?
Yes, how many deaths will it take till he knows
That too many people have died ?
The answer my friend is blowin' in the wind
The answer is blowin' in the wind.
-BOB DYLAN
This is Bob Dylan`s songs , released in 1963 , song became anthems for the civil rights and anti-war movements. I would like to share the song and lyrics to you. You surely gona love it

08 August, 2009

"Excuse Me Mr."

Oh - excuse me Mr. Do you have the time, Or are you so important that it stands still for you? Excuse me Mr. Want you lend me your ear, Or are you not only blind but do you not hear? Excuse me Mr. but isn't that your oil in the sea, And the pollution in the air Mr., Whose could that be?

So, excuse me Mr. But I'm a mister too. And you're givin' Mr. a bad name, Mr. like you.

"And, I'm taking the Mr. from out in front of your name, 'cause
it's a Mr. like you that puts the rest of us to shame. It's a Mr. like you that puts the rest of us to shame."

And I've seen enough, Oh - I've seen enough, I've seen enough to know that I've seen too much.

Excuse me Mr. Can't you see the children dying? You say that you can't help them, Mr. you're not even trying. Excuse me Mr. Just take a look around. Oh, Mr. just look up and you will, You'll see it's coming down. Oh, excuse me Mr. but I'm, I'm a mister too. And you're givin' Mr. a bad name, Mr. like you.

So, I'm taking the Mr. from out in front of your name, 'cause it's a Mr. like you that puts the rest of us to shame. it's a Mr. like you, puts the rest of us to shame.

And I've seen enough, I've seen enough to know that I've seen too much. 'cause Mr. when you're rattling on heaven's gate. By then it is too late. 'cause Mr. when you get there, They don't ask what you saved. All they'll want to know Mr. is what you gave. So, excuse me Mr. But I'm a mister too. And you're givin' Mr. a bad name, Mr. like... you.

So, I'm taking the Mr। from out in front of your name, 'cause it's a Mr. like you puts the rest of us to shame. Mr. like you, puts the rest of us to shame. Oh... ...shame.

- BEN HARPER