LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2005, 07:06 AM   #1
steve007
Member
 
Registered: Jun 2005
Distribution: Fedora Core 3
Posts: 96

Rep: Reputation: 15
Mounting across network


Hello,
I have a little tiny problem. I have got a network share mounted to a folder on my Fedora Core system, all works fine... however, i do have one problem... and that is, how do i get the mount back if the network shared PC restarts or turns off?
If the share is powered down then the Fedora System crashes when accessing the folder, presumably because its trying to access a mounted volume, the folder can not be deleted because it keeps crashing so therefore i have to restart the Fedora machine, load up the other pc and re mount it (I could probably get it to mount on boot up but this Fedora system is not supposed to be reset as its acting as a PDC at the moment).

is there a way i can get my Fedora Core system periodically check if the network share is still available? If it's not available then dont do anything, if it is can i get it to remount it once its available again?

of course my obvious solution is to leave the network share pc turned on i figured that, but if there is a hardware failure or power surge in it... then its unavoidable.

If you could let me know if this is possible or not id greatly appreciate it.


Thanks.

Last edited by steve007; 09-07-2005 at 07:10 AM.
 
Old 09-07-2005, 08:48 AM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 30
It is possible.
I would script a solution that allows you to touch a file on that share. If it fails, remove the entry from /etc/xtab, and restart nfs (service nfs restart).

Just a thought:
Code:
#!/usr/bin/perl -w

my $exit = system("touch /path/to/mount/filename");
unless($exit == 0){
    system("cat /etc/xtab | grep -v /path/to/mount > /etc/xtab");
    system("service nfs restart");
    system("mount 10.0.0.1:/path/to/mount /mountpoint");
}
Make that a cron job running every 2 minutes
Substitute /path/to/mount to the mountpoint you are using in the first system call.
Same with the second.
Sub the nfs server info and mountpoint in the forth one.
Save the file, and chmod +x to be able to execute.

Last edited by PenguinPwrdBox; 09-07-2005 at 08:50 AM.
 
Old 09-07-2005, 10:03 AM   #3
steve007
Member
 
Registered: Jun 2005
Distribution: Fedora Core 3
Posts: 96

Original Poster
Rep: Reputation: 15
Hello,
I have edited your code and run it, but its gives me an error saying unexpected token near '(' on line two, then displays line two as having an error...
this is my code

Code:
#!/usr/bin/perl -w
my $exit = system("touch /disks/Disk-1/.testmount");
unless($exit == 0){
    system("cat /etc/xtab | grep -v /disks/Disk-1 > /etc/xtab");
    system("cat /etc/xtab | grep -v /disks/Disk-2 > /etc/xtab");    
    system("service nfs restart");

    system("mount -t -p mypass smbfs 192.168.1.15:/Disk-1 /disks/Disk-1");
    system("mount -t -p mypass smbfs 192.168.1.15:/Disk-2 /disks/Disk-2");

}
what is wrong with that on line two? I'ts the same as yours, I am not a perl programmer so i have no idea what is wrong with the code... any help would be most appreciated

Steve
 
Old 09-08-2005, 04:59 AM   #4
steve007
Member
 
Registered: Jun 2005
Distribution: Fedora Core 3
Posts: 96

Original Poster
Rep: Reputation: 15
Anyone fancy helping me with this perl script at all??

cheers
 
Old 09-08-2005, 07:53 AM   #5
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
firstly matey its quite rude to bump up your post by just posting again with a begging question offing no more insight to your problem. people take time out of their own lives to give somethign back with no personal benifit for them. nobody gets paid for answering your questions so sending a message demanding help when theres been no perly for only a day is quite ungrateful

anyway

if your not a perl programmer try and learn some? - linux is all about learning

i've just run the script and its runs fine with the exception of the lack of all your specific directories

you sure you've got perl installed?

look at this,
5 minutes googling gets you this
google for 'nfs server outage unmount'
first link is
http://www.netapp.com/tech_library/ftp/3183.pdf

section 4.3 might be what you want?
did you read the nfs man pages?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
network mounting steve007 Linux - Newbie 6 07-05-2005 02:37 PM
network mounting steve007 Linux - Networking 1 07-04-2005 07:24 AM
mounting across network vivekitbhu Linux - General 3 04-05-2005 05:02 PM
network mounting? doublefailure Linux - Software 1 03-02-2003 05:39 AM
mounting a network drive... Sonny Linux - Security 6 01-24-2002 01:08 PM


All times are GMT -5. The time now is 10:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration