LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2003, 04:05 PM   #1
Gorbachov
LQ Newbie
 
Registered: Sep 2003
Location: Bankya
Distribution: ASPLinux v7.3 Vostok
Posts: 29

Rep: Reputation: 15
Mount at boot.


Hi I am new at this place and at first sight I like it a lot...

Now what is my problem...

I want to mount some folders on an network server...there is no problem with the mount'ing but sometimes there is power failure and the my machine stop and after that reboot...so I have to mount all points again...!Is there a chance to solve this problem...Am not sure how to define this mount point in fstab...I try with one script for mounting this points but when I put it into rc.local it can't start because there is something missing at this time of the boot?

Gorbachov
 
Old 09-21-2003, 04:13 PM   #2
WanglessOlasov
Member
 
Registered: Jul 2003
Distribution: Slackware 9.0
Posts: 45

Rep: Reputation: 15
are you using samba or nfs to mount these network folders?
 
Old 09-22-2003, 02:42 AM   #3
Gorbachov
LQ Newbie
 
Registered: Sep 2003
Location: Bankya
Distribution: ASPLinux v7.3 Vostok
Posts: 29

Original Poster
Rep: Reputation: 15
Samba
 
Old 09-22-2003, 12:57 PM   #4
LarryDoliver
Member
 
Registered: Mar 2003
Posts: 126

Rep: Reputation: 17
samba or nfs doesn't matter.

you've got a file called /etc/fstab This lists the partitions that mount at boot. Edit it and add a line for each drive you want to mount. Should look something like

[server]:[path on server] [mount point] smb defaults 0 0

or

myserver:/var/exports/home /home smb defaults 0 0
 
Old 09-22-2003, 02:10 PM   #5
Gorbachov
LQ Newbie
 
Registered: Sep 2003
Location: Bankya
Distribution: ASPLinux v7.3 Vostok
Posts: 29

Original Poster
Rep: Reputation: 15
10x

But I hope that this won't be cruel by my side but is there a problem when suddenly the server /the machine that I want to mount fails and it is down?


Gorbachov

Proud user of ASPLinux


PS. It just doesn't work...
I try all of combination...sorry?Something else?

Last edited by Gorbachov; 09-22-2003 at 02:33 PM.
 
Old 09-22-2003, 02:49 PM   #6
ede
Member
 
Registered: Aug 2003
Posts: 37

Rep: Reputation: 15
i've used the easyest way to mount smb shares to my server: mout -t smbfs username=a,password=b //xxx/xxxx /mnt/xxx
 
Old 09-22-2003, 02:50 PM   #7
ede
Member
 
Registered: Aug 2003
Posts: 37

Rep: Reputation: 15
and that line i've put in /etc/rc.d/rc.local
 
Old 09-23-2003, 07:43 AM   #8
Gorbachov
LQ Newbie
 
Registered: Sep 2003
Location: Bankya
Distribution: ASPLinux v7.3 Vostok
Posts: 29

Original Poster
Rep: Reputation: 15
nIK write this script for me...!

Code:
#! /bin/sh
# these must be tuned.......
IP=192.168.0.6
SERVER=nik_new  # it don't work with IP, so i had to add host name in /ets/hosts to let it work
WORK_GROUP=gladiators
SHARE1=i
SHARE2=h
MOUNT_POINT1=/root/testi
MOUNT_POINT2=/root/testh

####################
# testing net part #
####################
case "$1" in
  start)
    COMMAND=START
    case `ping -q -n -c 3 -w 5 $IP` in
      *'0 received'*)
        COMMAND=STOP
        echo 'server is down, no way to start :('
        ;;
      *)
        ;;
      esac
    ;;
  stop)
    COMMAND=STOP
    ;;
  *)    
    case `ping -q -n -c 3 -w 5 $IP` in
      *'0 received'*)
        COMMAND=STOP
        echo 'server is down'
        ;;
      *)
        COMMAND=START
        echo 'turning on'
        ;;
      esac
     ;;  
 esac

###########################################################
# start/stop part - depend of parameter and server status #
###########################################################
case "$COMMAND" in
  STOP)
    case `mount | grep smb | wc -l` in
     *'0') 
       # do nothing - nothing was mounted
       ;;
     *)   
       umount $MOUNT_POINT1
       umount $MOUNT_POINT2
       # same for all other mount points
       ;;
     esac  
    ;;
  START)
    case `mount | grep smb | wc -l` in
     *'0') 
       mount -t smbfs //$SERVER/$SHARE1 $MOUNT_POINT1 -o ro,guest,workgroup=$WORK_GROUP
       mount -t smbfs //$SERVER/$SHARE2 $MOUNT_POINT2 -o ro,guest,workgroup=$WORK_GROUP
       # same for all other mount points
       ;;
     *)   
       # do nothing - it was already done
       ;;
     esac  
    ;;
 esac
But when I put it in my rc.local fail to start it...it just do not start it give me an error that it could be run at this stage of the boot?Something might be missing at this stage?
 
  


Reply



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
Why a FSTAB entry will mount using -a switch but will not mount automatically at boot mjen Linux - Newbie 3 05-19-2004 07:45 AM
mount a partition at boot ar1 Linux - General 2 02-16-2004 01:58 PM
mount --bind on boot tp6400 Linux - Newbie 1 01-25-2004 09:41 PM
Boot / Mount problem dsiguy Linux - General 6 09-23-2003 02:21 PM
mount error during boot mcd Linux - Software 0 08-14-2003 01:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:35 PM.

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
Open Source Consulting | Domain Registration