Mount Network Shares using FSTAB
#1
This is doing my head in.

I've tried reading all the guides and information others have given, but my setup will not mount my shares.

My Windows PC - 192.168.0.11 or DejaVu-PC is definitely sharing my drives out.
I can mount them in Putty with -

sudo smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1

But with this in FSTAB - nadda -
192.168.0.11/drive1 /home/xbmc/mnt/drive1 ntfs defaults,auto 0 0

I've also tried nfs instead of ntfs, still the same.
What line do I need to put in FSTAB to automount my shares?

I've also tried using the smb://192.168.0.11/drive1 option in XBMC, but it is no good to me as I need to give Sickbeard access to these NTFS Shares.

Please help. Appreciated as always. Smile
Reply
#2
This is how I do it.
I create script in my home dir (can be wherever) with something like that:

Code:
#/bin/bash

#smbmount //192.168.0.1/misc /media/misc -o username=xbox,password=xbox
#smbmount //192.168.0.1/misc2 /media/misc2 -o username=xbox,password=xbox

And then I call this script when system starts:

Code:
[email protected]:~$ cat /etc/rc2.d/S99smb-startup
#/bin/bash
sleep 5
/home/mp/smbscript


Make sure both scripts are executable.
Reply
#3
Can this be done if there is no password for the shares?
It asks everytime when using

sudo smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1

and I just press Enter!
Reply
#4
Sure I don't see why not. This was just copy/paste from my setup.
Reply
#5
No go.

I've made a script called /home/xbmc/mounting.sh
Code:
#/bin/bash

#smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1 -o
#smbmount //192.168.0.11/drive2 /home/xbmc/mnt/drive2 -o
#smbmount //192.168.0.11/drive3 /home/xbmc/mnt/drive3 -o

And a script in /etc/init.d/mounting.sh which is added to the rc.d so it autoloads at boot.
Code:
#/bin/bash
sleep 5
/home/xbmc/mounting.sh

But my share directory's are still empty. Sad
Reply
#6
DejaVu77 Wrote:Can this be done if there is no password for the shares?
It asks everytime when using

sudo smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1

and I just press Enter!

Your problem with fstab is the ntfs. This is a network share. The file system is samba not ntfs. If this was a local drive then you would specify ntfs. In your case replace it with smbfs

ex
Code:
//ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0

z
Reply
#7
So in FStab

//192.168.0.11/drive1 /home/xbmc/mnt/drive1 smbfs defaults, auto, 0 0

Should do it with no need for a user and pass?

-EDIT-
Nope. No go still. Sad


Here's my entire fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=16900cd9-0c7c-4627-b28c-c27a794dafeb /               ext4    errors=remoun$
# swap was on /dev/sda5 during installation
UUID=4b209b24-f90e-4b4e-a037-cc588c8ecbfd none            swap    sw           $
//192.168.0.11/drive1 /home/xbmc/mnt/drive1 smbfs defaults, auto, 0 0
//192.168.0.11/drive2 /home/xbmc/mnt/drive2 smbfs defaults, auto, 0 0
//192.168.0.11/drive3 /home/xbmc/mnt/drive3 smbfs defaults, auto, 0 0
Reply
#8
I am so sorry. You need to remove # signs from each line when it says smbmount...

so this is how it should look like

Code:
#/bin/bash

smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1 -o
smbmount //192.168.0.11/drive2 /home/xbmc/mnt/drive2 -o
smbmount //192.168.0.11/drive3 /home/xbmc/mnt/drive3 -o

# makes it a comment


---------------------------------------


and for smbfs to work in fstab you will need

Code:
sudo apt-get install smbfs

hope it helps Smile
Reply
#9
Does not look like I'm meant to be able to do this -

Code:
Last login: Tue Nov 30 00:43:20 2010 from [b]192.168.0.11[/b]
[email protected]:~$ sudo apt-get install smbfs
[sudo] password for xbmc:
Reading package lists... Done
Building dependency tree
Reading state information... Done
smbfs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
.

I'll retry the script way. Smile
Reply
#10
OK Smile

