LinuxQuestions.org
Help answer threads with 0 replies.
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 09-15-2017, 10:58 AM   #1
Serenwipity
LQ Newbie
 
Registered: Sep 2017
Posts: 4

Rep: Reputation: Disabled
Cool Unable to write to synology NAS


Hi there!

Iḿ already spending days to connect my linux laptop (Elementary OS) to my synology NAS (DSM 4.2). I finally was able to mount my Nas share to a home folder. Even on startup . The big trick was to delay the mounting else it was to soon (i really like the speed of Linux!).
I was happy, until I actually started using my external network drive. I can read it, but not write to it. I have done pretty much everything I can find on the web, but to no result.

What i have done:
In fstab the following works (without the writing permissions)
Code:
//ipnas/NAS /home/NAS cifs credentials=/home/wiebe/.smbcredentials 0 0
I made a smbcredentials file which is read correctly on boot
As soon as I add uid=1000, gid=1000 as parameters in fstab I get an error. Also file_mode=0777 doesnt work (and many other things). Its for me a needle in a haystack. Who can help me out?

Maybe it has to do that Im unable to install swat by apt-get install swat?

Some info:
With testparm -s:
Code:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
	server string = %h server (Samba, Ubuntu)
	server role = standalone server
	map to guest = Bad User
	obey pam restrictions = Yes
	pam password change = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	unix password sync = Yes
	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	dns proxy = No
	usershare allow guests = Yes
	panic action = /usr/share/samba/panic-action %d
	idmap config * : backend = tdb


[printers]
	comment = All Printers
	path = /var/spool/samba
	create mask = 0700
	printable = Yes
	browseable = No


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
With ls -dl:
Code:
drwxrwxrwx 32 wiebe wiebe 4096 sep 15 15:23 .

Hope somebody can help me out?!
 
Old 09-15-2017, 03:25 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,599

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
The smb.conf file and swat is used to configure the samba server on your laptop which allows other computers to access files. It is not needed to access files from other computers.

Just for your information most file browsers have a built in cifs client that can connect without needing to have an entry in your /etc/fstab file. You should also have write access. It creates a virtual file system within the file browser. If you need to access the share form outside the file browser then I would mount via /etc/fstab.

Adding gid=1000,uid=1000 should of worked. What was the error message?
 
Old 09-15-2017, 04:49 PM   #3
Serenwipity
LQ Newbie
 
Registered: Sep 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply. Good to know its not the swat or smbconfig. I didnt alter it.

I use konqueror as file browser. When I add the parameters (or without) uid and gid I get the error "Äccess denied. Could not write to.." when I copy a file to the nas. I does copy the container/icon of the file to the nas, but its empty/no data. The otherway around (nas>laptop works).

But as I understand altering the fstab will not effect how konqueror mount. Thats explains a lot why nothing worked. So first step is how to get konqueror to work. Next step is that I also want to use another share for auto backup. How to solve?
 
Old 09-15-2017, 07:05 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,599

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
Elementary installs the Pantheon desktop by default. Did you install KDE?

Konqueror can browse a windows network for servers or you can specify the NAS by using the connect to server option.
If you browse the network you should be able to select the NAS -> share. You will then be prompted to enter the username/password.

I assume the NAS share has been previously configured for read/write permissions for the designated user.
 
Old 09-16-2017, 02:54 AM   #5
Serenwipity
LQ Newbie
 
Registered: Sep 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I thought KDE is another GUI/shell/desktop? How can I check if its installed and if not, how to install it without loosing eOS. Do I select lightdm or sddm?
Or do you recommend kde desktop. Im also using Playonlinux for MS Word and 1password.

If I go to the network share within konqueror and fill in username/password, I can also write to the NAS. The reason I dont prefer that is that it doesnt save username/password (didnt save it in kwallet (read many problems with it) and im not asked again), but moreover, I still cant write to the NAS from the tree view, which I really want (if possible).

The nas permissions are set correctly for the user I login in fstab, but is different from the login on the laptop (same username, different password). But the uid are probably different anyway as Synology starts uid with 1026.
 
Old 09-16-2017, 11:04 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,599

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
I would expect the following fstab line to work.
Code:
//ipnas/NAS /home/NAS cifs credentials=/home/wiebe/.smbcredentials,uid=1000,gid=1000 0 0
You can manually mount the share via the mount command to play with different options.
Code:
sudo mount -t cifs -o credentials=/home/wiebe/.smbcredentials,uid=1000,gid=1000 //ipnas/NAS /home/NAS
 
Old 09-17-2017, 05:09 AM   #7
Serenwipity
LQ Newbie
 
Registered: Sep 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
As mentioned adding uid=1000, gid=1000 to the fstab file doesnt work.

But I just found the solution by adding the following to the /etc/rc.local file
Code:
sleep 30
mount -t cifs -o credentials=/home/user/.smbcredentials,uid=1000,gid=1000 //ipnas/NAS /home/NAS

exit 0
I even deleted the line in fstab and still works.

Now I can use the view tree in Konqueror and read/write to my NAS with konqueror!
Im a happy man!

Thank you for your suggestions and time. Appreciate it!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mounting a NAS device (Synology) so I can read and write files Alligator42 Linux - Newbie 2 05-19-2017 05:33 PM
[SOLVED] NAS Synology or QNAP jefro Linux - Hardware 6 03-20-2015 08:05 PM
How to log on af Synology NAS? stardustdk Debian 2 07-12-2011 03:29 AM
nas which one between qnap ts-219p+ and synology ds211+ Gatemaze Linux - Networking 4 05-24-2011 06:37 PM
Synology NAS and RAID concepts depam Linux - Hardware 11 04-22-2010 07:28 AM

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

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