Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › fstab? auto-mount shared folders from windows machine? (ubuntu)
New Posts  All Forums:Forum Nav:

fstab? auto-mount shared folders from windows machine? (ubuntu)

post #1 of 9
Thread Starter 
I have ubuntu 10.04 LTS

How can I auto-mount drives/folders from another machine if "auto eth0" doesn't initialize until I reach the desktop?

Also, sometimes it takes forever for linux to detect my server (and sometimes it won't at all) yet it detects my laptop almost instantly?

Now for the fstab edit. I have no idea how to configure it how I need it.

Here's an example of my servers tree (which might be pointless for this but I'll add it anyways):

Server:
c:
--OS (server 08 R2)
e:
---movies
-----movie 1
-----movie 2
f:
---tv
-----tv 1
-----tv 2
---mp3s
-----mp3 1
-----mp3 2
g:
---docs
-----doc 1
-----doc 2

Basically when any computer connects to my network they'll see the directories "movies, tv, mp3s, and docs". They can access them without any username or password.

I'd like to auto-mount so I have access to those directories when ubuntu starts up.

Here are some examples of lines i've added to fstab but none are right.

Code:
\\\\SERVER\\TV              /mnt/server    ntfs    auto,user,ro    0       0
\\\\SERVER\\Movies        /mnt/server    ntfs    auto,user,ro    0       0
\\\\SERVER\\Docs          /mnt/server    ntfs    auto,user,ro    0       0      
\\\\SERVER\\mp3s           /mnt/server    ntfs    auto,user,ro    0       0  

smb://workgroup/SERVER\\TV  /mnt/server    ntfs    auto,user,ro    0       0
//workgroup/SERVER\\TV          /mnt/server    ntfs    auto,user,ro    0       0

smb://workgroup/SERVER\\TV  /home/mark    ntfs    auto,user,ro    0       0
//workgroup/SERVER\\TV         /home/mark    ntfs    auto,user,ro    0       0
I always get errors and have to "skip" during boot...

EDIT: I'm a noob at this so feel free to laugh at my attempts
Edited by Damarious25 - 5/13/11 at 1:20am
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
post #2 of 9
run a mount script as an extension of your networking script.

[edit] Or make a new one that will run after your networking runs, it's completely possible.
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #3 of 9
Thread Starter 
Quote:
Originally Posted by mushroomboy View Post
run a mount script as an extension of your networking script.

[edit] Or make a new one that will run after your networking runs, it's completely possible.
Thanks for the heads up. Do you have a link to a quick guide on doing this?

As you can see I don't mind putting in some time and work (and random bad guesses) but I usually need a nudge in the right direction.

What I mean is even if I piggyback a mount script on the networking script, I'm still gonna have to figure out what to type into fstab right?
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
post #4 of 9
http://www.slackware.com/config/init.php

I'm guessing /etc/rc.d has your main network script, you can tagg something at the end of that! You could have it be direct mount code as it'll be ran as root. So something like:

mount_smbfs //usernameassword@192.168.1.216/blxshare /Users/adam/Desktop/blxshare

Or a series of mounts, or you could make your own bash script and have all your mount commands in that too. Just call the bash script inside the network code after it gets a dhcp lease. You should probably have it only call if the network actually goes up. You could even edit your init so that right after the system calls the network scripts it will call your custom script.

rc.inet1.conf that's the network file, really just read that link on slackware. I'm guessing by your response your one of the smarter users. lol So nice too.

[edit] As for fstab:

http://www.tuxfiles.org/linuxhelp/fstab.html

noauto should be added to the devices so they don't get mounted at boot and only mounted when you call to mount them. Then you could shorten your mount script drastically. =)

Oh, and I forgot, I'd help you on making bash scripts but I don't really use them. I'm pretty sure off your response you can use google and a bash guide, or just google a simple bash script and use it as an example. "simple bash script linux" or something
Edited by mushroomboy - 5/13/11 at 2:26am
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #5 of 9
Thread Starter 
Quote:
Originally Posted by mushroomboy View Post
http://www.slackware.com/config/init.php

I'm guessing /etc/rc.d has your main network script, you can tagg something at the end of that! You could have it be direct mount code as it'll be ran as root. So something like:

mount_smbfs //usernameassword@192.168.1.216/blxshare /Users/adam/Desktop/blxshare
This is one thing I don't get. I ran across a lot of lines for fstab that included username=xxx,password=xxx

But but but but but... my windows server doesn't require a user name or password to access its folders?! Instead of setting sharing options for my ntsf HDDs, I just edited security on them to allow list contents, and read only. That way when I have company or my gf is here they don't need a username or password to access my windows folders, the folders automatically show up in the network with read only properties. The sharing option is actually turned off.


