LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mount NAS-QNAP to Ubuntu Server (https://www.linuxquestions.org/questions/linux-newbie-8/mount-nas-qnap-to-ubuntu-server-4175498144/)

AmirSI 03-14-2014 03:26 AM

Mount NAS-QNAP to Ubuntu Server
 
I have my QNAP on network whit a static ip, i need to mount it on Linux Ubuntu Server.

I have tryed :
sudo mount -t nfs -o username=admin,password=admin 192.168.2.12:vmware-bkp ~/mnt/QNAP-backup/

And i get error: mount.nfs: an incorrect mount option was specified

I tryed some other options and i cant get it to work.
If i look on QNAP control panel i have File System: EXT4 and it is RAID6.

What am i doing wrong?

Doc CPU 03-14-2014 04:01 AM

Hi there,

Quote:

Originally Posted by AmirSI (Post 5134316)
I have my QNAP on network whit a static ip, i need to mount it on Linux Ubuntu Server.

I have tryed :
Code:

sudo mount -t nfs -o username=admin,password=admin 192.168.2.12:vmware-bkp ~/mnt/QNAP-backup/
And i get error: mount.nfs: an incorrect mount option was specified

Two thoughts on that.

Is the NAS unit really using NFS for its shares? I'd rather think it uses Samba, in which case you would mount it with -t cifs instead of -t nfs.

Whenever I saw network shares being accessed, they're always prepended with two slashes: //host/share This is independent from whether you use a host name or just an IP. And finally, in mount operations, there's even a colon in front of all that, so it's
Code:

://host/share
Quote:

Originally Posted by AmirSI (Post 5134316)
If i look on QNAP control panel i have File System: EXT4 and it is RAID6.

That's not relevant. This is an internal affair of the NAS, it is not exposed to the outside when accessing a network share. In the same way, you can access a share on a Windows PC without caring whether the Windows machine is using NTFS or FAT. That's the Black Box principle: You have an interface with certain well-specified properties; don't bother about what's beyond it.

[X] Doc CPU

AmirSI 03-14-2014 04:55 AM

Thanks, it worked.It was really Samba.
Is it possible, to make this folder mounted permanent?

The working command:
sudo mount -t cifs -o username=admin,password=admin //192.168.2.12/vmware-bkp ~/mnt/QNAP-backup/

Doc CPU 03-14-2014 05:51 AM

Hi there,

Quote:

Originally Posted by AmirSI (Post 5134350)
Thanks, it worked. It was really Samba.

fine, at least some success up to a point.

Quote:

Originally Posted by AmirSI (Post 5134350)
Is it possible, to make this folder mounted permanent?

The working command:
Code:

sudo mount -t cifs -o username=admin,password=admin //192.168.2.12/vmware-bkp ~/mnt/QNAP-backup/

Yes, it is. You'd have to add a line corresponding to the above command in /etc/fstab.
Roughly, it should look like this:

Code:

//192.168.2.12/vmware-bkp  /home/<username>/mnt/QNAP-backup  cifs username=admin,password=admin  0  0
Of course, you have to replace <username> with your actual user name, or choose a different mountpoint altogether (outside your home directory, e.g. in /mnt or /media). That's because fstab is processed under the root account, so it doesn't know what you actually mean by '~'.
Note that you have to edit /etc/fstab as root (or at least using sudo), and for good reason. Messing up this file can cause your system not to boot any more!
As a safety precaution, make a backup copy of that file before you edit it:

Code:

sudo cp /etc/fstab /etc/fstab.bak
That way, you can boot your computer from a CD or USB Live system, mount your HDD partition manually and then restore the fstab file from the saved copy if anything fails badly.

There may be another issue with mounting network shares in fstab: A friend of mine tried that on his Raspberry Pi running Raspbian, a Debian variant. He found that this wouldn't work on Raspbian, obviously that system tries to mount the network shares even before the network is up. I suspect that this may be a problem on other systems as well, but I've never tried it myself. I worked around that potential issue by using autofs for mounting my network shares only when they're accessed.

[X] Doc CPU

AmirSI 03-14-2014 06:23 AM

Thanks Doc CPU, everthing is working.


All times are GMT -5. The time now is 05:29 PM.