LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-09-2013, 06:46 PM   #1
Manganus
Member
 
Registered: Nov 2013
Location: San Fernando de Maspalomas
Distribution: Mint
Posts: 43

Rep: Reputation: 0
Best practice for accessing Qnap NAS from linux Mint


What's considered The Right Way, ...or the best way... to let applications work on files on a NAS.

I've no problem to find the files and directories. Nemo presents them under Networks. Our Qnap uses Ext3 internally, but seem to be accessed from Nemo with SMB/CIFS. Nemo reports their location as SMB://Qnap-name.local/public/

If I for instance want to access them from, say, rsync or a Perl script, oughtn't I put the NAS-server in the fstab?

The network is somewhat safe - i.e. behind a firewall, but with WiFi inside the network.

Thanks in advance!
 
Old 11-10-2013, 02:00 PM   #2
Manganus
Member
 
Registered: Nov 2013
Location: San Fernando de Maspalomas
Distribution: Mint
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Manganus View Post
What's considered The Right Way, ...or the best way... to let applications work on files on a NAS.
Quote:
Originally Posted by Manganus View Post
If I for instance want to access them from, say, rsync or a Perl script, oughtn't I put the NAS-server in the fstab?
Mounting on the command line works:

Code:
sudo mount -t cifs //qnap-119.local/Public/ljud/ /media/qnap-119/ljud/
sudo mount -t cifs //qnap-119.local/Public/ljud /media/qnap-119/ljud/

but the following line in /etc/fstab is of no use:
Code:
//qnap-119.local/Public/ljud     /media/qnap-119/ljud/    cifs    rw              0       0
nor does it help to insert the parameter "_netdev"

Code:
//qnap-119.local/Public/ljud     /media/qnap-119/ljud/    cifs    _netdev,rw      0       0
I ponder if the reason for this may be that the network isn't connected yet at the time when the /etc/fstab is used.

I can, however, mount with the -a option
Code:
johan@Johans-ThinkPad-T60 ~ $ ls -ls /media/qnap-119/ljud/
total 0
johan@Johans-ThinkPad-T60 ~ $ sudo mount -va  -t cifs
[sudo] password for johan: 
Password: 
mount.cifs kernel mount options: ip=192.168.2.Yyy,unc=\\qnap-119.local\Public,user=root,prefixpath=ljud,pass=********
nothing was mounted
johan@Johans-ThinkPad-T60 ~ $ ls -ls /media/qnap-119/ljud/
total 0
0 drwxr-xr-x 0 root root 0 mar 24  2012 Agusa-version av bitar
0 drwxr-xr-x 0 root root 0 mar  6  2012 Lindemän (Hans Alfredson, Tage Danielsson)
0 drwxr-xr-x 0 root root 0 jan 28  2010 Martin Ljung
johan@Johans-ThinkPad-T60 ~ $
The phrase "nothing was mounted" here does indeed surprice.
A library listing before and after that mounting of "nothing" gives the opposite impression.
 
Old 11-11-2013, 06:02 AM   #3
RuZleBiFf
LQ Newbie
 
Registered: Jan 2013
Posts: 10

Rep: Reputation: Disabled
"The Right Way" is wery vague, depending on the system.
But "The Linux Way" is to use NFS istead of cifs

Now to your mounting-problem:
I am a bit confused because you are able to mount manually without password, but as soon as you use fstab, you are asked for a password. Not sure why.
You can use "user=xxxx,pass=xxx" in fstab. See if that solves your problem.
When I used CIFS on freeNAS i had to use the parameter "nounix" to get it to mount. You could try that one too.
 
Old 11-11-2013, 07:15 AM   #4
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
This are the commands I have used in the past
Code:
# mount.cifs //192.168.1.65/Downloads /home/user1/Downloads -o domain=workgroup,rw,file_mode=0777,dir_mode=0777,uid="$USER"
that command allows me to mount the Download directory in the server to the Download directory of the client laptop you can change what directory you want to mount and into what directory you want to mount it.

This other command has worked good for me
Code:
mount -t cifs -o username=<userhere>,password=<passwordhere> //192.168.1.65/shared_Drive /home/user1/Public
For the second command
replace <userhere> and <passwordhere> with the user name and password you use to log in your server
replace user1 with the user name you use in your client machine from where you are connecting
replace Public with the name of the directory you want the files to be mounted.

Keep in mind if you use the second command your user name and password to log in in the server will be storage in the therminal history so anyone else that uses your computer would be able to find that history.

Adding your server password in the fstab file is also not recommended because anyone can read what is on that file. Unless you are o.k. with sharing that password.

Good luck to you
 
  


Reply



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
nas which one between qnap ts-219p+ and synology ds211+ Gatemaze Linux - Networking 4 05-24-2011 06:37 PM
Unable to Copy Files Over To Qnap Nas spaxz Linux - Newbie 2 05-02-2011 06:25 PM
Locked out of linux based NAS (QNAP TS-409Pro) -- My fault though kwiksand Linux - General 5 01-17-2010 04:53 PM
LXer: QNAP TS-409U Turbo NAS LXer Syndicated Linux News 0 07-15-2008 09:30 AM
QNAP NAS-server under Linux? ronald-be Linux - Hardware 2 09-16-2007 05:31 AM

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

All times are GMT -5. The time now is 05:40 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