Quote:
Originally Posted by mushroomboy View Post
Or a series of mounts, or you could make your own bash script and have all your mount commands in that too. Just call the bash script inside the network code after it gets a dhcp lease. You should probably have it only call if the network actually goes up. You could even edit your init so that right after the system calls the network scripts it will call your custom script.

rc.inet1.conf that's the network file, really just read that link on slackware. I'm guessing by your response your one of the smarter users. lol So nice too.
Basically I'm looking for anyway to do this. So i'll try just about any method. It's on a HTPC in the living room so my gf must be able to turn the machine on and see a folder on the desktop that has my 5 or 6 shared folders in it so she can easily turn on a tv show or movie when I'm not around.

Quote:
Originally Posted by mushroomboy View Post
As for fstab:

http://www.tuxfiles.org/linuxhelp/fstab.html

noauto should be added to the devices so they don't get mounted at boot and only mounted when you call to mount them. Then you could shorten your mount script drastically. =)

Oh, and I forgot, I'd help you on making bash scripts but I don't really use them. I'm pretty sure off your response you can use google and a bash guide, or just google a simple bash script and use it as an example. "simple bash script linux" or something
That's the guide I was trying to follow when I was editing my fstab but it didn't really go as deep as I needed. You can see my results from the code I posted... lol

I kinda wanted auto on so everything is there mounted as read only so my gf can quickly navigate media.

as for bash scripts I use to play with batch files in windows a while ago so would probably enjoy that route. It would be a case of "oh, this does this in windows and this is the somewhat linux equivalent"... Or I hope anyway.
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
post #6 of 9
In your situation you don't want automount because fstab runs before networking so you can see the problem.

I guess the first thing that should be asked is can you mount them and how? if you can, with a manual command and can't figure out fstab we can just make a script that mimics them (the manual commands,for now). So first step would be making a script that can automount. If you can't get it to work with fstab then just make one with what you know (again, for now). After that we can then find out where to put the lines in your networking files. I'm going to bed though. =P I'm sure getting a nice and neat script for auto-mounting them should be good enough atm. As you can do a real easy route and have KDE/Gnome call that script after login (that's way easy) and then we could integrate it more tomorrow if you want. lol I forgot about login scripts.

[edit]

I forgot, you'll be able to make the script but will have to have it ran as root. so in order to test it you'll have to do "sudo scriptname" which can't be done with a login script.

Ok, scratch that ubuntu site. Just use /etc/rc.d/network for now, or find out if the distro you are using has a folder to put scripts that are to be ran after the network comes up.

Oh and this is a very dirty way to get what you want done, it is a very simple way though and is what I like about Linux.
Edited by mushroomboy - 5/13/11 at 4:01am
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #7 of 9
Thread Starter 
Quote:
Originally Posted by mushroomboy View Post
In your situation you don't want automount because fstab runs before networking so you can see the problem.
Ahhh, I see. Also, a little busy atm here. I didn't sleep last night and it's morning here so I need to "start(?)" my day and head out.

Can't wait to get started though!

And yeah, it's worked but randomly. When I look in network in ubuntu I can usually see my laptop instatly but my server sometimes doesn't show up. I''m not sure what that's all about.

But once when the server did show up I was able to go in, file browse, and stream media. Ubuntu is currently 99% stock. All I did was apt-get samba. So things are there, I just worry even if we sort this out, it might not work all the time until I figure out why my server decides to stay hidden from time to time? (I think it knows it's days are numbered as I migrate my home machines to linux and it's scared)
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
post #8 of 9
LOL Yeah, basically all we are doing is extending the network script to run custom mount commands. Once you think about it it ends up being a real simple task. The problem is finding out where the script needs to be called from. It just boils down to

1) Make script

2) Call script after network script

You don't even have to call it in the network script. As long as you know how to make the script run after the network script or be called by a script that comes later you are good.

[edit] You know I'm tired cause I keep editing terribly. Now why did I want to edit this? Oh right, about your server not showing up. As far as getting the drives to mount that's not a concern. Making them mount after your network comes up and them actually showing up are two different things. If they show up, even though it's slow, then your script will work. If they don't show up, even after manual commands, then something isn't working properly. That would need different troubleshooting. Since I don't use samba (no windows shares) then I really don't have much experience with it. The experience I do have won't help, it always worked with me.
Edited by mushroomboy - 5/13/11 at 4:09am
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #9 of 9
Thread Starter 
Old thread... But a lots happened.

I got rid of server 08. it was causing to many head aches. I installed Win7 and now on my ubuntu machine the shares come up everytime, right away,

I'll work on a quick script later. For now I've got to start a thread asking for a guide to video playback in Linux. This is retarded lol. In windows I just get cccp and everything works but here in linux i have files that won't play sound, and some files are really choppy that were always fine before.
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Pentium III @ 533MHz QDI Advance 10F lol 255MB 
Hard DriveOSPower
IDE TC Hamster wheel 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › fstab? auto-mount shared folders from windows machine? (ubuntu)