mount network drives

You have a problem with Salix? Post here and we'll do what we can to help.
ron_uit_best
Posts: 32
Joined: 25. Oct 2009, 09:36
Location: Netherlands

mount network drives

Post by ron_uit_best »

Hello, I am trying to mount a network drive on startup. Therefor I added the next line in my rc.local ('nas' is the correct IP for the nas-server)

Code: Select all

sleep 20 && mount nas://home/Media /drives/nfs -o nolock &
However, when I open thunar the folder /drives/nfs is empty. If I type the command (without sleep and the 3 &'s) manually (as root) the folder is mounted properly.

Why is that?

Edit: since I can only assign one drive in the nas (conceptronic CH3NAS) as NFS drive, AND I want to share another, is it a better solution to use Samba or FTP (which are among the other options)?
User avatar
gapan
Salix Wizard
Posts: 6365
Joined: 6. Jun 2009, 17:40

Re: mount network drives

Post by gapan »

ron_uit_best wrote:Hello, I am trying to mount a network drive on startup. Therefor I added the next line in my rc.local ('nas' is the correct IP for the nas-server)

Code: Select all

sleep 20 && mount nas://home/Media /drives/nfs -o nolock &
However, when I open thunar the folder /drives/nfs is empty. If I type the command (without sleep and the 3 &'s) manually (as root) the folder is mounted properly.

Why is that?
What does the mount command show after running from rc.local? Does it show the mountpoint as mounted? I don't think there's any reason that it shouldn't work, only if the network hasn't come up yet in those 20 secods, but that's doubtful.
ron_uit_best wrote:Edit: since I can only assign one drive in the nas (conceptronic CH3NAS) as NFS drive, AND I want to share another, is it a better solution to use Samba or FTP (which are among the other options)?
I always use ssh and mount with sshfs these days. Easier than anything else and traffic is also encrypted.
Image
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: mount network drives

Post by thenktor »

ron_uit_best wrote:Hello, I am trying to mount a network drive on startup. Therefor I added the next line in my rc.local ('nas' is the correct IP for the nas-server)
Why not add it to the fstab? Actually this should work.
ron_uit_best wrote:Edit: since I can only assign one drive in the nas (conceptronic CH3NAS) as NFS drive
That's a joke, isn't it? :mrgreen:
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
ron_uit_best
Posts: 32
Joined: 25. Oct 2009, 09:36
Location: Netherlands

Re: mount network drives

Post by ron_uit_best »

Ok, now I am gonna feel stupid: I have a 2nd rc.local in my homedir, so that (after a reinstall) it is saved at all times (I backup my homedir). The one in rc.d is pointing to my own. Silly part: I forgot to point the one in rc.d to my own.

Nevertheless, I still have a problem mounting a second NFS.
@thenktor: it was not a joke

My Nas only gives the following options: Samba share (I cannot get this to work), NFS (already used), Itunes (I don't have it), FTP and UPNP
So one of the last 2 should be used I guess. Samba gives a whole lot of misery, cannot get it to work, smbfs is not recognized, cifs instead gives memory errors.

Is UPNP an option?
Otherwise FTP will do. By the way, ssh also works on this nas. Any thoughts?
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: mount network drives

Post by thenktor »

So your NAS has two hard disks built in and you can only create one NFS share? That's really a shame. As gapan already said you can use sshfs to mount a share. It actually can be used like a NFS share, but may be slow on the NAS (because of the encryption with a slow NAS CPU).
You cannot use UPNP/DLNA for mounting a share. It's for use with media players only.

PS: At work I've bought a Synology DS213+ NAS which was intended to be used as backup server with enrypted disks. But I also could not believe my eyes when I've noticed that enryption was not available for NFS shares.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
ron_uit_best
Posts: 32
Joined: 25. Oct 2009, 09:36
Location: Netherlands

Re: mount network drives

Post by ron_uit_best »

Little late (very busy lately) but I would like to try the SSH way. Siince I only want to copy modified files, there is not very much traffic.

What would be the commands to mount a folder from the nas on my system and can I use rsync after to copy files/folders?

By the way: the network is indeed NOT yet up after those 20 seconds, I had to change the value to 25. Very weird. In Salix 13.37 it worked (KDE version), but now with 14 (XFCE) my network is not up, even opera and thunderbird complain there is no network yet if I open them too soon.
User avatar
gapan
Salix Wizard
Posts: 6365
Joined: 6. Jun 2009, 17:40

Re: mount network drives

Post by gapan »

Make sure you have ssh running on your server and install the sshfs-fuse package in your client. Then:

Code: Select all

sshfs username@yournasip:/path/to/shared/dir /your/mount/point
run that as an unprivileged user, not as root.

You can use the data as any other local data after that, including rsync or whatever.

Unmount with:

Code: Select all

fusermount -u /your/mount/point
You can even do multiple ssh mounts this way, so you can share anything you want separately.
Image
Image
ron_uit_best
Posts: 32
Joined: 25. Oct 2009, 09:36
Location: Netherlands

Re: mount network drives

Post by ron_uit_best »

When I mount using sshfs it first asks my password, then it exits with the message: 'remote host has disconnected'.
It also does this as root.

Is my nas sshfs-unfriendly?
User avatar
gapan
Salix Wizard
Posts: 6365
Joined: 6. Jun 2009, 17:40

Re: mount network drives

Post by gapan »

You need to provide a username/password that is valid in your nas, not on your client pc.
Image
Image
ron_uit_best
Posts: 32
Joined: 25. Oct 2009, 09:36
Location: Netherlands

Re: mount network drives

Post by ron_uit_best »

I am using the right password for the nas. Because when I type the wrong password it asks me again. Also, it works when using ssh.
Post Reply