LinuxQuestions.org
Review your favorite Linux distribution.
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 10-26-2004, 12:41 PM   #1
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Rep: Reputation: 15
auto mount a network drive at boot


I have a linux box connetted t oa few other computers...and i dont have the space to store all the music they share. so i have to mount the drives they have shared in order to play em...its get annoying haing to do this after each reboot.

from what i have read i need to edit fstab in /etc
so i open that file up. but im not sure what i sould type
fstab looks like this:
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdc2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

so at everyboot up i open up a terminal and enter this:
smbmount //gtp/Music /root/.gnome-desktop/Music



anyway i can have this happen on its own?
 
Old 10-26-2004, 12:55 PM   #2
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
/root/.gnome-desktop/Music //gtp/Music smb defaults 0 0



this is the line i added....will this work? i totally pulled this outta the air...
 
Old 10-26-2004, 01:06 PM   #3
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
I have:

\\server\share /mnt/point smbfs password=pass,username=user,noauto 0 0

Depending on your distro, for example in Slackware, there is a file called rc.local, in there i just have:
mount /mnt/point
as listed above and it works.
The rc.local file is the last script to run on a slackware boot up before login.
 
Old 10-26-2004, 01:13 PM   #4
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
i have a distro just like RH...ne idea?
 
Old 10-26-2004, 01:33 PM   #5
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
ok here is me restating it....
basically i have a clone of RH.

I have a folder on my desktop i have linked to a windows machine that has mp3s on it.
so i do this everytime i start up this linux box:
smbmount //windows/music /desktop/folder
password:
done

and then i can play that music.

how can i edit my /etc/fstab file so i dont need to do the above whenever i boot up. like have it to it on its own at startup?
 
Old 10-26-2004, 02:09 PM   #6
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
did you search for a file called rc.local?
 
Old 10-26-2004, 02:22 PM   #7
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
yeah its in /etc what do i do with it?
#!/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.

touch /var/lock/subsys/local
mount //gtp/Music <<<<line i added



is that it?

Last edited by Dr Gutiemouth; 10-26-2004 at 02:26 PM.
 
Old 10-26-2004, 02:27 PM   #8
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
post your fstab and then i can tell you what to put in it
 
Old 10-26-2004, 02:28 PM   #9
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdc2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
 
Old 10-26-2004, 02:37 PM   #10
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
add this to your fstab:
\\server\share /mnt/point smbfs password=pass,username=user,noauto 0 0

\\server\share = windows machine info

/mnt/point = location on linux machine to mount to

user= windows user
pass=windows user password

once that is in fstab, then you can add:

mount /mnt/point

to your rc.local file.
 
Old 10-26-2004, 02:50 PM   #11
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
thanks for your help but it didnt work....

...i'll come back to this later, i need to goto work now...

thanks again....

after work i'll tell you what i put in, maybe i messed something up..
 
Old 10-26-2004, 03:09 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
//windows/music /root/.gnome-desktop/Music smbfs username=<name>,password=<pass>,netdev,soft ,_intr1 0

I think this will work. Look in man mount and man fstab and man smbmount for more details and options. Mount it someplace else however, like /windows/music or /mnt/windows/music. And please don't log in as root. Su to root from inside a terminal, or even better, for one liners use sudo.

Also consider using uid=, gid=, and umask= options.

This may not be the best way to go anyway, because the userid and password are in your fstab file.
 
Old 10-26-2004, 07:26 PM   #13
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
ok i did what both of you said and it didnt work. t his is how i did it

logged in as root i opend the file /etc/fstab with gedit
added in each of the lines at different times...with spaces under them

then saved it..
rebooted, logged in as root. opened the .gnomre desktop foler to see if it worked, and the music wasnt there

im streaming the files from //gtp/Music and when i use smbmount i have them goto /root/.gnome-desktop/Music

am i supposed to ad them in fstab with a terminal or something? i just edited the file with the first program that can edit it.
again...i then just saved it and rebooted.


im atotal noob. i know very very little about what im doing.
this stuff:
nd please don't log in as root. Su to root from inside a terminal, or even better, for one liners use sudo.

Also consider using uid=, gid=, and umask= options.


im sorry but this is jibberish to me! i dont know what that is...
 
Old 02-27-2005, 06:28 AM   #14
MeatAbstract
LQ Newbie
 
Registered: Jun 2003
Location: Sweden
Distribution: Debian
Posts: 13

Rep: Reputation: 0
try changing \\ to //
in fstab for exampel

//computer/share /mount/point smbfs username=$login,password=$pass
 
Old 02-27-2005, 01:32 PM   #15
Dr Gutiemouth
Member
 
Registered: Oct 2004
Location: ohio
Distribution: Whitebox, Gentoo, XP,
Posts: 57

Original Poster
Rep: Reputation: 15
i got it to work but i dont remember how...and there was two icons on my desktop when i finally got it to work...oh well...i since nuked the drive and put gentoo on it...now if only i can get it to work
 
  


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
how do I auto-mount a drive at boot warkrime Linux - Newbie 7 08-03-2013 04:56 AM
cdrom and floppy drive auto mount problem shams Fedora 1 02-27-2005 07:43 AM
Auto Mount a Network Drive thebutler4 Linux - Newbie 3 06-23-2004 09:56 PM
Auto-mount a network drive agarnier Linux - Networking 4 10-29-2003 07:09 AM
auto mount of novell drive saavik Linux - Networking 7 08-07-2003 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:34 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
Open Source Consulting | Domain Registration