According to this

http://ubuntuforums.org/showthread.php?t=283131

you should use cifs and not smbfs.

Read it and you should be able to get it to work with fstab.
My problem was that network was not up instantly upon bootup.
That is why originally I have a 5 seconds delay in my mounting script (sleep 5)
I am off to bed , good luck.
Reply
#11
New attempt =

-----------------------------------------------------------
cd ~
sudo nano /home/xbmc/mountdrives

Code:
#/bin/bash

smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1 -o
smbmount //192.168.0.11/drive2 /home/xbmc/mnt/drive2 -o
smbmount //192.168.0.11/drive3 /home/xbmc/mnt/drive3 -o

sudo nano /etc/init.d/mountdrives =

Code:
#/bin/bash
sleep 5
/home/xbmc/mountdrives

sudo update-rc.d -f mountdrives defaults
Adding system startup for /etc/init.d/mountdrives ...
/etc/rc0.d/K20mountdrives -> ../init.d/mountdrives
/etc/rc1.d/K20mountdrives -> ../init.d/mountdrives
/etc/rc6.d/K20mountdrives -> ../init.d/mountdrives
/etc/rc2.d/S20mountdrives -> ../init.d/mountdrives
/etc/rc3.d/S20mountdrives -> ../init.d/mountdrives
/etc/rc4.d/S20mountdrives -> ../init.d/mountdrives
/etc/rc5.d/S20mountdrives -> ../init.d/mountdrives

sudo chmod a+x /etc/init.d/mountdrives
sudo chmod a+x /home/xbmc/mountdrives

-----------------------------------------------------------

Given up for the night, been trying to do this since 12:30am - now 5am!

Thanks for your help though guys.

Off to bed, hope I dream how to solve it - but doubtful! Sad
Reply
#12
I use fstab to mount my network shares, not sure why yours are giving you problems. My shares are smb shares on another linux machine, but that shouldn't make a difference. Here's my fstab entry for my share:

Code:
//titan/Movies /home/boykster/videos    smbfs   auto,username=boykster,password=,uid=500,umask=000,user 0 0
Reply
#13
I am now totally baffled...

Quote:[email protected]:~$ sudo mount -a
mount.nfs: DNS resolution failed for //192.168.0.11: No address associated with hostname
mount.nfs: DNS resolution failed for //192.168.0.11: No address associated with hostname
mount.nfs: DNS resolution failed for //192.168.0.11: No address associated with hostname
mount.nfs: DNS resolution failed for //192.168.0.11: No address associated with hostname
[email protected]:~$ sudo smbmount //192.168.0.11/drive1 /home/xbmc/mnt/drive1
Password:
[email protected]:~$

mount -a
Could not resolve an address.
2 seconds later, smbmount can! WTF?

I'm going to have to do this manually until I can work out what is going on...!?!
Reply
#14
boykster Wrote:I use fstab to mount my network shares, not sure why yours are giving you problems. My shares are smb shares on another linux machine, but that shouldn't make a difference. Here's my fstab entry for my share:

Code:
//titan/Movies /home/boykster/videos    smbfs   auto,username=boykster,password=,uid=500,umask=000,user 0 0

OMG
I'm not even sure what's done it. But that worked!! K+ to all for all your help!!

My new shiny FSTAB is -

Code:
//dejavu/drive1 /home/xbmc/mnt/drive1  smbfs   auto,username=dejavu,password=,uid=500,umask=000,user 0 0
//dejavu/drive2 /home/xbmc/mnt/drive2  smbfs   auto,username=dejavu,password=,uid=500,umask=000,user 0 0
//dejavu/drive3 /home/xbmc/mnt/drive3  smbfs   auto,username=dejavu,password=,uid=500,umask=000,user 0 0

It's either the IP Address it did not like or the 'username=dejavu,password=,uid=500,umask=000,user 0 0' at the end.

But it's now working! Thanks guys!! Big Grin

Hope this helps others in the future! Smile
Reply
#15
Excellent! Glad that worked.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Mount Network Shares using FSTAB00